Skip to content

Commit 58bd821

Browse files
committed
2 parents ce9a47b + 7318608 commit 58bd821

23 files changed

+964
-160
lines changed

MainDemo.Wpf/Buttons.xaml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -314,49 +314,6 @@
314314
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
315315
</ListBoxItem>
316316
</ListBox>
317-
318-
<ListBox Grid.Column="1" Grid.Row="1" Style="{StaticResource MaterialDesignToolToggleFlatListBox}" SelectedIndex="0">
319-
<ListBox.ToolTip>
320-
<StackPanel>
321-
<TextBlock Text="MaterialDesignToolToggleFlatListBox" />
322-
<TextBlock Text="Exclusive selection" />
323-
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
324-
</StackPanel>
325-
</ListBox.ToolTip>
326-
<ListBoxItem>
327-
<materialDesign:PackIcon Kind="FormatAlignLeft"/>
328-
</ListBoxItem>
329-
<ListBoxItem>
330-
<materialDesign:PackIcon Kind="FormatAlignCenter"/>
331-
</ListBoxItem>
332-
<ListBoxItem>
333-
<materialDesign:PackIcon Kind="FormatAlignRight"/>
334-
</ListBoxItem>
335-
<ListBoxItem>
336-
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
337-
</ListBoxItem>
338-
</ListBox>
339-
340-
<ListBox Grid.Column="1" Grid.Row="2" Style="{StaticResource MaterialDesignToolToggleListBox}"
341-
SelectionMode="Extended"
342-
Margin="0 8 0 0">
343-
<ListBox.ToolTip>
344-
<StackPanel>
345-
<TextBlock Text="MaterialDesignToolToggleListBox" />
346-
<TextBlock Text="Multiple selection" />
347-
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
348-
</StackPanel>
349-
</ListBox.ToolTip>
350-
<ListBoxItem>
351-
<materialDesign:PackIcon Kind="FormatBold"/>
352-
</ListBoxItem>
353-
<ListBoxItem>
354-
<materialDesign:PackIcon Kind="FormatItalic"/>
355-
</ListBoxItem>
356-
<ListBoxItem x:Name="UnderlineCheckbox">
357-
<materialDesign:PackIcon Kind="FormatUnderline"/>
358-
</ListBoxItem>
359-
</ListBox>
360317
</Grid>
361318

362319
<Border Grid.Row="6" Margin="0 16 0 0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" />

MainDemo.Wpf/Cards.xaml

