Skip to content

Commit

Permalink
Merge pull request #994 from MaterialDesignInXAML/master
Browse files Browse the repository at this point in the history
Proposed 2.4.1 Release
  • Loading branch information
ButchersBoy authored Jul 27, 2018
2 parents 5588485 + bed96d9 commit 96ffe54
Show file tree
Hide file tree
Showing 26 changed files with 389 additions and 314 deletions.
14 changes: 7 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Contribution Guidelines

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.
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.

## The purpose of this libary:
## The purposes of this library:

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).

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.
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.

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

## Coding standards:

I code using standard Visual Studio settings, using Resharper, and adopt (most of) ReSharper's suggestions. I'd like code to look pretty similar.
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.

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.

## UWP:

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.
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.

## TabControl:

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.
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.

## Submitting a PR:

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.
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.
9 changes: 5 additions & 4 deletions MainDemo.Wpf/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,20 @@
</materialDesign:PackIcon>
</materialDesign:PopupBox.ToggleContent>
<Border MaxHeight="600" MaxWidth="800">
<StackPanel>
<avalonEdit:TextEditor Document="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextDocumentValueConverter}}"
Style="{StaticResource AvalonTextEditorXamlDisplay}" />
<DockPanel>
<Button
Margin="0 10 0 0"
Tag="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="Right"
Command="Copy"
CommandParameter="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}"
Content="_COPY"
DockPanel.Dock="Bottom"
Style="{StaticResource MaterialDesignRaisedButton}">
</Button>
</StackPanel>
<avalonEdit:TextEditor Document="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextDocumentValueConverter}}"
Style="{StaticResource AvalonTextEditorXamlDisplay}" />
</DockPanel>
</Border>

</materialDesign:PopupBox>
Expand Down
14 changes: 11 additions & 3 deletions MainDemo.Wpf/Grids.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
d:DesignHeight="300" d:DesignWidth="600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down Expand Up @@ -46,12 +46,20 @@
Header="Description"
MaxLength="255"
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}" />
<materialDesign:MaterialDataGridTextColumn Binding="{Binding Numeric}"
Header="Numeric"
<materialDesign:MaterialDataGridTextColumn Binding="{Binding Numeric}"
Header="Number with long header"
Width="120"
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}">
<DataGridTextColumn.HeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}">
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock TextWrapping="Wrap" Text="{Binding}" TextAlignment="Right"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.HeaderStyle>
<DataGridTextColumn.ElementStyle>
Expand Down
15 changes: 15 additions & 0 deletions MainDemo.Wpf/TextFields.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,21 @@
</ComboBox.ItemsPanel>
</ComboBox>
</smtx:XamlDisplay>
<smtx:XamlDisplay Key="fields_27">
<ComboBox materialDesign:HintAssist.Hint="(large float hint)"
materialDesign:HintAssist.FloatingScale="1.5"
materialDesign:HintAssist.FloatingOffset="0, -24"
MinWidth="72"
Margin="16 0 0 0"
ItemsSource="{Binding LongListToTestComboVirtualization}"
Style="{StaticResource MaterialDesignFloatingHintComboBox}">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
</smtx:XamlDisplay>
</StackPanel>
<TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}" Margin="0 16 0 5">Disabled Controls</TextBlock>
<StackPanel Orientation="Horizontal">
Expand Down
4 changes: 4 additions & 0 deletions MainDemo.Wpf/TransitionsDemo/TransitionsDemoHome.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<smtx:XamlDisplay Key="transitions" Grid.Row="1">
<!-- the transitioner will manage your transitions. notice how SelectedIndex is set to zero: the first slide (instead of the default of -1) -->
<materialDesign:Transitioner SelectedIndex="0" AutoApplyTransitionOrigins="True">
<materialDesign:Transitioner.InputBindings>
<KeyBinding Key="Left" Command="{x:Static materialDesign:Transitioner.MovePreviousCommand}" />
<KeyBinding Key="Right" Command="{x:Static materialDesign:Transitioner.MoveNextCommand}" />
</materialDesign:Transitioner.InputBindings>

