All the controls missing in WPF. Over 1 million downloads.
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.

280 lines
12 KiB

<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.CheckLists.Views.CheckListsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:s="clr-namespace:System;assembly=mscorlib"
x:Name="demo"
Title="Check lists">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
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.
</Paragraph>
</local:DemoView.Description>
<local: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>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0"
Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0"
Header="Common Features" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="120" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0"
Grid.Column="0"
Text="Delimiter:"
Margin="2,5,5,5"
VerticalAlignment="Center" />
<TextBox x:Name="_delimiter"
Grid.Row="0"
Grid.Column="1"
Margin="5"
Text=","
VerticalAlignment="Center"/>
<TextBlock Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center"
Text="ValueMemberPath:"
Margin="2,5,5,5" />
<ComboBox x:Name="_valueMemberPath"
Grid.Row="1"
Grid.Column="1"
Margin="5"
VerticalAlignment="Center"
ItemsSource="{StaticResource personProperties}"
SelectedIndex="0" />
<TextBlock Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center"
Text="SelectedValue:"
Margin="2,5,5,5" />
<TextBox x:Name="_selectedValue"
Grid.Row="2"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
Text="{Binding ElementName=_checkListBox, Path=SelectedValue, Mode=TwoWay}" />
<TextBlock Grid.Row="3"
Grid.Column="0"
Text="SelectedMemberPath:"
VerticalAlignment="Center"
Margin="2,5,5,5" />
<TextBox x:Name="_selectedMemberPath"
Grid.Row="3"
Grid.Column="1"
Margin="5"
VerticalAlignment="Center"
IsEnabled="False"
Text="IsSelected" />
<TextBlock Grid.Row="0"
Grid.Column="2"
Text="DisplayMemberPath:"
VerticalAlignment="Center"
Margin="5" />
<ComboBox x:Name="_displayMemberPath"
Grid.Row="0"
Grid.Column="3"
Margin="5"
Width="110"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ItemsSource="{StaticResource personProperties}"
SelectedIndex="1" />
<TextBlock Grid.Row="1"
Grid.Column="2"
Text="IsSelectAllActive:"
VerticalAlignment="Center"
Margin="5" />
<CheckBox x:Name="_isSelectAllActive"
Grid.Row="1"
Grid.Column="3"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ClickMode="Press"
IsChecked="False"/>
<TextBlock Grid.Row="2"
Grid.Column="2"
Text="SelectAllContent:"
VerticalAlignment="Center"
Margin="5" />
<TextBox x:Name="_selectAllContent"
Grid.Row="2"
Grid.Column="3"
Margin="5"
VerticalAlignment="Center"
Text="SelectAll"
IsEnabled="{Binding IsChecked, ElementName=_isSelectAllActive}"/>
</Grid>
</GroupBox>
<GroupBox Grid.Column="1"
Header="CheckComboBox Features"
Margin="5,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0"
Grid.Column="0"
Text="IsEditable:"
VerticalAlignment="Center"
Margin="5" />
<CheckBox x:Name="_isEditable"
Grid.Row="0"
Grid.Column="1"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ClickMode="Press"
IsChecked="{Binding IsEditable, ElementName=_checkComboBox}" />
<TextBlock Grid.Row="1"
Grid.Column="0"
Text="IsDropDownOpen:"
VerticalAlignment="Center"
Margin="5" />
<CheckBox x:Name="_isDropDownOpen"
Grid.Row="1"
Grid.Column="1"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ClickMode="Press"
IsChecked="{Binding IsDropDownOpen, ElementName=_checkComboBox}" />
<TextBlock Grid.Row="2"
Grid.Column="0"
Text="MaxDropDownHeight:"
VerticalAlignment="Center"
Margin="5" />
<xctk:DoubleUpDown x:Name="_maxDropDownHeight"
Grid.Row="2"
Grid.Column="1"
Width="45"
Value="{Binding MaxDropDownHeight, ElementName=_checkComboBox}"
DefaultValue="150"
AllowInputSpecialValues="PositiveInfinity"
Minimum="0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
</Grid>
<GroupBox Header="Item Models"
Grid.Row="1"
Margin="5,2,5,2">
<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,2,5,2"
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}"
IsSelectAllActive="{Binding ElementName=_isSelectAllActive, Path=IsChecked}"
SelectAllContent="{Binding ElementName=_selectAllContent, Path=Text}"/>
<TextBlock Text="CheckComboBox Usage:"
Grid.Column="1"
Margin="5,2,5,2"
Style="{StaticResource Header}" />
<xctk:CheckComboBox Grid.Column="1"
x:Name="_checkComboBox"
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}"
IsSelectAllActive="{Binding ElementName=_isSelectAllActive, Path=IsChecked}"
SelectAllContent="{Binding ElementName=_selectAllContent, Path=Text}"
IsEditable="False"
IsDropDownOpen="false"
MaxDropDownHeight="100" />
</Grid>
</Grid>
</local:DemoView>