Lines changed: 124 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
<ResourceDictionary.MergedDictionaries>
1212
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
1313
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Card.xaml" />
14-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Popupbox.xaml" />
1514
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.CheckBox.xaml" />
15+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Flipper.xaml" />
16+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Popupbox.xaml" />
1617
</ResourceDictionary.MergedDictionaries>
1718
</ResourceDictionary>
1819
</UserControl.Resources>
@@ -114,39 +115,47 @@
114115
</StackPanel>
115116
</Grid>
116117
</materialDesign:Card>
117-
<materialDesign:Card Margin="4 4 0 0" Background="#03a9f4"
118+
<StackPanel>
119+
<materialDesign:Card Margin="4 4 0 0" Background="#03a9f4"
120+
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
121+
Padding="0"
122+
Width="200">
123+
<Grid>
124+
<Grid.RowDefinitions>
125+
<RowDefinition Height="Auto" />
126+
<RowDefinition Height="Auto" />
127+
<RowDefinition Height="Auto" />
128+
</Grid.RowDefinitions>
129+
<TextBlock Grid.Row="0" Margin="16 16 16 4" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Call Jennifer</TextBlock>
130+
<Separator Grid.Row="1" Style="{StaticResource MaterialDesignLightSeparator}"/>
131+
<TextBlock Grid.Row="2" Margin="16 0 16 8" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignBody2TextBlock}">March 19, 2016</TextBlock>
132+
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="16 0 16 8" HorizontalAlignment="Right">
133+
<Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignToolForegroundButton}" Width="30" Padding="2 0 2 0"
134+
materialDesign:RippleAssist.IsCentered="True">
135+
<materialDesign:PackIcon Kind="Phone" />
136+
</Button>
137+
<materialDesign:PopupBox HorizontalAlignment="Right" Style="{StaticResource MaterialDesignToolForegroundPopupBox}" Padding="2 0 2 0">
138+
<StackPanel>
139+
<Button Content="More"/>
140+
<Button Content="Options"/>
141+
</StackPanel>
142+
</materialDesign:PopupBox>
143+
</StackPanel>
144+
</Grid>
145+
</materialDesign:Card>
146+
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueLightBrush}"
147+
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
148+
Width="200"
149+
Padding="8">
150+
<TextBlock FontSize="16">Boring Text</TextBlock>
151+
</materialDesign:Card>
152+
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueDarkBrush}"
118153
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
119-
Padding="0"
120-
Width="200">
121-
<Grid>
122-
<Grid.RowDefinitions>
123-
<RowDefinition Height="Auto" />
124-
<RowDefinition Height="Auto" />
125-
<RowDefinition Height="Auto" />
126-
</Grid.RowDefinitions>
127-
<TextBlock Grid.Row="0" Margin="16 16 16 4" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Call Jennifer</TextBlock>
128-
<Separator Grid.Row="1" Style="{StaticResource MaterialDesignLightSeparator}"/>
129-
<TextBlock Grid.Row="2" Margin="16 0 16 8" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignBody2TextBlock}">March 19, 2016</TextBlock>
130-
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="16 0 16 8" HorizontalAlignment="Right">
131-
<Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignToolForegroundButton}" Width="30" Padding="2 0 2 0"
132-
materialDesign:RippleAssist.IsCentered="True">
133-
<materialDesign:PackIcon Kind="Phone" />
134-
</Button>
135-
<materialDesign:PopupBox HorizontalAlignment="Right" Style="{StaticResource MaterialDesignToolForegroundPopupBox}" Padding="2 0 2 0">
136-
<StackPanel>
137-
<Button Content="More"/>
138-
<Button Content="Options"/>
139-
</StackPanel>
140-
</materialDesign:PopupBox>
141-
</StackPanel>
142-
</Grid>
143-
</materialDesign:Card>
144-
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueLightBrush}"
145-
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
146154
Width="200"
147-
Padding="8">
148-
<TextBlock FontSize="16">Boring Text</TextBlock>
149-
</materialDesign:Card>
155+
Padding="8" UniformCornerRadius="6">
156+
<TextBlock TextWrapping="Wrap">You can adjust the corner radius</TextBlock>
157+
</materialDesign:Card>
158+
</StackPanel>
150159
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueDarkBrush}"
151160
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
152161
Width="200"
@@ -165,11 +174,88 @@
165174
</StackPanel>
166175
</StackPanel>
167176
</materialDesign:Card>
168-
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueDarkBrush}"
169-
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
170-
Width="200"
171-
Padding="8" UniformCornerRadius="6">
172-
<TextBlock TextWrapping="Wrap">You can adjust the corner radius</TextBlock>
173-
</materialDesign:Card>
177+
178+
<!--
179+
For the Card styled <Flipper />, bring in this resource dictionary (see top of this file)
180+
pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Flipper.xaml
181+
-->
182+
<StackPanel>
183+
<materialDesign:Flipper Style="{StaticResource MaterialDesignCardFlipper}" Margin="4 4 0 0">
184+
<materialDesign:Flipper.FrontContent>
185+
<Button Style="{StaticResource MaterialDesignFlatButton}"
186+
Command="{x:Static materialDesign:Flipper.FlipCommand}"
187+
Margin="8"
188+
Width="184"
189+
>FLIPPABLZ!</Button>
190+
</materialDesign:Flipper.FrontContent>
191+
<materialDesign:Flipper.BackContent>
192+
<Button Style="{StaticResource MaterialDesignFlatButton}"
193+
Command="{x:Static materialDesign:Flipper.FlipCommand}"
194+
Margin="8"
195+
Width="184"
196+
>GO BACK</Button>
197+
</materialDesign:Flipper.BackContent>
198+
</materialDesign:Flipper>
199+
<materialDesign:Flipper Style="{StaticResource MaterialDesignCardFlipper}" Margin="4 4 0 0" >
200+
<materialDesign:Flipper.FrontContent>
201+
<Grid Height="256" Width="200">
202+
<Grid.RowDefinitions>
203+
<RowDefinition Height="160" />
204+
<RowDefinition Height="*" />
205+
</Grid.RowDefinitions>
206+
<materialDesign:ColorZone Mode="PrimaryLight" VerticalAlignment="Stretch">
207+
<materialDesign:PackIcon Kind="AccountCircle" Height="128" Width="128"
208+
VerticalAlignment="Center" HorizontalAlignment="Center" />
209+
</materialDesign:ColorZone>
210+
<StackPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
211+
<TextBlock>James Willock</TextBlock>
212+
<Button Style="{StaticResource MaterialDesignFlatButton}"
213+
Command="{x:Static materialDesign:Flipper.FlipCommand}"
214+
Margin="0 4 0 0"
215+
>EDIT</Button>
216+
</StackPanel>
217+
</Grid>
218+
</materialDesign:Flipper.FrontContent>
219+
<materialDesign:Flipper.BackContent>
220+
<Grid Height="256" Width="200">
221+
<Grid.RowDefinitions>
222+
<RowDefinition Height="Auto" />
223+
<RowDefinition Height="*" />
224+
</Grid.RowDefinitions>
225+
<materialDesign:ColorZone Mode="Accent" Padding="6">
226+
<StackPanel Orientation="Horizontal">
227+
<Button Style="{StaticResource MaterialDesignToolForegroundButton}"
228+
Command="{x:Static materialDesign:Flipper.FlipCommand}"
229+
HorizontalAlignment="Left">
230+
<materialDesign:PackIcon Kind="ArrowLeft" HorizontalAlignment="Right" />
231+
</Button>
232+
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">EDIT USER</TextBlock>
233+
</StackPanel>
234+
</materialDesign:ColorZone>
235+
<Grid Grid.Row="1" Margin="0 6 0 0" HorizontalAlignment="Center" VerticalAlignment="Top"
236+
Width="172">
237+
<Grid.RowDefinitions>
238+
<RowDefinition />
239+
<RowDefinition />
240+
<RowDefinition />
241+
<RowDefinition />
242+
</Grid.RowDefinitions>
243+
<TextBox materialDesign:HintAssist.Hint="First name" materialDesign:HintAssist.IsFloating="True"
244+
Margin="0 12 0 0">James</TextBox>
245+
<TextBox Grid.Row="1" materialDesign:HintAssist.Hint="Last name" materialDesign:HintAssist.IsFloating="True"
246+
Margin="0 12 0 0">Willock</TextBox>
247+
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0 12 0 0" HorizontalAlignment="Right">
248+
<TextBlock VerticalAlignment="Center">Email Contact</TextBlock>
249+
<ToggleButton Margin="8 0 0 0"></ToggleButton>
250+
</StackPanel>
251+
<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0 12 0 0" HorizontalAlignment="Right">
252+
<TextBlock VerticalAlignment="Center">Telephone Contact</TextBlock>
253+
<ToggleButton Margin="8 0 0 0"></ToggleButton>
254+
</StackPanel>
255+
</Grid>
256+
</Grid>
257+
</materialDesign:Flipper.BackContent>
258+
</materialDesign:Flipper>
259+
</StackPanel>
174260
</WrapPanel>
175261
</UserControl>

