|
4 | 4 | xmlns:wpfExample="clr-namespace:MaterialDesignColors.WpfExample" |
5 | 5 | xmlns:domain="clr-namespace:MaterialDesignColors.WpfExample.Domain" |
6 | 6 | xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf" |
| 7 | + xmlns:system="clr-namespace:System;assembly=mscorlib" |
7 | 8 | Title="Material Design in XAML" Height="800" Width="1100" |
8 | 9 | TextElement.Foreground="{DynamicResource MaterialDesignBody}" |
9 | 10 | TextElement.FontWeight="Medium" |
|
19 | 20 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" /> |
20 | 21 | </ResourceDictionary.MergedDictionaries> |
21 | 22 | <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
| 23 | + |
| 24 | + <!-- data template used for the dialogs example, defines a View for a ViewModel of type DateTime --> |
| 25 | + <DataTemplate DataType="{x:Type system:DateTime}"> |
| 26 | + <StackPanel Margin="16"> |
| 27 | + <TextBlock>England win the World Cup:</TextBlock> |
| 28 | + <TextBlock Margin="0 8 0 0" Text="{Binding }" /> |
| 29 | + <TextBlock Margin="0 8 0 0" >You will never see that again.</TextBlock> |
| 30 | + <Button Margin="0 8 0 0" IsDefault="True" Command="{x:Static wpf:DialogHost.CloseDialogCommand}" Style="{DynamicResource MaterialDesignFlatButton}">AWESOME</Button> |
| 31 | + </StackPanel> |
| 32 | + </DataTemplate> |
22 | 33 | </ResourceDictionary> |
23 | 34 | </Window.Resources> |
24 | 35 |
|
25 | | - <DockPanel> |
26 | | - <wpf:ColorZone Padding="16" Effect="{StaticResource MaterialDesignShadowDepth2}" |
27 | | - Mode="PrimaryMid" DockPanel.Dock="Top"> |
28 | | - <DockPanel> |
29 | | - <ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}" IsChecked="True" |
30 | | - x:Name="MenuToggleButton"/> |
31 | | - <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22">Material Design In XAML Toolkit</TextBlock> |
32 | | - </DockPanel> |
33 | | - </wpf:ColorZone> |
34 | | - <ListBox DockPanel.Dock="Left" x:Name="DemoItemsListBox" Margin="16 16 0 16" SelectedIndex="0" |
35 | | - Visibility="{Binding ElementName=MenuToggleButton, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"> |
36 | | - <ListBox.ItemTemplate> |
37 | | - <DataTemplate DataType="domain:DemoItem"> |
38 | | - <TextBlock Text="{Binding Name}" /> |
39 | | - </DataTemplate> |
40 | | - </ListBox.ItemTemplate> |
41 | | - <domain:DemoItem Name="Home"> |
42 | | - <domain:DemoItem.Content> |
43 | | - <wpfExample:Home /> |
44 | | - </domain:DemoItem.Content> |
45 | | - </domain:DemoItem> |
46 | | - <domain:DemoItem Name="Palette"> |
47 | | - <domain:DemoItem.Content> |
48 | | - <wpfExample:PaletteSelector> |
49 | | - <wpfExample:PaletteSelector.DataContext> |
50 | | - <wpfExample:PaletteSelectorViewModel /> |
51 | | - </wpfExample:PaletteSelector.DataContext> |
52 | | - </wpfExample:PaletteSelector> |
53 | | - </domain:DemoItem.Content> |
54 | | - </domain:DemoItem> |
55 | | - <domain:DemoItem Name="Buttons & Toggles"> |
56 | | - <domain:DemoItem.Content> |
57 | | - <wpfExample:Buttons /> |
58 | | - </domain:DemoItem.Content> |
59 | | - </domain:DemoItem> |
60 | | - <domain:DemoItem Name="Fields"> |
61 | | - <domain:DemoItem.Content> |
62 | | - <wpfExample:TextFields /> |
63 | | - </domain:DemoItem.Content> |
64 | | - </domain:DemoItem> |
65 | | - <domain:DemoItem Name="Cards"> |
66 | | - <domain:DemoItem.Content> |
67 | | - <wpfExample:Cards /> |
68 | | - </domain:DemoItem.Content> |
69 | | - </domain:DemoItem> |
70 | | - <domain:DemoItem Name="Colour Zones"> |
71 | | - <domain:DemoItem.Content> |
72 | | - <wpfExample:ColorZones /> |
73 | | - </domain:DemoItem.Content> |
74 | | - </domain:DemoItem> |
75 | | - <domain:DemoItem Name="Lists"> |
76 | | - <domain:DemoItem.Content> |
77 | | - <wpfExample:Lists> |
78 | | - <wpfExample:Lists.DataContext> |
79 | | - <domain:ListsAndGridsViewModel /> |
80 | | - </wpfExample:Lists.DataContext> |
81 | | - </wpfExample:Lists> |
82 | | - </domain:DemoItem.Content> |
83 | | - </domain:DemoItem> |
84 | | - <domain:DemoItem Name="Trees"> |
85 | | - <domain:DemoItem.Content> |
86 | | - <wpfExample:Trees /> |
87 | | - </domain:DemoItem.Content> |
88 | | - </domain:DemoItem> |
89 | | - <domain:DemoItem Name="Grids"> |
90 | | - <domain:DemoItem.Content> |
91 | | - <wpfExample:Grids> |
92 | | - <wpfExample:Grids.DataContext> |
93 | | - <domain:ListsAndGridsViewModel /> |
94 | | - </wpfExample:Grids.DataContext> |
95 | | - </wpfExample:Grids> |
96 | | - </domain:DemoItem.Content> |
97 | | - </domain:DemoItem> |
98 | | - <domain:DemoItem Name="Menus & Tool Bars"> |
99 | | - <domain:DemoItem.Content> |
100 | | - <wpfExample:MenusAndToolBars /> |
101 | | - </domain:DemoItem.Content> |
102 | | - </domain:DemoItem> |
103 | | - <domain:DemoItem Name="Progress Indicators"> |
104 | | - <domain:DemoItem.Content> |
105 | | - <wpfExample:Progress /> |
106 | | - </domain:DemoItem.Content> |
107 | | - </domain:DemoItem> |
108 | | - <domain:DemoItem Name="Dialogs"> |
109 | | - <domain:DemoItem.Content> |
110 | | - <wpfExample:Dialogs /> |
111 | | - </domain:DemoItem.Content> |
112 | | - </domain:DemoItem> |
113 | | - <domain:DemoItem Name="Shadows"> |
114 | | - <domain:DemoItem.Content> |
115 | | - <wpfExample:Shadows /> |
116 | | - </domain:DemoItem.Content> |
117 | | - </domain:DemoItem> |
118 | | - </ListBox> |
119 | | - <ContentControl Margin="16" Content="{Binding ElementName=DemoItemsListBox, Path=SelectedItem.Content}" /> |
120 | | - </DockPanel> |
121 | | - |
| 36 | + <wpf:DialogHost> |
| 37 | + <DockPanel> |
| 38 | + <wpf:ColorZone Padding="16" Effect="{StaticResource MaterialDesignShadowDepth2}" |
| 39 | + Mode="PrimaryMid" DockPanel.Dock="Top"> |
| 40 | + <DockPanel> |
| 41 | + <ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}" IsChecked="True" |
| 42 | + x:Name="MenuToggleButton"/> |
| 43 | + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22">Material Design In XAML Toolkit</TextBlock> |
| 44 | + </DockPanel> |
| 45 | + </wpf:ColorZone> |
| 46 | + <ListBox DockPanel.Dock="Left" x:Name="DemoItemsListBox" Margin="16 16 0 16" SelectedIndex="0" |
| 47 | + Visibility="{Binding ElementName=MenuToggleButton, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 48 | + <ListBox.ItemTemplate> |
| 49 | + <DataTemplate DataType="domain:DemoItem"> |
| 50 | + <TextBlock Text="{Binding Name}" /> |
| 51 | + </DataTemplate> |
| 52 | + </ListBox.ItemTemplate> |
| 53 | + <domain:DemoItem Name="Home"> |
| 54 | + <domain:DemoItem.Content> |
| 55 | + <wpfExample:Home /> |
| 56 | + </domain:DemoItem.Content> |
| 57 | + </domain:DemoItem> |
| 58 | + <domain:DemoItem Name="Palette"> |
| 59 | + <domain:DemoItem.Content> |
| 60 | + <wpfExample:PaletteSelector> |
| 61 | + <wpfExample:PaletteSelector.DataContext> |
| 62 | + <wpfExample:PaletteSelectorViewModel /> |
| 63 | + </wpfExample:PaletteSelector.DataContext> |
| 64 | + </wpfExample:PaletteSelector> |
| 65 | + </domain:DemoItem.Content> |
| 66 | + </domain:DemoItem> |
| 67 | + <domain:DemoItem Name="Buttons & Toggles"> |
| 68 | + <domain:DemoItem.Content> |
| 69 | + <wpfExample:Buttons /> |
| 70 | + </domain:DemoItem.Content> |
| 71 | + </domain:DemoItem> |
| 72 | + <domain:DemoItem Name="Fields"> |
| 73 | + <domain:DemoItem.Content> |
| 74 | + <wpfExample:TextFields /> |
| 75 | + </domain:DemoItem.Content> |
| 76 | + </domain:DemoItem> |
| 77 | + <domain:DemoItem Name="Cards"> |
| 78 | + <domain:DemoItem.Content> |
| 79 | + <wpfExample:Cards /> |
| 80 | + </domain:DemoItem.Content> |
| 81 | + </domain:DemoItem> |
| 82 | + <domain:DemoItem Name="Colour Zones"> |
| 83 | + <domain:DemoItem.Content> |
| 84 | + <wpfExample:ColorZones /> |
| 85 | + </domain:DemoItem.Content> |
| 86 | + </domain:DemoItem> |
| 87 | + <domain:DemoItem Name="Lists"> |
| 88 | + <domain:DemoItem.Content> |
| 89 | + <wpfExample:Lists> |
| 90 | + <wpfExample:Lists.DataContext> |
| 91 | + <domain:ListsAndGridsViewModel /> |
| 92 | + </wpfExample:Lists.DataContext> |
| 93 | + </wpfExample:Lists> |
| 94 | + </domain:DemoItem.Content> |
| 95 | + </domain:DemoItem> |
| 96 | + <domain:DemoItem Name="Trees"> |
| 97 | + <domain:DemoItem.Content> |
| 98 | + <wpfExample:Trees /> |
| 99 | + </domain:DemoItem.Content> |
| 100 | + </domain:DemoItem> |
| 101 | + <domain:DemoItem Name="Grids"> |
| 102 | + <domain:DemoItem.Content> |
| 103 | + <wpfExample:Grids> |
| 104 | + <wpfExample:Grids.DataContext> |
| 105 | + <domain:ListsAndGridsViewModel /> |
| 106 | + </wpfExample:Grids.DataContext> |
| 107 | + </wpfExample:Grids> |
| 108 | + </domain:DemoItem.Content> |
| 109 | + </domain:DemoItem> |
| 110 | + <domain:DemoItem Name="Menus & Tool Bars"> |
| 111 | + <domain:DemoItem.Content> |
| 112 | + <wpfExample:MenusAndToolBars /> |
| 113 | + </domain:DemoItem.Content> |
| 114 | + </domain:DemoItem> |
| 115 | + <domain:DemoItem Name="Progress Indicators"> |
| 116 | + <domain:DemoItem.Content> |
| 117 | + <wpfExample:Progress /> |
| 118 | + </domain:DemoItem.Content> |
| 119 | + </domain:DemoItem> |
| 120 | + <domain:DemoItem Name="Dialogs"> |
| 121 | + <domain:DemoItem.Content> |
| 122 | + <wpfExample:Dialogs /> |
| 123 | + </domain:DemoItem.Content> |
| 124 | + </domain:DemoItem> |
| 125 | + <domain:DemoItem Name="Shadows"> |
| 126 | + <domain:DemoItem.Content> |
| 127 | + <wpfExample:Shadows /> |
| 128 | + </domain:DemoItem.Content> |
| 129 | + </domain:DemoItem> |
| 130 | + </ListBox> |
| 131 | + <ContentControl Margin="16" Content="{Binding ElementName=DemoItemsListBox, Path=SelectedItem.Content}" /> |
| 132 | + </DockPanel> |
| 133 | + </wpf:DialogHost> |
122 | 134 | </Window> |
0 commit comments