Skip to content

Commit 34cd890

Browse files
committed
Merge pull request #12 from ButchersBoy/master
update from original repo
2 parents 1e59901 + 62e1e21 commit 34cd890

File tree

259 files changed

+5625
-1996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+5625
-1996
lines changed

MahMaterialDragablzMashUp/FlyoutContent.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ResourceDictionary>
1616
</UserControl.Resources>
1717
<StackPanel Margin="24">
18-
<TextBox Style="{StaticResource MaterialDesignFloatingHintTextBox}" FontSize="18" wpf:TextFieldAssist.Hint="Your Name" MinWidth="120" />
19-
<TextBox Style="{StaticResource MaterialDesignFloatingHintTextBox}" wpf:TextFieldAssist.Hint="Location" MinWidth="120" Margin="0 8 0 0" />
18+
<TextBox Style="{StaticResource MaterialDesignFloatingHintTextBox}" FontSize="18" MinWidth="120" />
19+
<TextBox Style="{StaticResource MaterialDesignFloatingHintTextBox}" MinWidth="120" Margin="0 8 0 0" />
2020
</StackPanel>
2121
</UserControl>

MainDemo.Wpf/Buttons.xaml

Lines changed: 103 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
88
xmlns:wpfExample="clr-namespace:MaterialDesignColors.WpfExample"
99
mc:Ignorable="d"
10-
d:DesignHeight="300" d:DesignWidth="300">
10+
d:DesignHeight="400" d:DesignWidth="800">
1111
<UserControl.Resources>
1212
<ResourceDictionary>
1313
<ResourceDictionary.MergedDictionaries>
@@ -80,30 +80,77 @@
8080
<materialDesign:PopupBox Style="{StaticResource MaterialDesignMultiFloatingActionPopupBox}"
8181
PlacementMode="BottomAndAlignCentres"
8282
ToolTipService.Placement="Right"
83-
ToolTip="PopupBox, Style MaterialDesignMultiFloatingActionPopupBox">
83+
ToolTip="PopupBox, Style MaterialDesignMultiFloatingActionPopupBox"
84+
Opened="PopupBox_OnOpened"
85+
Closed="PopupBox_OnClosed">
8486
<StackPanel>
85-
<Button ToolTip="One">1</Button>
87+
<Button ToolTip="One with custom opacity" Opacity="0.5">1 </Button>
8688
<Button ToolTip="Two">2</Button>
8789
<Button ToolTip="Three">3</Button>
8890
</StackPanel>
8991
</materialDesign:PopupBox>
9092
</StackPanel>
91-
<materialDesign:PopupBox Style="{StaticResource MaterialDesignMultiFloatingActionAccentPopupBox}"
92-
PlacementMode="BottomAndAlignCentres"
93-
HorizontalAlignment="Right"
93+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
94+
<materialDesign:PopupBox Margin="16,0,16,0" StaysOpen="True">
95+
<Grid Width="300" Margin="8,8,8,8">
96+
<Grid.Resources>
97+
<Style TargetType="CheckBox" BasedOn="{StaticResource MaterialDesignCheckBox}">
98+
<Setter Property="Margin" Value="8,8,10,8"/>
99+
</Style>
100+
<Style TargetType="TextBox" BasedOn="{StaticResource MaterialDesignTextBox}">
101+
<Setter Property="materialDesign:HintAssist.IsFloating" Value="True"/>
102+
<Setter Property="Margin" Value="8,8,8,8"/>
103+
</Style>
104+
</Grid.Resources>
105+
<Grid.ColumnDefinitions>
106+
<ColumnDefinition Width="*"/>
107+
<ColumnDefinition Width="Auto"/>
108+
</Grid.ColumnDefinitions>
109+
<Grid.RowDefinitions>
110+
<RowDefinition Height="*"/>
111+
<RowDefinition Height="*"/>
112+
<RowDefinition Height="*"/>
113+
<RowDefinition Height="*"/>
114+
<RowDefinition Height="*" />
115+
</Grid.RowDefinitions>
116+
<TextBlock Grid.Column="0" Grid.Row="0" Style="{StaticResource MaterialDesignTitleTextBlock}" Margin="8,8,8,16">OPTIONS</TextBlock>
117+
<TextBox Grid.Column="0" Grid.Row="1" materialDesign:HintAssist.Hint="Setting 1" Text="200"/>
118+
<TextBox Grid.Column="0" Grid.Row="2" materialDesign:HintAssist.Hint="Setting 2" Text="400"/>
119+
<TextBox Grid.Column="0" Grid.Row="3" materialDesign:HintAssist.Hint="Setting 3" Text="600"/>
120+
<CheckBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Bottom" />
121+
<CheckBox Grid.Column="1" Grid.Row="2" IsChecked="True" VerticalAlignment="Bottom" />
122+
<CheckBox Grid.Column="1" Grid.Row="3" VerticalAlignment="Bottom" />
123+
<ComboBox Grid.Column="0" Grid.Row="4" materialDesign:HintAssist.Hint="Setting 4" materialDesign:HintAssist.IsFloating="True"
124+
Margin="8 8 8 8">
125+
<ComboBoxItem>25%</ComboBoxItem>
126+
<ComboBoxItem>50%</ComboBoxItem>
127+
<ComboBoxItem>75%</ComboBoxItem>
128+
<ComboBoxItem>100%</ComboBoxItem>
129+
<ComboBoxItem>150%</ComboBoxItem>
130+
<ComboBoxItem>200%</ComboBoxItem>
131+
<ComboBoxItem>250%</ComboBoxItem>
132+
<ComboBoxItem>500%</ComboBoxItem>
133+
</ComboBox>
134+
</Grid>
135+
136+
</materialDesign:PopupBox>
137+
138+
<materialDesign:PopupBox Style="{StaticResource MaterialDesignMultiFloatingActionAccentPopupBox}"
139+
PlacementMode="BottomAndAlignCentres"
94140
ToggleCheckedContentCommand="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpfExample:Buttons}, Path=FloatingActionDemoCommand}"
95141
ToggleCheckedContentCommandParameter="wowsers"
96142
Margin="0 0 48 0"
97143
ToolTip="PopupBox, Style MaterialDesignMultiFloatingActionAccentPopupBox">
98-
<materialDesign:PopupBox.ToggleCheckedContent>
99-
<materialDesign:PackIcon Kind="Pencil" Width="24" Height="24" />
100-
</materialDesign:PopupBox.ToggleCheckedContent>
101-
<StackPanel>
102-
<Button ToolTip="One">1</Button>
103-
<Button ToolTip="Two">2</Button>
104-
<Button ToolTip="Three">3</Button>
105-
</StackPanel>
106-
</materialDesign:PopupBox>
144+
<materialDesign:PopupBox.ToggleCheckedContent>
145+
<materialDesign:PackIcon Kind="Pencil" Width="24" Height="24" />
146+
</materialDesign:PopupBox.ToggleCheckedContent>
147+
<StackPanel>
148+
<Button ToolTip="One">1</Button>
149+
<Button ToolTip="Two" IsEnabled="False">2</Button>
150+
<Button ToolTip="Three">3</Button>
151+
</StackPanel>
152+
</materialDesign:PopupBox>
153+
</StackPanel>
107154
</Grid>
108155
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0 16 0 0">
109156
<Button Style="{StaticResource MaterialDesignRaisedLightButton}" Margin="0 0 8 0" Width="100"
@@ -122,10 +169,16 @@
122169
ToolTip="Resource name: MaterialDesignRaisedAccentButton">
123170
ACCENT
124171
</Button>
172+
125173
</StackPanel>
126-
<StackPanel Grid.Row="3" Margin="256 16 0 0" Orientation="Horizontal">
127-
<Button Style="{StaticResource MaterialDesignFlatButton}" Click="ButtonBase_OnClick">ACCEPT</Button>
128-
<Button Style="{StaticResource MaterialDesignFlatButton}">CANCEL</Button>
174+
<StackPanel Grid.Row="3" Margin="0 16 0 0" Orientation="Horizontal">
175+
<Button Style="{StaticResource MaterialDesignRaisedAccentButton}"
176+
Margin="0 0 8 0"
177+
Width="150"
178+
ToolTip="Resource name: MaterialDesignRaisedAccentButton"
179+
materialDesign:RippleAssist.Feedback="#DD000000">CUSTOM RIPPLE</Button>
180+
<Button Style="{StaticResource MaterialDesignFlatButton}" Click="ButtonBase_OnClick" ToolTip="MaterialDesignFlatButton" Margin="200 0 0 0">ACCEPT</Button>
181+
<Button Style="{StaticResource MaterialDesignFlatButton}" ToolTip="MaterialDesignFlatButton">CANCEL</Button>
129182
</StackPanel>
130183
<TextBlock Margin="0 24 0 0" Grid.Row="4">Toggles</TextBlock>
131184
<StackPanel Grid.Row="5" Margin="0 24 0 0" Orientation="Horizontal">
@@ -145,6 +198,16 @@
145198
ToolTip="MaterialDesignActionToggleButton">
146199
<Image Source="Resources/ProfilePic.jpg"></Image>
147200
</ToggleButton>
201+
<TextBlock Margin="16 0 8 0" VerticalAlignment="Center">Customise On Content:</TextBlock>
202+
<ToggleButton Style="{StaticResource MaterialDesignActionToggleButton}"
203+
ToolTip="MaterialDesignActionLightToggleButton">
204+
<ToggleButton.Content>
205+
<materialDesign:PackIcon Kind="EmoticonSad" />
206+
</ToggleButton.Content>
207+
<materialDesign:ToggleButtonAssist.OnContent>
208+
<materialDesign:PackIcon Kind="EmoticonHappy" />
209+
</materialDesign:ToggleButtonAssist.OnContent>
210+
</ToggleButton>
148211
</StackPanel>
149212
<StackPanel Grid.Row="6" Margin="0 16 0 0" Orientation="Horizontal">
150213
<RadioButton Style="{StaticResource MaterialDesignRadioButton}" Margin="0 0 8 8" VerticalAlignment="Center" IsChecked="True">
@@ -153,36 +216,54 @@
153216
<RadioButton Style="{StaticResource MaterialDesignRadioButton}" Margin="0 0 8 8" VerticalAlignment="Center">
154217
Ga Ga
155218
</RadioButton>
219+
<RadioButton Style="{StaticResource MaterialDesignRadioButton}" Margin="0 0 8 8" VerticalAlignment="Center"
220+
IsEnabled="False">
221+
Disabled
222+
</RadioButton>
156223
<CheckBox Style="{StaticResource MaterialDesignCheckBox}" Margin="0 0 8 8" VerticalAlignment="Center">
157224
Check
158225
</CheckBox>
159226
<CheckBox Style="{StaticResource MaterialDesignCheckBox}" Margin="0 0 8 8" VerticalAlignment="Center" IsChecked="True">
160227
Mate
161228
</CheckBox>
229+
<CheckBox Style="{StaticResource MaterialDesignCheckBox}" Margin="0 0 8 8" VerticalAlignment="Center"
230+
IsEnabled="False">
231+
Disabled
232+
</CheckBox>
162233
</StackPanel>
163234
<StackPanel Grid.Row="7" Margin="0 16 0 0" Orientation="Horizontal">
164-
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" VerticalAlignment="Center" />
165-
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" VerticalAlignment="Center" Margin="8 0 0 0" IsChecked="True" />
235+
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" VerticalAlignment="Center"
236+
ToolTip="Default ToggleButton Style"/>
166237
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" VerticalAlignment="Center" Margin="8 0 0 0" IsEnabled="False" />
238+
<ToggleButton Style="{StaticResource MaterialDesignSwitchLightToggleButton}" VerticalAlignment="Center" Margin="8 0 0 0"
239+
ToolTip="MaterialDesignSwitchLightToggleButton" IsChecked="True" />
240+
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" VerticalAlignment="Center" Margin="8 0 0 0"
241+
ToolTip="MaterialDesignSwitchToggleButton" IsChecked="True" />
242+
<ToggleButton Style="{StaticResource MaterialDesignSwitchDarkToggleButton}" VerticalAlignment="Center" Margin="8 0 0 0"
243+
ToolTip="MaterialDesignSwitchDarkToggleButton" IsChecked="True" />
244+
<ToggleButton Style="{StaticResource MaterialDesignSwitchAccentToggleButton}" VerticalAlignment="Center" Margin="8 0 0 0"
245+
ToolTip="MaterialDesignSwitchAccentToggleButton" IsChecked="True" />
167246
</StackPanel>
168247
<StackPanel Grid.Row="8" Margin="0 16 0 0" Orientation="Horizontal">
169-
<ToggleButton Style="{StaticResource MaterialDesignFlatToggleButton}">
248+
<ToggleButton Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="MaterialDesignFlatToggleButton">
170249
<materialDesign:PackIcon Kind="Paperclip" Height="21" Width="21" />
171250
</ToggleButton>
172251
<ToggleButton Style="{StaticResource MaterialDesignFlatPrimaryToggleButton}"
173252
Margin="8 0 0 0"
253+
ToolTip="MaterialDesignFlatPrimaryToggleButton"
174254
IsChecked="True">
175255
<materialDesign:PackIcon Kind="Heart" Height="21" Width="21" />
176256
</ToggleButton>
177257
<ToggleButton Style="{StaticResource MaterialDesignFlatPrimaryToggleButton}"
258+
ToolTip="MaterialDesignFlatPrimaryToggleButton"
178259
IsEnabled="False" Margin="8 0 0 0">
179260
<materialDesign:PackIcon Kind="Heart" Height="21" Width="21" />
180261
</ToggleButton>
181262
</StackPanel>
182263
<TextBlock Margin="0 24 0 0" Grid.Row="9">Rating bar</TextBlock>
183264
<StackPanel Grid.Row="10" Margin="0 16 0 0" Orientation="Horizontal">
184265
<materialDesign:RatingBar Value="3" x:Name="BasicRatingBar" />
185-
<TextBlock Text="{Binding ElementName=BasicRatingBar, Path=Value, StringFormat=Rating: {0}}" VerticalAlignment="Top" Margin="10,2,0,0" />
266+
<TextBlock Text="{Binding ElementName=BasicRatingBar, Path=Value, StringFormat=Rating: {0}}" VerticalAlignment="Top" Margin="10,2,0,0" />
186267
<materialDesign:RatingBar x:Name="CustomRatingBar" Max="3" Value="2" Margin="24 0 0 0" Orientation="Vertical">
187268
<materialDesign:RatingBar.ValueItemTemplate>
188269
<DataTemplate DataType="system:Int32">

