|
9 | 9 | <UserControl.Resources>
|
10 | 10 | <ResourceDictionary>
|
11 | 11 | <ResourceDictionary.MergedDictionaries>
|
| 12 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" /> |
12 | 13 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
|
13 | 14 | </ResourceDictionary.MergedDictionaries>
|
14 | 15 | </ResourceDictionary>
|
15 | 16 | </UserControl.Resources>
|
16 |
| - <Grid Margin="8"> |
| 17 | + <Grid Margin="8" > |
17 | 18 | <Grid.RowDefinitions>
|
18 |
| - <RowDefinition/> |
19 |
| - <RowDefinition Height="Auto"/> |
| 19 | + <RowDefinition Height="Auto" /> |
| 20 | + <RowDefinition Height="Auto" /> |
| 21 | + <RowDefinition Height="Auto" /> |
| 22 | + <RowDefinition Height="Auto" /> |
| 23 | + <RowDefinition Height="Auto" /> |
| 24 | + <RowDefinition Height="Auto" /> |
20 | 25 | </Grid.RowDefinitions>
|
21 |
| - <Grid.ColumnDefinitions> |
22 |
| - <ColumnDefinition Width="1*" /> |
23 |
| - <ColumnDefinition Width="1*" /> |
24 |
| - <ColumnDefinition Width="1*" /> |
25 |
| - </Grid.ColumnDefinitions> |
26 |
| - <ListBox Grid.Column="0" IsEnabled="{Binding IsChecked, ElementName=EnableListBox}"> |
27 |
| - <TextBlock>Plain</TextBlock> |
28 |
| - <TextBlock>Old</TextBlock> |
29 |
| - <TextBlock>ListBox</TextBlock> |
30 |
| - <TextBlock>Full of junk</TextBlock> |
31 |
| - </ListBox> |
32 |
| - <CheckBox Name="EnableListBox" Grid.Row="1" IsChecked="True">Enabled</CheckBox> |
33 |
| - <!-- piece together your own items control to create some nice stuff that will make everyone think you are cool. and rightly so, because you are cool. you might even be a hipster for all I know --> |
34 |
| - <ItemsControl Grid.Column="1" ItemsSource="{Binding Items1}" |
| 26 | + <TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}">ListBox</TextBlock> |
| 27 | + <Grid Grid.Row="1"> |
| 28 | + <Grid.RowDefinitions> |
| 29 | + <RowDefinition/> |
| 30 | + <RowDefinition Height="Auto"/> |
| 31 | + </Grid.RowDefinitions> |
| 32 | + <Grid.ColumnDefinitions> |
| 33 | + <ColumnDefinition Width="1*" /> |
| 34 | + <ColumnDefinition Width="1*" /> |
| 35 | + <ColumnDefinition Width="1*" /> |
| 36 | + </Grid.ColumnDefinitions> |
| 37 | + <ListBox Grid.Column="0" IsEnabled="{Binding IsChecked, ElementName=EnableListBox}"> |
| 38 | + <TextBlock>Plain</TextBlock> |
| 39 | + <TextBlock>Old</TextBlock> |
| 40 | + <TextBlock>ListBox</TextBlock> |
| 41 | + <TextBlock>Full of junk</TextBlock> |
| 42 | + </ListBox> |
| 43 | + <CheckBox Name="EnableListBox" Grid.Row="1" IsChecked="True">Enabled</CheckBox> |
| 44 | + <!-- piece together your own items control to create some nice stuff that will make everyone think you are cool. and rightly so, because you are cool. you might even be a hipster for all I know --> |
| 45 | + <ItemsControl Grid.Column="1" ItemsSource="{Binding Items1}" |
35 | 46 | Grid.IsSharedSizeScope="True"
|
36 | 47 | Margin="12 0 12 0">
|
37 |
| - <ItemsControl.ItemTemplate> |
38 |
| - <DataTemplate DataType="{x:Type domain:SelectableViewModel}"> |
39 |
| - <Border x:Name="Border" Padding="8"> |
40 |
| - <Grid> |
41 |
| - <Grid.ColumnDefinitions> |
42 |
| - <ColumnDefinition SharedSizeGroup="Checkerz" /> |
43 |
| - <ColumnDefinition /> |
44 |
| - </Grid.ColumnDefinitions> |
45 |
| - <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"/> |
46 |
| - <StackPanel Margin="8 0 0 0" Grid.Column="1"> |
47 |
| - <TextBlock FontWeight="Bold" Text="{Binding Name}" /> |
48 |
| - <TextBlock Text="{Binding Description}" /> |
49 |
| - </StackPanel> |
50 |
| - </Grid> |
51 |
| - </Border> |
52 |
| - <DataTemplate.Triggers> |
53 |
| - <DataTrigger Binding="{Binding IsSelected}" Value="True"> |
54 |
| - <Setter TargetName="Border" Property="Background" Value="{DynamicResource MaterialDesignSelection}" /> |
55 |
| - </DataTrigger> |
56 |
| - </DataTemplate.Triggers> |
57 |
| - </DataTemplate> |
58 |
| - </ItemsControl.ItemTemplate> |
59 |
| - </ItemsControl> |
60 |
| - <!-- and here's another --> |
61 |
| - <ItemsControl Grid.Column="2" ItemsSource="{Binding Items2}" |
| 48 | + <ItemsControl.ItemTemplate> |
| 49 | + <DataTemplate DataType="{x:Type domain:SelectableViewModel}"> |
| 50 | + <Border x:Name="Border" Padding="8"> |
| 51 | + <Grid> |
| 52 | + <Grid.ColumnDefinitions> |
| 53 | + <ColumnDefinition SharedSizeGroup="Checkerz" /> |
| 54 | + <ColumnDefinition /> |
| 55 | + </Grid.ColumnDefinitions> |
| 56 | + <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"/> |
| 57 | + <StackPanel Margin="8 0 0 0" Grid.Column="1"> |
| 58 | + <TextBlock FontWeight="Bold" Text="{Binding Name}" /> |
| 59 | + <TextBlock Text="{Binding Description}" /> |
| 60 | + </StackPanel> |
| 61 | + </Grid> |
| 62 | + </Border> |
| 63 | + <DataTemplate.Triggers> |
| 64 | + <DataTrigger Binding="{Binding IsSelected}" Value="True"> |
| 65 | + <Setter TargetName="Border" Property="Background" Value="{DynamicResource MaterialDesignSelection}" /> |
| 66 | + </DataTrigger> |
| 67 | + </DataTemplate.Triggers> |
| 68 | + </DataTemplate> |
| 69 | + </ItemsControl.ItemTemplate> |
| 70 | + </ItemsControl> |
| 71 | + <!-- and here's another --> |
| 72 | + <ItemsControl Grid.Column="2" ItemsSource="{Binding Items2}" |
62 | 73 | Grid.IsSharedSizeScope="True">
|
63 |
| - <ItemsControl.ItemTemplate> |
64 |
| - <DataTemplate DataType="{x:Type domain:SelectableViewModel}"> |
65 |
| - <Border x:Name="Border" Padding="8" BorderThickness="0 0 0 1" BorderBrush="{DynamicResource MaterialDesignDivider}"> |
66 |
| - <Grid> |
67 |
| - <Grid.ColumnDefinitions> |
68 |
| - <ColumnDefinition SharedSizeGroup="Checkerz" /> |
69 |
| - <ColumnDefinition /> |
70 |
| - </Grid.ColumnDefinitions> |
71 |
| - <ToggleButton VerticalAlignment="Center" IsChecked="{Binding IsSelected}" |
| 74 | + <ItemsControl.ItemTemplate> |
| 75 | + <DataTemplate DataType="{x:Type domain:SelectableViewModel}"> |
| 76 | + <Border x:Name="Border" Padding="8" BorderThickness="0 0 0 1" BorderBrush="{DynamicResource MaterialDesignDivider}"> |
| 77 | + <Grid> |
| 78 | + <Grid.ColumnDefinitions> |
| 79 | + <ColumnDefinition SharedSizeGroup="Checkerz" /> |
| 80 | + <ColumnDefinition /> |
| 81 | + </Grid.ColumnDefinitions> |
| 82 | + <ToggleButton VerticalAlignment="Center" IsChecked="{Binding IsSelected}" |
72 | 83 | Style="{StaticResource MaterialDesignActionLightToggleButton}"
|
73 | 84 | Content="{Binding Code}" />
|
74 |
| - <StackPanel Margin="8 0 0 0" Grid.Column="1"> |
75 |
| - <TextBlock FontWeight="Bold" Text="{Binding Name}" /> |
76 |
| - <TextBlock Text="{Binding Description}" /> |
77 |
| - </StackPanel> |
78 |
| - </Grid> |
79 |
| - </Border> |
80 |
| - <DataTemplate.Triggers> |
81 |
| - <DataTrigger Binding="{Binding IsSelected}" Value="True"> |
82 |
| - <Setter TargetName="Border" Property="Background" Value="{DynamicResource MaterialDesignSelection}" /> |
83 |
| - </DataTrigger> |
84 |
| - </DataTemplate.Triggers> |
85 |
| - </DataTemplate> |
86 |
| - </ItemsControl.ItemTemplate> |
87 |
| - </ItemsControl> |
| 85 | + <StackPanel Margin="8 0 0 0" Grid.Column="1"> |
| 86 | + <TextBlock FontWeight="Bold" Text="{Binding Name}" /> |
| 87 | + <TextBlock Text="{Binding Description}" /> |
| 88 | + </StackPanel> |
| 89 | + </Grid> |
| 90 | + </Border> |
| 91 | + <DataTemplate.Triggers> |
| 92 | + <DataTrigger Binding="{Binding IsSelected}" Value="True"> |
| 93 | + <Setter TargetName="Border" Property="Background" Value="{DynamicResource MaterialDesignSelection}" /> |
| 94 | + </DataTrigger> |
| 95 | + </DataTemplate.Triggers> |
| 96 | + </DataTemplate> |
| 97 | + </ItemsControl.ItemTemplate> |
| 98 | + </ItemsControl> |
| 99 | + </Grid> |
| 100 | + <TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" Grid.Row="2" Margin="0 32 0 0">ListView</TextBlock> |
| 101 | + <ListView Grid.Row="3"> |
| 102 | + <ListViewItem> |
| 103 | + Hello |
| 104 | + </ListViewItem> |
| 105 | + <ListViewItem> |
| 106 | + World |
| 107 | + </ListViewItem> |
| 108 | + <ListViewItem> |
| 109 | + :) |
| 110 | + </ListViewItem> |
| 111 | + </ListView> |
| 112 | + <TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" Grid.Row="4" Margin="0 32 0 0">ListView.GridView</TextBlock> |
| 113 | + <ListView Grid.Row="5" ItemsSource="{Binding Items1}"> |
| 114 | + <ListView.View> |
| 115 | + <GridView> |
| 116 | + <GridViewColumn DisplayMemberBinding="{Binding Code}" Header="Code" /> |
| 117 | + <GridViewColumn DisplayMemberBinding="{Binding Name}" Header="Name" /> |
| 118 | + <GridViewColumn DisplayMemberBinding="{Binding Description}" Header="Description" /> |
| 119 | + </GridView> |
| 120 | + </ListView.View> |
| 121 | + </ListView> |
88 | 122 | </Grid>
|
| 123 | + |
89 | 124 | </UserControl>
|
0 commit comments