Skip to content

Commit 244874e

Browse files
committed
Add a global DefaultFont
Change all to DefaultFont
1 parent f5843e2 commit 244874e

File tree

9 files changed

+23
-9
lines changed

9 files changed

+23
-9
lines changed

MahMaterialDragablzMashUp/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
99
Background="{DynamicResource MaterialDesignPaper}"
1010
GlowBrush="{DynamicResource AccentColorBrush}"
11-
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
11+
FontFamily="{StaticResource DefaultFont}"
1212
Title="Material-MahApps-Dragablz Mash Up" Height="350" Width="525">
1313
<controls:MetroWindow.Flyouts>
1414
<controls:FlyoutsControl>

MainDemo.Wpf/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
TextOptions.TextFormattingMode="Ideal"
1313
TextOptions.TextRenderingMode="Auto"
1414
Background="{DynamicResource MaterialDesignPaper}"
15-
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto" Icon="favicon.ico">
15+
FontFamily="{StaticResource DefaultFont}" Icon="favicon.ico">
1616
<Window.Resources>
1717
<ResourceDictionary>
1818
<ResourceDictionary.MergedDictionaries>

MainDemo.Wpf/ProvingGround.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
77
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
88
Background="{DynamicResource MaterialDesignPaper}"
9-
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
9+
FontFamily="{StaticResource DefaultFont}"
1010
mc:Ignorable="d"
1111
d:DesignWidth="477" d:DesignHeight="272">
1212
<UserControl.Resources>

MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@
289289
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
290290
</None>
291291
<AppDesigner Include="Properties\" />
292+
<Page Include="Themes\MaterialDesignTheme.Fonts.xaml">
293+
<Generator>MSBuild:Compile</Generator>
294+
<SubType>Designer</SubType>
295+
</Page>
292296
<Resource Include="Resources\Roboto\RobotoCondensed-Regular.ttf" />
293297
<Resource Include="Resources\Roboto\RobotoCondensed-LightItalic.ttf" />
294298
<Resource Include="Resources\Roboto\RobotoCondensed-Light.ttf" />

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RatingBar.xaml" />
2121
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TimePicker.xaml" />
2222
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
23+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Fonts.xaml" />
2324
</ResourceDictionary.MergedDictionaries>
2425

2526
<!-- set up default styles for our custom Material Design in XAML Toolkit controls -->
@@ -573,7 +574,7 @@
573574
TextOptions.TextFormattingMode="Ideal"
574575
TextOptions.TextRenderingMode="Auto"
575576
Foreground="{DynamicResource MaterialDesignBody}"
576-
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
577+
FontFamily="{StaticResource DefaultFont}"
577578
IsTabStop="False"
578579
Opacity="0"
579580
RenderTransformOrigin=".5,.5"

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Defaults.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<!-- use this resource dictionary to set up the most common themese for standard controls -->
66

77
<ResourceDictionary.MergedDictionaries>
8+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Fonts.xaml" />
89
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ValidationErrorTemplate.xaml" />
910
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
1011
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.Button.xaml" />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
>
4+
5+
<FontFamily x:Key="DefaultFont">pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto</FontFamily>
6+
7+
</ResourceDictionary>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Menu.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<Style x:Key="MaterialDesignMenu" TargetType="{x:Type MenuBase}">
2626
<Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}"/>
27-
<Setter Property="FontFamily" Value="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"/>
27+
<Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
2828
<Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}"/>
2929
<Setter Property="TextBlock.FontSize" Value="15"/>
3030
<Setter Property="VerticalContentAlignment" Value="Center"/>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ToolBar.xaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf">
44

55
<ResourceDictionary.MergedDictionaries>
6-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.checkbox.xaml" />
7-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.combobox.xaml" />
6+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.CheckBox.xaml" />
7+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.ComboBox.xaml" />
88
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Menu.xaml" />
99
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RadioButton.xaml" />
1010
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
1111
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBox.xaml" />
12-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.togglebutton.xaml" />
12+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.ToggleButton.xaml" />
13+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.Fonts.xaml" />
1314
</ResourceDictionary.MergedDictionaries>
1415

1516
<Style x:Key="MaterialDesignToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
@@ -116,7 +117,7 @@
116117

117118
<Style x:Key="MaterialDesignToolBar" TargetType="{x:Type ToolBar}">
118119
<Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}"/>
119-
<Setter Property="FontFamily" Value="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"/>
120+
<Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
120121
<Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}"/>
121122
<Setter Property="ClipToBounds" Value="True"/>
122123
<Setter Property="Template">

0 commit comments

Comments
 (0)