Skip to content

Commit 96ffe54

Browse files
authored
Merge pull request #994 from MaterialDesignInXAML/master
Proposed 2.4.1 Release
2 parents 5588485 + bed96d9 commit 96ffe54

26 files changed

+389
-314
lines changed

.github/CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# Contribution Guidelines
22

3-
PRs to this project are welcome, but before contributing please bear in mind my thoughts below. If you want to get involved but are unsure, please ask (say hello in the [Gitter chat room](http://gitter.im/ButchersBoy/MaterialDesignInXamlToolkit)). Also note I wrote these guidelines several months after the library was first made available, with the benefit of hindsight. Apologies if there are inconsistencies with what you read below and what's already in the library.
3+
PRs to this project are welcome, but before contributing please bear in mind my thoughts below. If you want to get involved but are unsure, please ask (say hello in the [Gitter chat room](http://gitter.im/ButchersBoy/MaterialDesignInXamlToolkit)). Also note that I wrote these guidelines several months after the library was first made available, with the benefit of hindsight. Apologies if there are inconsistencies with what you read below and what's already in the library.
44

5-
## The purpose of this libary:
5+
## The purposes of this library:
66

77
This is a theme library, **not** a control library. There is a subtle difference. Yes, there are some new custom controls, but their role is to specifically support either styling of existing WPF controls, or to Material Design components, as per the "Components" section in [Google's guidelines](https://www.google.com/design/spec/material-design/introduction.html).
88

9-
The role of this library is to give users Material Design themes for standard WPF controls, and custom controls for Google specified components where no parallel exists in WPF, or where existing WPF controls cannot be sufficiently styled to meet the Google specification. Anything else is outside the scope of this library. WPF is very powerful and flexible when it comes to creating custom controls, but that doesn't mean I want to fill up this library with random controls. I want to provide the base tools and controls for Material Design, giving people a springboard to create their own controls where required.
9+
The role of this library is to give users Material Design themes for standard WPF controls, and custom controls for Google specified components where no parallel exists in WPF, or where existing WPF controls cannot be sufficiently styled to meet the Google specification. Anything else is outside the scope of this library. WPF is very powerful and flexible when it comes to creating custom controls, but that doesn't mean that I want to fill up this library with random controls. I want to provide the base tools and controls for Material Design, giving people a springboard to create their own controls where required.
1010

1111
In no way is this library a home for any sort of application or business logic.
1212

1313
## Coding standards:
1414

15-
I code using standard Visual Studio settings, using Resharper, and adopt (most of) ReSharper's suggestions. I'd like code to look pretty similar.
15+
I code using standard Visual Studio settings, using Resharper, and adopt (most of the) ReSharper's suggestions. I'd like the code to look pretty similar.
1616

1717
The API is king. If adding anything to the public interface of this library (controls, helpers etc) be mindful of the naming and usage. Don't be offended if I accept your PR but rename things slightly.
1818

1919
## UWP:
2020

21-
This whole project is a personal hobby, and this is even more true of the UWP section. I'm not accepting any PRs to UWP as I will be coding on this in my spare time, and using it as a way to learn and explore UWP for my onw enlightenment. If and when the UWP solution becomes more mature I will relax this stance.
21+
This whole project is a personal hobby, and this is even more true of the UWP section. I'm not accepting any PRs to UWP as I will be coding on this in my spare time, and using it as a way to learn and explore UWP for my own enlightenment. If and when the UWP solution becomes more mature I will relax this stance.
2222

2323
## TabControl:
2424

25-
There is no TabControl style, I won't create one, and I wont accept one. I have Dragablz, and don't want the added burden of supporting two styles; even if it is fully complete. I don't want the duplication and the overhead.
25+
There is no TabControl style, I won't create one, and I wont accept one. I have Dragablz and don't want the added burden of supporting two styles; even if it is fully complete. I don't want the duplication and the overhead.
2626

2727
## Submitting a PR:
2828

29-
Probably the smaller the better (within sensible bounds for the nature of your change); at least keep a single feature to a single branch/PR.
29+
Probably the smaller the better (within sensible bounds for the nature of your change); at least keep a single feature to a single branch/PR.

MainDemo.Wpf/App.xaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,20 @@
6767
</materialDesign:PackIcon>
6868
</materialDesign:PopupBox.ToggleContent>
6969
<Border MaxHeight="600" MaxWidth="800">
70-
<StackPanel>
71-
<avalonEdit:TextEditor Document="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextDocumentValueConverter}}"
72-
Style="{StaticResource AvalonTextEditorXamlDisplay}" />
70+
<DockPanel>
7371
<Button
7472
Margin="0 10 0 0"
7573
Tag="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}"
7674
HorizontalAlignment="Right"
7775
Command="Copy"
7876
CommandParameter="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}"
7977
Content="_COPY"
78+
DockPanel.Dock="Bottom"
8079
Style="{StaticResource MaterialDesignRaisedButton}">
8180
</Button>
82-
</StackPanel>
81+
<avalonEdit:TextEditor Document="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextDocumentValueConverter}}"
82+
Style="{StaticResource AvalonTextEditorXamlDisplay}" />
83+
</DockPanel>
8384
</Border>
8485

8586
</materialDesign:PopupBox>

MainDemo.Wpf/Grids.xaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
77
xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
88
mc:Ignorable="d"
9-
d:DesignHeight="300" d:DesignWidth="300">
9+
d:DesignHeight="300" d:DesignWidth="600">
1010
<UserControl.Resources>
1111
<ResourceDictionary>
1212
<ResourceDictionary.MergedDictionaries>
@@ -46,12 +46,20 @@
4646
Header="Description"
4747
MaxLength="255"
4848
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}" />
49-
<materialDesign:MaterialDataGridTextColumn Binding="{Binding Numeric}"
50-
Header="Numeric"
49+
<materialDesign:MaterialDataGridTextColumn Binding="{Binding Numeric}"
50+
Header="Number with long header"
51+
Width="120"
5152
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}">
5253
<DataGridTextColumn.HeaderStyle>
5354
<Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}">
5455
<Setter Property="HorizontalAlignment" Value="Right" />
56+
<Setter Property="ContentTemplate">
57+
<Setter.Value>
58+
<DataTemplate>
59+
<TextBlock TextWrapping="Wrap" Text="{Binding}" TextAlignment="Right"/>
60+
</DataTemplate>
61+
</Setter.Value>
62+
</Setter>
5563
</Style>
5664
</DataGridTextColumn.HeaderStyle>
5765
<DataGridTextColumn.ElementStyle>

MainDemo.Wpf/TextFields.xaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,21 @@
197197
</ComboBox.ItemsPanel>
198198
</ComboBox>
199199
</smtx:XamlDisplay>
200+
<smtx:XamlDisplay Key="fields_27">
201+
<ComboBox materialDesign:HintAssist.Hint="(large float hint)"
202+
materialDesign:HintAssist.FloatingScale="1.5"
203+
materialDesign:HintAssist.FloatingOffset="0, -24"
204+
MinWidth="72"
205+
Margin="16 0 0 0"
206+
ItemsSource="{Binding LongListToTestComboVirtualization}"
207+
Style="{StaticResource MaterialDesignFloatingHintComboBox}">
208+
<ComboBox.ItemsPanel>
209+
<ItemsPanelTemplate>
210+
<VirtualizingStackPanel />
211+
</ItemsPanelTemplate>
212+
</ComboBox.ItemsPanel>
213+
</ComboBox>
214+
</smtx:XamlDisplay>
200215
</StackPanel>
201216
<TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}" Margin="0 16 0 5">Disabled Controls</TextBlock>
202217
<StackPanel Orientation="Horizontal">

MainDemo.Wpf/TransitionsDemo/TransitionsDemoHome.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
<smtx:XamlDisplay Key="transitions" Grid.Row="1">
2727
<!-- the transitioner will manage your transitions. notice how SelectedIndex is set to zero: the first slide (instead of the default of -1) -->
2828
<materialDesign:Transitioner SelectedIndex="0" AutoApplyTransitionOrigins="True">
29+
<materialDesign:Transitioner.InputBindings>
30+
<KeyBinding Key="Left" Command="{x:Static materialDesign:Transitioner.MovePreviousCommand}" />
31+
<KeyBinding Key="Right" Command="{x:Static materialDesign:Transitioner.MoveNextCommand}" />
32+
</materialDesign:Transitioner.InputBindings>
2933

3034
<!-- you can use a slide for each page, let's add a touch of fade for our first page -->
3135
<materialDesign:TransitionerSlide OpeningEffect="{materialDesign:TransitionEffect FadeIn}">

MaterialDesignThemes.Wpf/ButtonProgressAssist.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static void SetIsIndicatorVisible(DependencyObject element, bool isIndica
9999

100100
public static bool GetIsIndicatorVisible(DependencyObject element)
101101
{
102-
return (bool)element.GetValue(IndicatorForegroundProperty);
102+
return (bool)element.GetValue(IsIndicatorVisibleProperty);
103103
}
104104
}
105105
}

