-
-
Notifications
You must be signed in to change notification settings - Fork 521
/
ResourcesView.xaml
109 lines (105 loc) · 5.88 KB
/
ResourcesView.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
103
104
105
106
107
108
109
<UserControl x:Class="FluentTest.ResourcesView"
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:fluentTest="clr-namespace:FluentTest"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<DataGrid AutoGenerateColumns="False"
EnableRowVirtualization="True"
HeadersVisibility="Column"
HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding Path=ThemeResources, RelativeSource={RelativeSource AncestorType=fluentTest:ResourcesView}}"
VerticalScrollBarVisibility="Visible"
VirtualizingPanel.IsVirtualizingWhenGrouping="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Key"
Width="400"
Binding="{Binding Key}"
IsReadOnly="True" />
<DataGridTemplateColumn Header="Value"
Width="100"
IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="fluentTest:ThemeResource">
<ContentControl Content="{Binding Value}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="StringValue"
Width="200"
Binding="{Binding StringValue}"
IsReadOnly="True" />
<DataGridTextColumn Header="Source"
Width="200"
Binding="{Binding Source}"
IsReadOnly="True" />
</DataGrid.Columns>
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Header>
<Border Margin="5 0 0 0"
Background="#FF959595"
BorderBrush="#FF727272"
BorderThickness="0 0 0 1">
<StackPanel Height="23"
Margin="3 0 0 0"
Background="#FFE6E6E6"
Orientation="Horizontal">
<TextBlock Margin="5 0 0 0"
VerticalAlignment="Center"
FontWeight="Bold"
Text="{Binding Path=Name}" />
</StackPanel>
</Border>
</Expander.Header>
<ItemsPresenter Margin="10 0 0 0" />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Header>
<Border Margin="5 0 0 0"
Background="#FF959595"
BorderBrush="#FF727272"
BorderThickness="0 0 0 1">
<StackPanel Height="23"
Margin="3 0 0 0"
Background="#FFE6E6E6"
Orientation="Horizontal">
<TextBlock Margin="5 0 0 0"
VerticalAlignment="Center"
FontWeight="Bold"
Text="{Binding Path=Name}" />
</StackPanel>
</Border>
</Expander.Header>
<ItemsPresenter Margin="5 0 0 0" />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</DataGrid>
</UserControl>