MainDemo.Wpf/MenusAndToolBars.xaml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,54 @@
6969
<Button Command="Paste" ToolTip="Paste some stuff" ToolBar.OverflowMode="AsNeeded">
7070
<materialDesign:PackIcon Kind="ContentPaste" />
7171
</Button>
72-
<Separator />
72+
<Separator/>
73+
<ListBox Style="{StaticResource MaterialDesignToolToggleFlatListBox}">
74+
<ListBoxItem ToolTip="This is a lonley toggle with TextBlock instead of icon">
75+
<TextBlock>W</TextBlock>
76+
</ListBoxItem>
77+
</ListBox>
78+
<Separator/>
79+
<ListBox Style="{StaticResource MaterialDesignToolToggleFlatListBox}" SelectedIndex="0">
80+
<ListBox.ToolTip>
81+
<StackPanel>
82+
<TextBlock Text="MaterialDesignToolToggleFlatListBox" />
83+
<TextBlock Text="Exclusive selection" />
84+
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
85+
</StackPanel>
86+
</ListBox.ToolTip>
87+
<ListBoxItem >
88+
<materialDesign:PackIcon Kind="FormatAlignLeft"/>
89+
</ListBoxItem>
90+
<ListBoxItem>
91+
<materialDesign:PackIcon Kind="FormatAlignCenter"/>
92+
</ListBoxItem>
93+
<ListBoxItem>
94+
<materialDesign:PackIcon Kind="FormatAlignRight"/>
95+
</ListBoxItem>
96+
<ListBoxItem>
97+
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
98+
</ListBoxItem>
99+
</ListBox>
100+
<Separator/>
101+
<ListBox SelectionMode="Extended" Style="{StaticResource MaterialDesignToolToggleFlatListBox}">
102+
<ListBox.ToolTip>
103+
<StackPanel>
104+
<TextBlock Text="MaterialDesignToolToggleListBox" />
105+
<TextBlock Text="Multiple selection" />
106+
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
107+
</StackPanel>
108+
</ListBox.ToolTip>
109+
<ListBoxItem>
110+
<materialDesign:PackIcon Kind="FormatBold"/>
111+
</ListBoxItem>
112+
<ListBoxItem>
113+
<materialDesign:PackIcon Kind="FormatItalic"/>
114+
</ListBoxItem>
115+
<ListBoxItem x:Name="UnderlineCheckbox">
116+
<materialDesign:PackIcon Kind="FormatUnderline"/>
117+
</ListBoxItem>
118+
</ListBox>
119+
<Separator/>
73120
<Label Content="Font size:" VerticalAlignment="Center"/>
74121
<ComboBox>
75122
<ComboBoxItem Content="10"/>
@@ -85,12 +132,7 @@
85132
</Button>
86133
<RadioButton GroupName="XXX" Content="Radio" />
87134
<RadioButton GroupName="XXX" Content="Ga Ga" />
88-
<ToggleButton>
89-
Switch
90-
</ToggleButton>
91-
<Menu>
92-
<MenuItem>Embedded menu</MenuItem>
93-
</Menu>
135+
<ToggleButton/>
94136
</ToolBar>
95137
</ToolBarTray>
96138

0 commit comments

Comments
 (0)