MaterialDesignThemes.Wpf/SnackbarMessageQueue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private DispatcherOperation<Snackbar> FindSnackbar(Dispatcher dispatcher)
328328
{
329329
if (!sb.IsLoaded || sb.Visibility != Visibility.Visible) return false;
330330
var window = Window.GetWindow(sb);
331-
return window != null && window.WindowState != WindowState.Minimized;
331+
return window?.WindowState != WindowState.Minimized;
332332
});
333333
});
334334
}

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,12 +654,11 @@
654654
x:Name="ContentPresenter" Opacity="1"
655655
Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
656656
</AdornerDecorator>
657-
<Grid x:Name="PART_ContentCoverGrid" Background="{x:Null}" Opacity="0" IsHitTestVisible="False" Focusable="False" />
657+
<Grid x:Name="PART_ContentCoverGrid" Background="Black" Opacity="0" IsHitTestVisible="False" Focusable="False" />
658658
</Grid>
659659
<ControlTemplate.Triggers>
660660
<Trigger Property="IsOpen" Value="True">
661661
<Setter TargetName="ContentPresenter" Property="IsEnabled" Value="False" />
662-
<Setter TargetName="PART_ContentCoverGrid" Property="Background" Value="Black" />
663662
<Setter TargetName="PART_ContentCoverGrid" Property="IsHitTestVisible" Value="True" />
664663
</Trigger>
665664
</ControlTemplate.Triggers>
@@ -933,7 +932,7 @@
933932
x:Name="ContentPresenter" Opacity="1"
934933
Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" />
935934
</AdornerDecorator>
936-
<Grid x:Name="PART_ContentCover" Background="{x:Null}" Opacity="0" IsHitTestVisible="False" Focusable="False" />
935+
<Grid x:Name="PART_ContentCover" Background="Black" Opacity="0" IsHitTestVisible="False" Focusable="False" />
937936
<Grid>
938937
<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch"
939938
x:Name="PART_LeftDrawer"

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Card.xaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
<ControlTemplate.Resources>
1414
<converters:ShadowEdgeConverter x:Key="ShadowEdgeConverter" />
1515
</ControlTemplate.Resources>
16-
<Grid Margin="{TemplateBinding Margin}" Background="Transparent">
17-
<Grid.OpacityMask>
18-
<MultiBinding Converter="{StaticResource ShadowEdgeConverter}">
19-
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualWidth"/>
20-
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualHeight"/>
21-
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:ShadowAssist.ShadowDepth)" />
22-
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:ShadowAssist.ShadowEdges)" />
23-
</MultiBinding>
24-
</Grid.OpacityMask>
16+
<Grid Background="Transparent">
2517
<AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
18+
<AdornerDecorator.OpacityMask>
19+
<MultiBinding Converter="{StaticResource ShadowEdgeConverter}">
20+
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualWidth"/>
21+
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualHeight"/>
22+
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:ShadowAssist.ShadowDepth)" />
23+
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:ShadowAssist.ShadowEdges)" />
24+
</MultiBinding>
25+
</AdornerDecorator.OpacityMask>
2626
<Border Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}"
2727
CornerRadius="{TemplateBinding UniformCornerRadius}">
2828
<Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"
@@ -49,4 +49,4 @@
4949
<Setter Property="Focusable" Value="False"/>
5050
</Style>
5151

52-
</ResourceDictionary>
52+
</ResourceDictionary>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@
437437
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
438438
UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
439439
UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
440+
FloatingScale="{Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}"
441+
FloatingOffset="{Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}"
440442
HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
441443
Hint="{TemplateBinding wpf:HintAssist.Hint}" />
442444
</Grid>

0 commit comments

Comments
 (0)