This repository has been archived by the owner on Sep 25, 2023. It is now read-only.
/
MainWindow.xaml
102 lines (100 loc) · 5.9 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" x:Class="WpfApplication6.MainWindow"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:local="clr-namespace:WpfApplication6"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxcn="clr-namespace:DevExpress.Xpf.Core.Native;assembly=DevExpress.Xpf.Core.v17.1"
xmlns:dxght="clr-namespace:DevExpress.Xpf.Grid.HitTest"
Title="MainWindow" Height="350" Width="535">
<Window.DataContext>
<local:ViewModel />
</Window.DataContext>
<Window.Resources>
<Style TargetType="dxg:GridColumnHeader">
<Setter Property="ShowFilterButtonOnHover" Value="False" />
</Style>
<ControlTemplate x:Key="{dxgt:GridColumnHeaderThemeKey ResourceKey=ControlTemplate, ThemeName=Office2016White}" TargetType="{x:Type dxg:GridColumnHeaderBase}">
<local:MyColumnHeaderDockPanel x:Name="PART_LayoutPanel" ContentMargin="{StaticResource {dxgt:GridColumnHeaderThemeKey ResourceKey=ContentMargin, ThemeName=Office2016White}}">
<Border x:Name="PART_Border" BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="0,0,1,1" />
</local:MyColumnHeaderDockPanel>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="HasRightSibling" Value="True" />
<Condition Property="HasLeftSibling" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="BorderThickness" Value="1,0,1,1" TargetName="PART_Border" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="HasRightSibling" Value="True" />
<Condition Property="HasLeftSibling" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="BorderThickness" Value="0,0,1,1" TargetName="PART_Border" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="HasRightSibling" Value="False" />
<Condition Property="HasLeftSibling" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="BorderThickness" Value="1,0,0,1" TargetName="PART_Border" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="HasRightSibling" Value="False" />
<Condition Property="HasLeftSibling" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="BorderThickness" Value="0,0,0,1" TargetName="PART_Border" />
</MultiTrigger>
<Trigger Property="ColumnPosition" Value="Standalone">
<Setter Property="ContentMargin" Value="5,4" TargetName="PART_LayoutPanel" />
<Setter Property="BorderThickness" TargetName="PART_Border" Value="1" />
</Trigger>
<Trigger Property="ColumnPosition" Value="Right">
<Setter Property="BorderThickness" TargetName="PART_Border" Value="1,0,0,1" />
</Trigger>
<Trigger Property="dxg:ColumnBase.HeaderPresenterType" Value="GroupPanel">
<Setter Property="Margin" TargetName="PART_Border">
<Setter.Value>
<Binding Path="(dxg:GridColumn.MergeWithPreviousGroup)">
<Binding.Converter>
<dx:BoolToObjectConverter FalseValue="2,0" TrueValue="-3,0,2,0" />
</Binding.Converter>
</Binding>
</Setter.Value>
</Setter>
<Setter Property="ContentMargin" Value="7,4" TargetName="PART_LayoutPanel" />
<Setter Property="Margin" TargetName="PART_LayoutPanel">
<Setter.Value>
<Binding Path="(dxg:GridColumn.GroupLevel)">
<Binding.Converter>
<dxg:GroupPanelPaddingConverter Offset="5" />
</Binding.Converter>
</Binding>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Top" TargetName="PART_LayoutPanel" />
</Trigger>
<Trigger Property="dx:ThemeManager.IsTouchEnabled" Value="True">
<Setter Property="ContentMargin" TargetName="PART_LayoutPanel" Value="13,12,13,13" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Window.Resources>
<Grid>
<dxg:GridControl Name="grid1" ItemsSource="{Binding List}" AutoGenerateColumns="AddNew">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Name" AllowAutoFilter="True" />
<dxg:GridColumn FieldName="FirstValue" />
<dxg:GridColumn FieldName="SecondValue" />
<dxg:GridColumn FieldName="IsCompleted" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView />
</dxg:GridControl.View>
</dxg:GridControl>
</Grid>
</Window>