This project is read-only.

DropDown Control Usage

Go to properties, methods and events
Go to screenshot

for all samples
...
xmlns:DevPhone="clr-namespace:DevPhone.Controls;assembly=DevPhone.Controls.Toolkit"
...

Basic
<DevPhone:DropDownControl Header="Header Sample">
    <DevPhone:DropDownItem Content="Item1"/>
    <DevPhone:DropDownItem Content="Item2"/>
    <DevPhone:DropDownItem Content="Item3"/>
    <DevPhone:DropDownItem Content="Item4"/>
</DevPhone:DropDownControl>

<DevPhone:DropDownControl Header="Header Sample" SelectedItem="Item3">
    <DevPhone:DropDownItem Content="Item1"/>
    <DevPhone:DropDownItem Content="Item2"/>
    <DevPhone:DropDownItem Content="Item3"/>
    <DevPhone:DropDownItem Content="Item4"/>
</DevPhone:DropDownControl>

<DevPhone:DropDownControl Header="Header Sample" SelectedIndex="2">
    <DevPhone:DropDownItem Content="Item1"/>
    <DevPhone:DropDownItem Content="Item2"/>
    <DevPhone:DropDownItem Content="Item3"/>
    <DevPhone:DropDownItem Content="Item4"/>
</DevPhone:DropDownControl>

Colors and ItemCountThreshold
<DevPhone:DropDownControl Header="Header Sample" Margin="0,20,0,0" SelectedIndex="0" EllipseBrush="#FFE2771B" EllipseArrow="#FF1DFFB9" ControlBackground="#72F83900" ControlForeground="#FFEBFF00" ItemCountThreshold="2">
    <DevPhone:DropDownItem Content="Item1"/>
    <DevPhone:DropDownItem Content="Item2"/>
    <DevPhone:DropDownItem Content="Item3"/>
    <DevPhone:DropDownItem Content="Item4"/>
</DevPhone:DropDownControl>

DataBinding
<DevPhone:DropDownControl x:Name="Cbo1" Header="Sample DataBinding" />

code
...
var datacbo1 = new string[] {"DataItem1", "DataItem2", "DataItem3", "DataItem4", "DataItem5"};
Cbo1.ItemsSource = datacbo1;
Cbo1.SelectedItem = "DataItem2";
...

Templates
<DevPhone:DropDownControl x:Name="Cbo2">
    <DevPhone:DropDownControl.HeaderTemplate>
        <DataTemplate>
            <TextBlock Text="DataBinding  with selected template" FontSize="18"  Foreground="#FFFF7600" FontWeight="Bold" FontStyle="Italic" />
        </DataTemplate>
    </DevPhone:DropDownControl.HeaderTemplate>
    <DevPhone:DropDownControl.SelectedTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Name}"/>
        </DataTemplate>
    </DevPhone:DropDownControl.SelectedTemplate>
    <DevPhone:DropDownControl.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding Photo}" />
                <TextBlock Text="{Binding Name}" Margin="10,0,0,0" />
            </StackPanel>
        </DataTemplate>
    </DevPhone:DropDownControl.ItemTemplate
</DevPhone:DropDownControl>

Code
var datacbo2 = new ModelFruits[]
{
    new ModelFruits{ Photo = new Uri("/Data/Fruits/apple_over.png", UriKind.Relative), Name = "Apple"},
    new ModelFruits{ Photo = new Uri("/Data/Fruits/bananas_over.png", UriKind.Relative), Name = "Banana"},
    new ModelFruits{ Photo = new Uri("/Data/Fruits/cherry_over.png", UriKind.Relative), Name = "Cherry"},
    new ModelFruits{ Photo = new Uri("/Data/Fruits/grapes_over.png", UriKind.Relative), Name = "Grape"},
    new ModelFruits{ Photo = new Uri("/Data/Fruits/pineapple_over.png", UriKind.Relative), Name = "Pineapple"},
    new ModelFruits{ Photo = new Uri("/Data/Fruits/strawberry_over.png", UriKind.Relative), Name = "Strawberry"},
};
Cbo2.ItemsSource = datacbo2;
Cbo2.SelectedIndex = 2;

Last edited Jun 3, 2012 at 4:25 PM by FCerqueira, version 3

Comments

No comments yet.