Skip to content

Commit 8907673

Browse files
authored
Merge pull request #18 from ButchersBoy/master
update from original repo
2 parents 37a3ec3 + 14f60a4 commit 8907673

22 files changed

+236
-164
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) James Willock, Mulholland Software and Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

License

Lines changed: 0 additions & 22 deletions
This file was deleted.

MainDemo.Wpf/Buttons.xaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
<CheckBox Grid.Column="1" Grid.Row="2" IsChecked="True" VerticalAlignment="Bottom" />
120120
<CheckBox Grid.Column="1" Grid.Row="3" VerticalAlignment="Bottom" />
121121
<ComboBox Grid.Column="0" Grid.Row="4" materialDesign:HintAssist.Hint="Setting 4" materialDesign:HintAssist.IsFloating="True"
122+
MaxDropDownHeight="200"
122123
Margin="8 8 8 8">
123124
<ComboBoxItem>25%</ComboBoxItem>
124125
<ComboBoxItem>50%</ComboBoxItem>
@@ -127,7 +128,7 @@
127128
<ComboBoxItem>150%</ComboBoxItem>
128129
<ComboBoxItem>200%</ComboBoxItem>
129130
<ComboBoxItem>250%</ComboBoxItem>
130-
<ComboBoxItem>500%</ComboBoxItem>
131+
<ComboBoxItem>501%</ComboBoxItem>
131132
</ComboBox>
132133
</Grid>
133134

@@ -302,7 +303,29 @@
302303
</ListBoxItem>
303304
</ListBox>
304305

305-
<ListBox Grid.Column="1" Grid.Row="1" Style="{StaticResource MaterialDesignToolToggleListBox}"
306+
<ListBox Grid.Column="1" Grid.Row="1" Style="{StaticResource MaterialDesignToolToggleFlatListBox}" SelectedIndex="0">
307+
<ListBox.ToolTip>
308+
<StackPanel>
309+
<TextBlock Text="MaterialDesignToolToggleFlatListBox" />
310+
<TextBlock Text="Exclusive selection" />
311+
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
312+
</StackPanel>
313+
</ListBox.ToolTip>
314+
<ListBoxItem>
315+
<materialDesign:PackIcon Kind="FormatAlignLeft"/>
316+
</ListBoxItem>
317+
<ListBoxItem>
318+
<materialDesign:PackIcon Kind="FormatAlignCenter"/>
319+
</ListBoxItem>
320+
<ListBoxItem>
321+
<materialDesign:PackIcon Kind="FormatAlignRight"/>
322+
</ListBoxItem>
323+
<ListBoxItem>
324+
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
325+
</ListBoxItem>
326+
</ListBox>
327+
328+
<ListBox Grid.Column="1" Grid.Row="2" Style="{StaticResource MaterialDesignToolToggleListBox}"
306329
SelectionMode="Extended"
307330
Margin="0 8 0 0">
308331
<ListBox.ToolTip>

MainDemo.Wpf/Cards.xaml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,47 @@
4444
</StackPanel>
4545
</Grid>
4646
</materialDesign:Card>
47+
<materialDesign:Card Margin="4 4 0 0" Background="#03a9f4"
48+
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
49+
Padding="0"
50+
Width="200">
51+
<Grid>
52+
<Grid.RowDefinitions>
53+
<RowDefinition Height="Auto" />
54+
<RowDefinition Height="Auto" />
55+
<RowDefinition Height="Auto" />
56+
</Grid.RowDefinitions>
57+
<TextBlock Grid.Row="0" Margin="16 16 16 4" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Call Jennifer</TextBlock>
58+
<Separator Grid.Row="1" Style="{StaticResource MaterialDesignDarkSeparator}"/>
59+
<TextBlock Grid.Row="2" Margin="16 0 16 8" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignBody1TextBlock}">March 19, 2016</TextBlock>
60+
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="16 0 16 8" HorizontalAlignment="Right">
61+
<Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignToolForegroundButton}" Width="30" Padding="2 0 2 0"
62+
materialDesign:RippleAssist.IsCentered="True">
63+
<materialDesign:PackIcon Kind="Phone" />
64+
</Button>
65+
</StackPanel>
66+
</Grid>
67+
</materialDesign:Card>
4768
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueLightBrush}"
4869
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
4970
Padding="8">
5071
<TextBlock FontSize="16">Boring Text</TextBlock>
5172
</materialDesign:Card>
5273
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueDarkBrush}"
5374
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
54-
Padding="8">
75+
>
5576
<StackPanel>
56-
<TextBlock FontSize="16">Notes</TextBlock>
57-
<CheckBox Margin="0 4 0 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Do something good</CheckBox>
58-
<CheckBox Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Take a breather</CheckBox>
59-
<CheckBox Style="{StaticResource MaterialDesignUserForegroundCheckBox}">And go create</CheckBox>
77+
<TextBlock Margin="16 16 12 8" FontSize="16">Notes</TextBlock>
78+
<CheckBox Margin="16 4 16 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Do something good</CheckBox>
79+
<CheckBox Margin="16 4 16 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Take a breather</CheckBox>
80+
<CheckBox Margin="16 4 16 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">And go create</CheckBox>
81+
<Separator Style="{StaticResource MaterialDesignLightSeparator}"/>
82+
<StackPanel Margin="8 0 8 8" Orientation="Horizontal" HorizontalAlignment="Right">
83+
<Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignToolForegroundButton}" Width="30" Padding="2 0 0 0"
84+
materialDesign:RippleAssist.IsCentered="True">
85+
<materialDesign:PackIcon Kind="CheckAll" />
86+
</Button>
87+
</StackPanel>
6088
</StackPanel>
6189
</materialDesign:Card>
6290
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueDarkBrush}"

