You can easily create a C1DropDown control at design time in XAML and in code. Note that if you create a C1DropDown control as in the following steps, it will appear empty. You will need to add items to the control. For an example, see Adding Content to C1DropDown.
In XAML
To create a C1DropDown control using XAML markup, complete the following steps:
Markup Copy Code <Page xmlns:Xaml="using:C1.Xaml" x:Class="DropDownTest.MainPage" xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:DropDownTest" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
Markup Copy Code <Grid x:Name="LayoutRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <Xaml:C1DropDown Name="c1dropdown1" /> </Grid>
This markup will create an empty C1DropDown control named "c1dropdown1" and set the control's size.
In Code
To create a C1DropDown control in code, complete the following steps:
C# Copy Codeusing C1.Xaml;
C# Copy CodeC1DropDown c1dropdown1 = new C1DropDown(); c1dropdown1.Height = 30; c1dropdown1.Width = 100; LayoutRoot.Children.Add(c1dropdown1);
This code will create an empty C1DropDown control named "c1dropdown1", set the control's size, and add the control to the page.
What You've Accomplished
You've created a C1DropDown control. Note that when you create a C1DropDown control as in the above steps, it will appear empty. You can add items to the control that can be interacted with at run time. For an example, see Adding Content to C1DropDown.