MainDemo.Wpf/Buttons.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,15 @@ private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
3939
{
4040
Console.WriteLine("Just checking we haven't suppressed the button.");
4141
}
42+
43+
private void PopupBox_OnOpened(object sender, RoutedEventArgs e)
44+
{
45+
Console.WriteLine("Just making sure the popup has opened.");
46+
}
47+
48+
private void PopupBox_OnClosed(object sender, RoutedEventArgs e)
49+
{
50+
Console.WriteLine("Just making sure the popup has closed.");
51+
}
4252
}
4353
}

MainDemo.Wpf/Chips.xaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<UserControl x:Class="MaterialDesignColors.WpfExample.Chips"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:MaterialDesignColors.WpfExample"
7+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
8+
mc:Ignorable="d"
9+
d:DesignHeight="300" d:DesignWidth="300">
10+
<Grid Margin="32">
11+
<Grid.RowDefinitions>
12+
<RowDefinition Height="Auto" />
13+
<RowDefinition Height="Auto" />
14+
</Grid.RowDefinitions>
15+
<TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}">Chips</TextBlock>
16+
<StackPanel Grid.Row="1" Margin="0 16 0 0">
17+
<WrapPanel Orientation="Horizontal">
18+
<materialDesign:Chip Content="James Willock" Margin="0 0 6 4">
19+
<materialDesign:Chip.Icon>
20+
<Image Source="Resources/ProfilePic.jpg" />
21+
</materialDesign:Chip.Icon>
22+
</materialDesign:Chip>
23+
<materialDesign:Chip Margin="0 0 4 4">
24+
Example Chip
25+
</materialDesign:Chip>
26+
<materialDesign:Chip Content="ANZ Bank"
27+
Icon="A"
28+
Margin="0 0 4 4" />
29+
<materialDesign:Chip Content="ZNA Inc"
30+
Icon="Z"
31+
Margin="0 0 4 4" />
32+
<materialDesign:Chip Content="Twitter"
33+
IconBackground="{DynamicResource PrimaryHueDarkBrush}"
34+
IconForeground="{DynamicResource PrimaryHueDarkForegroundBrush}"
35+
Margin="0 0 4 4">
36+
<materialDesign:Chip.Icon>
37+
<materialDesign:PackIcon Kind="Twitter"></materialDesign:PackIcon>
38+
</materialDesign:Chip.Icon>
39+
</materialDesign:Chip>
40+
</WrapPanel>
41+
<WrapPanel Margin="0 12 0 0" Orientation="Horizontal">
42+
<materialDesign:Chip Content="James Willock"
43+
IsDeletable="True"
44+
Margin="0 0 4 4"
45+
x:Name="ButtonsDemoChip"
46+
Click="ButtonsDemoChip_OnClick"
47+
DeleteClick="ButtonsDemoChip_OnDeleteClick"
48+
ToolTip="Just a tool tip"
49+
DeleteToolTip="Your friendly neighbour delete button"
50+
>
51+
<materialDesign:Chip.Icon>
52+
<Image Source="Resources/ProfilePic.jpg"></Image>
53+
</materialDesign:Chip.Icon>
54+
</materialDesign:Chip>
55+
<materialDesign:Chip Content="Example Chip"
56+
IsDeletable="True"
57+
ToolTip="This is an example chip"
58+
Margin="0 0 4 4">
59+
</materialDesign:Chip>
60+
<materialDesign:Chip Content="ANZ Bank"
61+
Icon="A"
62+
IsDeletable="True"
63+
Margin="0 0 4 4" />
64+
<materialDesign:Chip Content="ZNA Inc"
65+
Icon="Z"
66+
IsDeletable="True"
67+
IconBackground="{DynamicResource PrimaryHueLightBrush}"
68+
IconForeground="{DynamicResource PrimaryHueLightForegroundBrush}"
69+
Margin="0 0 4 4" />
70+
</WrapPanel>
71+
</StackPanel>
72+
</Grid>
73+
</UserControl>

MainDemo.Wpf/Chips.xaml.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace MaterialDesignColors.WpfExample
17+
{
18+
/// <summary>
19+
/// Interaction logic for Chips.xaml
20+
/// </summary>
21+
public partial class Chips : UserControl
22+
{
23+
public Chips()
24+
{
25+
InitializeComponent();
26+
}
27+
28+
private void ButtonsDemoChip_OnClick(object sender, RoutedEventArgs e)
29+
{
30+
Console.WriteLine("Chip clicked.");
31+
}
32+
33+
private void ButtonsDemoChip_OnDeleteClick(object sender, RoutedEventArgs e)
34+
{
35+
Console.WriteLine("Chip delete clicked.");
36+
}
37+
38+
}
39+
}

0 commit comments

Comments
 (0)