-
Notifications
You must be signed in to change notification settings - Fork 0
/
GridWithHeader.xaml
78 lines (66 loc) · 3.13 KB
/
GridWithHeader.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
<UserControl x:Class="Computer_Support_Info.GridWithHeader"
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:local="clr-namespace:Computer_Support_Info"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
mc:Ignorable="d"
HorizontalAlignment="Stretch"
d:DesignHeight="450" d:DesignWidth="800"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
FontFamily="{materialDesign:MaterialDesignFont}"
>
<UserControl.Resources>
<CollectionViewSource x:Key="SortedList" Source="{Binding ListOfValues}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="Order" />
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
</UserControl.Resources>
<Grid VerticalAlignment="Stretch" Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0"
Background="#FFF3CB01"
FontWeight="Bold"
Padding="4 4 4 4"
Content="{Binding Title}" />
<DataGrid
x:Name="UserGrid"
ItemsSource="{Binding Source={StaticResource SortedList}}"
AutoGenerateColumns="False"
HorizontalAlignment="Stretch"
HeadersVisibility="None"
CanUserSortColumns="False"
CanUserResizeRows="False"
Grid.Row="1"
IsReadOnly="True"
materialDesign:DataGridAssist.CellPadding="4 2 4 4"
materialDesign:DataGridAssist.ColumnHeaderPadding="4 4 4 4"
Loaded="UserGrid_Loaded"
SizeChanged="UserGrid_SizeChanged"
>
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="200" />
<DataGridTextColumn Header="Wert" Binding="{Binding Value}" Width="600" />
<DataGridTextColumn Header="Order" Binding="{Binding Order}" Visibility="Hidden" />
</DataGrid.Columns>
<!--<DataGrid.Resources>
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<DataTrigger Binding="{Binding MakeBold}" Value="True">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.Resources>-->
</DataGrid>
</Grid>
</UserControl>