Skip to content

Commit 265cac1

Browse files
authored
Creating default window style (#2174)
1 parent ee62852 commit 265cac1

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

MahMaterialDragablzMashUp/MainWindow.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
xmlns:dockablz="clr-namespace:Dragablz.Dockablz;assembly=Dragablz"
88
xmlns:wpf="http://materialdesigninxaml.net/winfx/xaml/themes"
99
WindowTransitionsEnabled="False"
10-
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
11-
Background="{DynamicResource MaterialDesignPaper}"
10+
Style="{StaticResource MaterialDesignWindow}"
1211
GlowBrush="{DynamicResource MahApps.Brushes.Accent}"
1312
FontFamily="{DynamicResource MahApps.Fonts.Family.Window.Title}"
1413
Title="Material-MahApps-Dragablz Mash Up" Height="640" Width="800">

MainDemo.Wpf/MainWindow.xaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@
1111
AutomationProperties.Name="{Binding Title, RelativeSource={RelativeSource Self}}"
1212
Height="800"
1313
Width="1100"
14-
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
15-
TextElement.FontWeight="Regular"
16-
TextElement.FontSize="13"
17-
TextOptions.TextFormattingMode="Ideal"
18-
TextOptions.TextRenderingMode="Auto"
19-
Background="{DynamicResource MaterialDesignPaper}"
20-
FontFamily="{materialDesign:MaterialDesignFont}"
14+
Style="{StaticResource MaterialDesignWindow}"
2115
Icon="favicon.ico">
2216
<Window.CommandBindings>
2317
<CommandBinding Command="Copy" Executed="OnCopy"/>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Defaults.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TreeView.xaml" />
4040
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Thumb.xaml" />
4141
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ValidationErrorTemplate.xaml" />
42+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Window.xaml" />
4243
</ResourceDictionary.MergedDictionaries>
44+
4345
<SolidColorBrush x:Key="MaterialDesignLightBackground" Color="#FFFAFAFA"/>
4446
<SolidColorBrush x:Key="MaterialDesignLightForeground" Color="#DD000000"/>
4547
<SolidColorBrush x:Key="MaterialDesignDarkBackground" Color="#FF303030"/>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf">
4+
<Style TargetType="Window" x:Key="MaterialDesignWindow">
5+
<Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}" />
6+
<Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesignBody}" />
7+
<Setter Property="TextElement.FontWeight" Value="Regular" />
8+
<Setter Property="TextElement.FontSize" Value="13" />
9+
<Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />
10+
<Setter Property="TextOptions.TextRenderingMode" Value="Auto" />
11+
<Setter Property="FontFamily" Value="{wpf:MaterialDesignFont}" />
12+
</Style>
13+
</ResourceDictionary>

0 commit comments

Comments
 (0)