diff --git a/src/Orc.Theming/Markup/FontSize.cs b/src/Orc.Theming/Markup/FontSize.cs index b98f937..f9167f0 100644 --- a/src/Orc.Theming/Markup/FontSize.cs +++ b/src/Orc.Theming/Markup/FontSize.cs @@ -15,6 +15,8 @@ /// public class FontSize : UpdatableMarkupExtension { + private const double DefaultFontSize = 12d; + private static readonly ILog Log = LogManager.GetCurrentClassLogger(); private static readonly Stopwatch LastUpdatedTextBlockFontSizeStopwatch = Stopwatch.StartNew(); @@ -75,7 +77,7 @@ public FontSize() protected override object? ProvideDynamicValue(IServiceProvider? serviceProvider) { - var defaultFontSize = 12d; + var defaultFontSize = DefaultFontSize; switch (Mode) { @@ -104,7 +106,7 @@ public FontSize() if (Absolute is not null) { // Return immediately, always use 12d as base font - var factor = Absolute.Value / 12d; + var factor = Absolute.Value / DefaultFontSize; finalFontSize = defaultFontSize * factor; return finalFontSize; } @@ -135,7 +137,7 @@ private double GetFontSizeFromTextBlockMetadata() private double GetFontSizeFromParent() { - var defaultFontSize = 12d; + var defaultFontSize = DefaultFontSize; if (TargetObject is DependencyObject dependencyObject) {