Permalink
Browse files

Use DialogTitleFontSize and DialogMessageFontSize via DynamicResource…

… at the base MetroDialog style
  • Loading branch information...
punker76 committed Jan 14, 2018
1 parent be61e1b commit e54aaaf1f97daedef2a4bb6361629a4939ad3bd3
@@ -120,9 +120,6 @@ private void Initialize([CanBeNull] MetroWindow owningWindow, [CanBeNull] MetroD
this.Resources.MergedDictionaries.Add(this.DialogSettings.CustomResourceDictionary);
}
this.DialogTitleFontSize = (this.TryFindResource("DialogTitleFontSize") as double?).GetValueOrDefault(this.DialogTitleFontSize);
this.DialogMessageFontSize = (this.TryFindResource("DialogMessageFontSize") as double?).GetValueOrDefault(this.DialogMessageFontSize);
this.HandleThemeChange();
this.Loaded += this.BaseMetroDialogLoaded;
@@ -133,7 +133,7 @@ protected override void OnLoaded()
switch (this.DialogSettings.ColorScheme)
{
case MetroDialogColorScheme.Accented:
this.PART_NegativeButton.Style = this.FindResource("AccentedDialogHighlightedSquareButton") as Style;
this.PART_NegativeButton.SetResourceReference(StyleProperty, "AccentedDialogHighlightedSquareButton");
this.PART_TextBox.SetResourceReference(ForegroundProperty, "BlackColorBrush");
this.PART_TextBox.SetResourceReference(ControlsHelper.FocusBorderBrushProperty, "TextBoxFocusBorderBrush");
break;
@@ -240,7 +240,7 @@ protected override void OnLoaded()
switch (this.DialogSettings.ColorScheme)
{
case MetroDialogColorScheme.Accented:
this.PART_NegativeButton.Style = this.FindResource("AccentedDialogHighlightedSquareButton") as Style;
this.PART_NegativeButton.SetResourceReference(StyleProperty, "AccentedDialogHighlightedSquareButton");
this.PART_TextBox.SetResourceReference(ForegroundProperty, "BlackColorBrush");
this.PART_TextBox2.SetResourceReference(ForegroundProperty, "BlackColorBrush");
break;
@@ -272,10 +272,10 @@ private static void SetButtonState(MessageDialog md)
switch (md.DialogSettings.ColorScheme)
{
case MetroDialogColorScheme.Accented:
md.PART_AffirmativeButton.Style = md.FindResource("AccentedDialogHighlightedSquareButton") as Style;
md.PART_NegativeButton.Style = md.FindResource("AccentedDialogHighlightedSquareButton") as Style;
md.PART_FirstAuxiliaryButton.Style = md.FindResource("AccentedDialogHighlightedSquareButton") as Style;
md.PART_SecondAuxiliaryButton.Style = md.FindResource("AccentedDialogHighlightedSquareButton") as Style;
md.PART_AffirmativeButton.SetResourceReference(StyleProperty, "AccentedDialogHighlightedSquareButton");
md.PART_NegativeButton.SetResourceReference(StyleProperty, "AccentedDialogHighlightedSquareButton");
md.PART_FirstAuxiliaryButton.SetResourceReference(StyleProperty, "AccentedDialogHighlightedSquareButton");
md.PART_SecondAuxiliaryButton.SetResourceReference(StyleProperty, "AccentedDialogHighlightedSquareButton");
break;
}
}
@@ -88,6 +88,8 @@
<Setter Property="controls:ControlsHelper.ContentCharacterCasing" Value="Normal" />
</Style>
</Style.Resources>
<Setter Property="DialogTitleFontSize" Value="{DynamicResource DialogTitleFontSize}" />
<Setter Property="DialogMessageFontSize" Value="{DynamicResource DialogMessageFontSize}" />
<Setter Property="Background" Value="{DynamicResource WhiteColorBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Foreground" Value="{DynamicResource BlackBrush}" />

0 comments on commit e54aaaf

Please sign in to comment.