/
MainWindow.xaml
38 lines (34 loc) · 1.84 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<Window
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
x:Class="TreeList_DataBinding.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TreeList_DataBinding"
xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal"
Title="MainWindow" Height="350" Width="525">
<Window.DataContext>
<local:ViewModel/>
</Window.DataContext>
<Window.Resources>
<DataTemplate x:Key="SummaryTemplate">
<ContentControl>
<dxg:TreeListSummaryItem FieldName="{Binding Path=(dxi:DependencyObjectExtensions.DataContext).FieldName, RelativeSource={RelativeSource Self}}"
SummaryType="{Binding Path=(dxi:DependencyObjectExtensions.DataContext).Type, RelativeSource={RelativeSource Self}}"/>
</ContentControl>
</DataTemplate>
</Window.Resources>
<Grid>
<dxg:TreeListControl Name="treeList" ItemsSource="{Binding SourceList}">
<dxg:TreeListControl.Columns>
<dxg:TreeListColumn FieldName="Name"/>
<dxg:TreeListColumn FieldName="Statistics"/>
<dxg:TreeListColumn FieldName="Department"/>
</dxg:TreeListControl.Columns>
<dxg:TreeListControl.View>
<dxg:TreeListView Name="treeListView1" AutoWidth="False" ShowTotalSummary="True"
KeyFieldName="ID" ParentFieldName="ParentID"
NodeSummarySource="{Binding SummaryList}" NodeSummaryGeneratorTemplate="{StaticResource SummaryTemplate}" ShowNodeFooters="True"/>
</dxg:TreeListControl.View>
</dxg:TreeListControl>
</Grid>
</Window>