You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
157 lines
7.2 KiB
157 lines
7.2 KiB
<!--*********************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2010-2012 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Public
|
|
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
This program can be provided to you by Xceed Software Inc. under a
|
|
proprietary commercial license agreement for use in non-Open Source
|
|
projects. The commercial version of Extended WPF Toolkit also includes
|
|
priority technical support, commercial updates, and many additional
|
|
useful WPF controls if you license Xceed Business Suite for WPF.
|
|
|
|
Visit http://xceed.com and follow @datagrid on Twitter.
|
|
|
|
********************************************************************-->
|
|
<sample:DemoView x:Class="Samples.Modules.CheckLists.Views.HomeView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sample="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
|
x:Name="demo"
|
|
Title="Check Lists"
|
|
Description="The CheckListBox and CheckComboBox controls represent a list of selected items that are displayed as CheckBoxes. Besides the common SelectedItem and SelectedItems properties, these controls give developers more alternatives for managing and handling selections.">
|
|
<sample:DemoView.Resources>
|
|
<x:Array x:Key="personProperties" Type="s:String">
|
|
<s:String>ID</s:String>
|
|
<s:String>FirstName</s:String>
|
|
<s:String>LastName</s:String>
|
|
</x:Array>
|
|
</sample:DemoView.Resources>
|
|
|
|
<Grid >
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<GroupBox Header="Features" Grid.Row="0" Margin="5">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
|
Text="Delimiter:"
|
|
Margin="2"/>
|
|
<TextBox x:Name="_delimiter"
|
|
Grid.Row="0" Grid.Column="1"
|
|
Margin="5"
|
|
HorizontalAlignment="Stretch"
|
|
Text="," />
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0"
|
|
Text="ValueMemberPath:"
|
|
Margin="2"/>
|
|
<ComboBox x:Name="_valueMemberPath"
|
|
Grid.Row="1" Grid.Column="1"
|
|
HorizontalAlignment="Stretch"
|
|
Margin="5"
|
|
ItemsSource="{StaticResource personProperties}"
|
|
SelectedIndex="0"/>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="0"
|
|
Text="SelectedValue:"
|
|
Margin="2"/>
|
|
<TextBox x:Name="_selectedValue"
|
|
Grid.Row="2" Grid.Column="1"
|
|
Margin="5"
|
|
HorizontalAlignment="Stretch"
|
|
Text="{Binding ElementName=_checkListBox, Path=SelectedValue, Mode=TwoWay}"/>
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="2"
|
|
Text="SelectedMemberPath:"
|
|
Margin="2"/>
|
|
<TextBox x:Name="_selectedMemberPath"
|
|
Grid.Row="0" Grid.Column="3"
|
|
Margin="5"
|
|
HorizontalAlignment="Stretch"
|
|
IsEnabled="False"
|
|
Text="IsSelected" />
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="2"
|
|
Text="DisplayMemberPath:"
|
|
Margin="2"/>
|
|
<ComboBox x:Name="_displayMemberPath"
|
|
Grid.Row="1" Grid.Column="3"
|
|
Margin="5"
|
|
HorizontalAlignment="Stretch"
|
|
ItemsSource="{StaticResource personProperties}"
|
|
SelectedIndex="1"/>
|
|
<TextBlock Grid.Row="2" Grid.Column="2"
|
|
Text="IsDropDownOpen:"
|
|
Margin="2"/>
|
|
<CheckBox x:Name="_isDropDownOpen"
|
|
Grid.Row="2" Grid.Column="3"
|
|
Margin="5"
|
|
HorizontalAlignment="Stretch"
|
|
Content="(CheckListBox only)"
|
|
ClickMode="Press"
|
|
IsChecked="false" />
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<GroupBox Header="Item Models" Grid.Row="1" Margin="5">
|
|
<ListBox DisplayMemberPath="ModelDisplay" FontFamily="Global Monospace"
|
|
ItemsSource="{Binding}"/>
|
|
</GroupBox>
|
|
|
|
<Grid Grid.Row="2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="CheckListBox Usage:" Margin="5" Style="{StaticResource Header}" />
|
|
<xctk:CheckListBox x:Name="_checkListBox"
|
|
Grid.Column="0"
|
|
Grid.Row="1"
|
|
Margin="5"
|
|
VerticalAlignment="Stretch"
|
|
ItemsSource="{Binding}"
|
|
Delimiter="{Binding ElementName=_delimiter, Path=Text}"
|
|
ValueMemberPath="{Binding ElementName=_valueMemberPath, Path=SelectedItem}"
|
|
SelectedMemberPath="{Binding ElementName=_selectedMemberPath, Path=Text}"
|
|
DisplayMemberPath="{Binding ElementName=_displayMemberPath, Path=SelectedItem}" />
|
|
|
|
<TextBlock Text="CheckComboBox Usage:" Grid.Column="1" Margin="5" Style="{StaticResource Header}"/>
|
|
<xctk:CheckComboBox Grid.Column="1"
|
|
Grid.Row="1"
|
|
Margin="5"
|
|
VerticalAlignment="Top"
|
|
ItemsSource="{Binding}"
|
|
Delimiter="{Binding ElementName=_delimiter, Path=Text}"
|
|
ValueMemberPath="{Binding ElementName=_valueMemberPath, Path=SelectedItem}"
|
|
SelectedMemberPath="{Binding ElementName=_selectedMemberPath, Path=Text}"
|
|
DisplayMemberPath="{Binding ElementName=_displayMemberPath, Path=SelectedItem}"
|
|
IsDropDownOpen="{Binding ElementName=_isDropDownOpen, Path=IsChecked, Mode=TwoWay}" />
|
|
</Grid>
|
|
</Grid>
|
|
</sample:DemoView>
|
|
|