<!-- you can use a slide for each page, let's add a touch of fade for our first page -->
<materialDesign:TransitionerSlide OpeningEffect="{materialDesign:TransitionEffect FadeIn}">
Expand Down
2 changes: 1 addition & 1 deletion MaterialDesignThemes.Wpf/ButtonProgressAssist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static void SetIsIndicatorVisible(DependencyObject element, bool isIndica

public static bool GetIsIndicatorVisible(DependencyObject element)
{
return (bool)element.GetValue(IndicatorForegroundProperty);
return (bool)element.GetValue(IsIndicatorVisibleProperty);
}
}
}
2 changes: 1 addition & 1 deletion MaterialDesignThemes.Wpf/SnackbarMessageQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private DispatcherOperation<Snackbar> FindSnackbar(Dispatcher dispatcher)
{
if (!sb.IsLoaded || sb.Visibility != Visibility.Visible) return false;
var window = Window.GetWindow(sb);
return window != null && window.WindowState != WindowState.Minimized;
return window?.WindowState != WindowState.Minimized;
});
});
}
Expand Down
5 changes: 2 additions & 3 deletions MaterialDesignThemes.Wpf/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,11 @@
x:Name="ContentPresenter" Opacity="1"
Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
</AdornerDecorator>
<Grid x:Name="PART_ContentCoverGrid" Background="{x:Null}" Opacity="0" IsHitTestVisible="False" Focusable="False" />
<Grid x:Name="PART_ContentCoverGrid" Background="Black" Opacity="0" IsHitTestVisible="False" Focusable="False" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsOpen" Value="True">
<Setter TargetName="ContentPresenter" Property="IsEnabled" Value="False" />
<Setter TargetName="PART_ContentCoverGrid" Property="Background" Value="Black" />
<Setter TargetName="PART_ContentCoverGrid" Property="IsHitTestVisible" Value="True" />
</Trigger>
</ControlTemplate.Triggers>
Expand Down Expand Up @@ -933,7 +932,7 @@
x:Name="ContentPresenter" Opacity="1"
Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" />
</AdornerDecorator>
<Grid x:Name="PART_ContentCover" Background="{x:Null}" Opacity="0" IsHitTestVisible="False" Focusable="False" />
<Grid x:Name="PART_ContentCover" Background="Black" Opacity="0" IsHitTestVisible="False" Focusable="False" />
<Grid>
<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch"
x:Name="PART_LeftDrawer"
Expand Down
20 changes: 10 additions & 10 deletions MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Card.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
<ControlTemplate.Resources>
<converters:ShadowEdgeConverter x:Key="ShadowEdgeConverter" />
</ControlTemplate.Resources>
<Grid Margin="{TemplateBinding Margin}" Background="Transparent">
<Grid.OpacityMask>
<MultiBinding Converter="{StaticResource ShadowEdgeConverter}">
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualWidth"/>
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualHeight"/>
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:ShadowAssist.ShadowDepth)" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:ShadowAssist.ShadowEdges)" />
</MultiBinding>
</Grid.OpacityMask>
<Grid Background="Transparent">
<AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
<AdornerDecorator.OpacityMask>
<MultiBinding Converter="{StaticResource ShadowEdgeConverter}">
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualWidth"/>
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualHeight"/>
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:ShadowAssist.ShadowDepth)" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:ShadowAssist.ShadowEdges)" />
</MultiBinding>
</AdornerDecorator.OpacityMask>
<Border Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}"
CornerRadius="{TemplateBinding UniformCornerRadius}">
<Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"
Expand All @@ -49,4 +49,4 @@
<Setter Property="Focusable" Value="False"/>
</Style>

</ResourceDictionary>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
FloatingScale="{Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}"
FloatingOffset="{Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}"
HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
Hint="{TemplateBinding wpf:HintAssist.Hint}" />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,18 @@
</ControlTemplate.Resources>
<Grid>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<StackPanel Orientation="Horizontal" Background="Transparent">
<wpf:ListSortDirectionIndicator Width="0" Height="12"
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<wpf:ListSortDirectionIndicator Grid.Column="0" Width="0" Height="12"
x:Name="SortDirectionIndicator"
ListSortDirection="{TemplateBinding SortDirection}"
/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
<ContentPresenter Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="{TemplateBinding Padding}"/>
</StackPanel>
</Grid>
</Border>
<Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignGridColumnHeaderGripper}"/>
<Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignGridColumnHeaderGripper}"/>
Expand Down
Loading

0 comments on commit 96ffe54

Please sign in to comment.