MainDemo.Wpf/IconPack.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
88
xmlns:virtualCollection="clr-namespace:VirtualCollection.VirtualCollection"
99
mc:Ignorable="d"
10-
d:DesignHeight="300" d:DesignWidth="300"
11-
d:DesignData="{d:DesignInstance materialDesignDemo:IconPackViewModel, IsDesignTimeCreatable=False}">
10+
d:DesignHeight="300" d:DesignWidth="300">
1211
<UserControl.Resources>
1312
<ResourceDictionary>
1413
<ResourceDictionary.MergedDictionaries>

MainDemo.Wpf/Lists.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,22 @@
1414
</ResourceDictionary>
1515
</UserControl.Resources>
1616
<Grid Margin="8">
17+
<Grid.RowDefinitions>
18+
<RowDefinition/>
19+
<RowDefinition Height="Auto"/>
20+
</Grid.RowDefinitions>
1721
<Grid.ColumnDefinitions>
1822
<ColumnDefinition Width="1*" />
1923
<ColumnDefinition Width="1*" />
2024
<ColumnDefinition Width="1*" />
2125
</Grid.ColumnDefinitions>
22-
<ListBox Grid.Column="0">
26+
<ListBox Grid.Column="0" IsEnabled="{Binding IsChecked, ElementName=EnableListBox}">
2327
<TextBlock>Plain</TextBlock>
2428
<TextBlock>Old</TextBlock>
2529
<TextBlock>ListBox</TextBlock>
2630
<TextBlock>Full of junk</TextBlock>
2731
</ListBox>
32+
<CheckBox Name="EnableListBox" Grid.Row="1" IsChecked="True">Enabled</CheckBox>
2833
<!-- 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 -->
2934
<ItemsControl Grid.Column="1" ItemsSource="{Binding Items1}"
3035
Grid.IsSharedSizeScope="True"

MainDemo.Wpf/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@
195195
<materialDesign:PopupBox DockPanel.Dock="Right" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
196196
<StackPanel>
197197
<Button Content="Hello World" Click="MenuPopupButton_OnClick"/>
198-
<Separator/>
199198
<Button Content="Nice Popup" Click="MenuPopupButton_OnClick"/>
199+
<Button Content="Can't Touch This" IsEnabled="False" />
200200
<Separator/>
201201
<Button Content="Goodbye" Click="MenuPopupButton_OnClick"/>
202202
</StackPanel>

MainDemo.Wpf/MainWindow.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Windows.Controls;
33
using System.Windows.Controls.Primitives;
44
using System.Windows.Input;
5+
using System.Windows.Media;
56
using MaterialDesignColors.WpfExample.Domain;
67
using MaterialDesignThemes.Wpf;
78

@@ -19,6 +20,14 @@ public MainWindow()
1920

2021
private void UIElement_OnPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
2122
{
23+
//until we had a StaysOpen glag to Drawer, this will help with scroll bars
24+
var dependencyObject = Mouse.Captured as DependencyObject;
25+
while (dependencyObject != null)
26+
{
27+
if (dependencyObject is ScrollBar) return;
28+
dependencyObject = VisualTreeHelper.GetParent(dependencyObject);
29+
}
30+
2231
MenuToggleButton.IsChecked = false;
2332
}
2433

