-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
59 lines (59 loc) · 3.26 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
<mah:MetroWindow x:Class="DGXPopupDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:core="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:DGXPopupDemo"
xmlns:dgx="urn:tom-englert.de/DataGridExtensions"
mc:Ignorable="d"
Title="MainWindow"
Height="450"
Width="800">
<mah:MetroWindow.Resources>
<ObjectDataProvider x:Key="orderStatus"
MethodName="GetValues"
ObjectType="{x:Type core:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type Type="local:OrderStatus" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<Style x:Key="MyDataGridColumnHeader"
TargetType="DataGridColumnHeader"
BasedOn="{StaticResource MahApps.Styles.DataGridColumnHeader}">
<Setter Property="controls:ControlsHelper.ContentCharacterCasing"
Value="Normal" />
</Style>
<Style TargetType="DataGridColumnHeader"
BasedOn="{StaticResource MyDataGridColumnHeader}" />
<ControlTemplate x:Key="MultipleChoiceFilter">
<dgx:MultipleChoiceFilter Filter="{Binding Path=Filter, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=dgx:DataGridFilterColumnControl}}" />
</ControlTemplate>
</mah:MetroWindow.Resources>
<Grid>
<DataGrid Name="dataGrid"
ItemsSource="{Binding}"
AutoGenerateColumns="False"
dgx:DataGridFilter.IsAutoFilterEnabled="True">
<DataGrid.Columns>
<DataGridTextColumn Header="ID"
Binding="{Binding ID}"
dgx:DataGridFilterColumn.Template="{StaticResource NumericFilterTemplate}" />
<DataGridTextColumn Header="First Name"
Binding="{Binding FirstName}" />
<DataGridTextColumn Header="Last Name"
Binding="{Binding LastName}" />
<DataGridHyperlinkColumn Header="Email"
Binding="{Binding Email}" />
<DataGridCheckBoxColumn Header="Member?"
Binding="{Binding IsMember}" />
<DataGridComboBoxColumn Header="Order Status"
SelectedItemBinding="{Binding Status}"
ItemsSource="{Binding Source={StaticResource orderStatus}}"
dgx:DataGridFilterColumn.Template="{StaticResource MultipleChoiceFilter}" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</mah:MetroWindow>