ColorPicker > Quick Start: ColorPicker for Silverlight > Step 2 of 4: Adding C1ColorPicker Controls |
In the previous step you created a new Silverlight project and added a Rectangle control with a gradient to the application. In this step you'll continue by adding C1ColorPicker controls that will control the gradient fill in the Rectangle.
Complete the following steps:
<StackPanel Height="Auto" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal"></StackPanel>
The C1ColorPicker icon will appear in the Toolbox under the Assets button.
The XAML will appear similar to the following:
<c1:C1ColorPicker x:Name="c1cp1" Width="65" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5" DropDownDirection="AboveOrBelow" Mode="Advanced" SelectedColor="Black"/>
<c1:C1ColorPicker x:Name="c1cp2" Width="65" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5" DropDownDirection="BelowOrAbove" Mode="Both" SelectedColor="White"/>
Note that some properties have been set to different values, including the Mode and DropDownDirection which have been set to their default values.
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="clr-namespace:C1.Silverlight.Extended;assembly=C1.Silverlight.Extended" x:Class="C1ColorPicker.MainPage" Width="Auto" Height="Auto">
The page's Design view should now look similar to the following image:
You've successfully set up your application's user interface, but if you run your application right now the color pickers will do nothing if you select a color. In the next step you'll add code to your application to add functionality to the controls.