MainDemo.Wpf/ProvingGround.xaml

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,63 +6,44 @@
66
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
77
xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf"
88
xmlns:wpfExample="clr-namespace:MaterialDesignColors.WpfExample"
9-
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
10-
Background="{DynamicResource MaterialDesignPaper}"
11-
FontFamily="{StaticResource MaterialDesignFont}"
129
mc:Ignorable="d"
1310
d:DesignWidth="477" d:DesignHeight="272"
1411
d:DataContext="{d:DesignInstance wpfExample:ProvingGroundViewModel, d:IsDesignTimeCreatable=False}">
1512
<UserControl.Resources>
1613
<ResourceDictionary>
1714
<ResourceDictionary.MergedDictionaries>
15+
<!--
1816
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
1917
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ProgressBar.xaml" />
2018
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Slider.xaml" />
2119
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
2220
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
21+
-->
2322
</ResourceDictionary.MergedDictionaries>
2423

25-
2624

27-
2825

29-
</ResourceDictionary>
30-
</UserControl.Resources>
31-
32-
<StackPanel Margin="8">
33-
<ListBox Style="{StaticResource MaterialDesignToolToggleListBox}">
34-
<ListBoxItem>
35-
<materialDesign:PackIcon Kind="FormatAlignLeft"/>
36-
</ListBoxItem>
37-
<ListBoxItem>
38-
<materialDesign:PackIcon Kind="FormatAlignCenter"/>
39-
</ListBoxItem>
40-
<ListBoxItem>
41-
<materialDesign:PackIcon Kind="FormatAlignRight"/>
42-
</ListBoxItem>
43-
<ListBoxItem>
44-
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
45-
</ListBoxItem>
46-
</ListBox>
4726

48-
<ListBox Style="{StaticResource MaterialDesignToolToggleListBox}"
49-
SelectionMode="Extended"
50-
Margin="0 8 0 0">
51-
<ListBoxItem>
52-
<materialDesign:PackIcon Kind="FormatBold"/>
53-
</ListBoxItem>
54-
<ListBoxItem>
55-
<materialDesign:PackIcon Kind="FormatItalic"/>
56-
</ListBoxItem>
57-
<ListBoxItem x:Name="UnderlineCheckbox">
58-
<materialDesign:PackIcon Kind="FormatUnderline"/>
59-
</ListBoxItem>
60-
</ListBox>
6127

62-
<CheckBox IsChecked="{Binding ElementName=UnderlineCheckbox, Path=IsSelected}">Underline?</CheckBox>
63-
64-
<materialDesign:TimePicker Margin="0 16 0 0" SelectedTime="{Binding SelectedTime}" HorizontalAlignment="Left" />
28+
</ResourceDictionary>
29+
</UserControl.Resources>
6530

66-
</StackPanel>
31+
<materialDesign:DialogHost Identifier="RootDialog">
32+
<ScrollViewer VerticalScrollBarVisibility="Auto" Background="White">
33+
<Grid>
34+
<TextBox x:Name="loginText"
35+
materialDesign:HintAssist.FloatingScale=".56"
36+
materialDesign:HintAssist.FloatingOffset="1,-42"
37+
Style="{StaticResource MaterialDesignFloatingHintTextBox}" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" Margin="0,350,0,0" materialDesign:HintAssist.IsFloating="True" HorizontalAlignment="Center" VerticalAlignment="Top" Width="400" FontSize="36" Height="100" Background="White" Padding="6,0,0,2">
38+
<materialDesign:HintAssist.Hint>
39+
<StackPanel Orientation="Horizontal" Margin="0 0 0 0">
40+
<materialDesign:PackIcon Kind="Account" Width="50" Height="50" />
41+
<TextBlock Padding="5,0,0,0">Enter login</TextBlock>
42+
</StackPanel>
43+
</materialDesign:HintAssist.Hint>
44+
</TextBox>
45+
</Grid>
46+
</ScrollViewer>
47+
</materialDesign:DialogHost>
6748

6849
</UserControl>

MainDemo.Wpf/TextFields.xaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,11 @@
205205
<TextBox Grid.Row="6" Grid.Column="3"
206206
materialDesign:HintAssist.Hint="Large Font"
207207
materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0"
208-
materialDesign:HintAssist.FloatingScale="0.54"
209-
materialDesign:HintAssist.FloatingOffset="1,-54"
208+
materialDesign:HintAssist.FloatingScale="0.50"
210209
Text="Some Text"
211210
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
212211
FontSize="24"/>
213-
212+
214213
<TextBlock Grid.Row="7" Grid.Column="1" Style="{StaticResource MaterialDesignSubheadingTextBlock}"
215214
Margin="0 48 0 0">DataTemplate Test</TextBlock>
216215
<ContentControl Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="4"

0 commit comments

Comments
 (0)