Mini Kabibi Habibi
<local:TreeListDemoModule x:Class="TreeListDemo.MultiSelection"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:collections="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:global="clr-namespace:System.Globalization;assembly=mscorlib"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxdb="http://schemas.devexpress.com/winfx/2008/xaml/demobase"
xmlns:local="clr-namespace:TreeListDemo"
mc:Ignorable="d" d:DesignHeight="400" d:DesignWidth="800">
<local:TreeListDemoModule.Resources>
<ResourceDictionary>
<local:MultiSelectModeToBoolConverter x:Key="multiSelectModeToBoolToConverter" />
<local:EmployeeCategoryImageSelector x:Key="CategoryImageSelector" />
<dxdb:EmployeesData x:Key="employeesData"/>
</ResourceDictionary>
</local:TreeListDemoModule.Resources>
<dxdb:DemoModuleControl>
<dxdb:DemoModuleControl.OptionsContent>
<StackPanel>
<dxe:CheckEdit Margin="0,0,0,12" Content="Enable Multi-Selection" IsChecked="{Binding Path=SelectionMode, Mode=TwoWay, Converter={StaticResource multiSelectModeToBoolToConverter}}" VerticalAlignment="Top" />
<dx:GroupFrame Header="Selected Names">
<dxe:ListBoxEdit Height="300" Background="{x:Null}" Width="200" ItemsSource="{Binding Path=SelectedItems}">
<dxe:ListBoxEdit.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=FirstName}" />
<TextBlock Text=" " />
<TextBlock Text="{Binding Path=LastName}" />
</StackPanel>
</DataTemplate>
</dxe:ListBoxEdit.ItemTemplate>
</dxe:ListBoxEdit>
</dx:GroupFrame>
</StackPanel>
</dxdb:DemoModuleControl.OptionsContent>
<dxg:TreeListControl x:Name="treeList" ItemsSource="{Binding Path=DataSource, Source={StaticResource employeesData}}" DataContext="{StaticResource employeesData}" SelectionMode="Row" SelectionChanged="view_SelectionChanged">
<dxg:TreeListControl.Columns>
<dxg:TreeListColumn FieldName="JobTitle" />
<dxg:TreeListColumn FieldName="FullName" UnboundType="String" UnboundExpression="[FirstName] + ' ' + [LastName]" VisibleIndex="1" ReadOnly="True"/>
<dxg:TreeListColumn FieldName="City" />
<dxg:TreeListColumn FieldName="AddressLine1" Header="Address" />
<dxg:TreeListColumn FieldName="Phone" />
</dxg:TreeListControl.Columns>
<dxg:TreeListControl.TotalSummary>
<dxg:TreeListSummaryItem FieldName="FullName" SummaryType="Count" DisplayFormat="Total Count={0}" Alignment="Right"/>
<dxg:TreeListSummaryItem FieldName="FullName" SummaryType="Custom" DisplayFormat="Selected Count={0}" Alignment="Left"/>
</dxg:TreeListControl.TotalSummary>
<dxg:TreeListControl.View>
<dxg:TreeListView x:Name="view" ParentFieldName="ParentId" KeyFieldName="Id" AutoWidth="True"
ShowFixedTotalSummary="True" AutoExpandAllNodes="True"
CustomSummary="view_CustomSummary"
ShowNodeImages="True" NodeImageSelector="{StaticResource CategoryImageSelector}" />
</dxg:TreeListControl.View>
</dxg:TreeListControl>
</dxdb:DemoModuleControl>
</local:TreeListDemoModule>