Skip to content

Commit

Permalink
Add ctor with default absolute value
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik committed Oct 17, 2024
1 parent 5f42f40 commit d446465
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/Orc.Theming.Example/Views/Tools/FontSizeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@
<StackPanel Orientation="Vertical"
HorizontalAlignment="Left">
<Label Content="This is 10"
FontSize="{orctheming:FontSize Absolute=10}" />
FontSize="{orctheming:FontSize 10}" />
<Label Content="This is 12"
FontSize="{orctheming:FontSize Absolute=12}" />
FontSize="{orctheming:FontSize 12}" />
<Label Content="This is 14"
FontSize="{orctheming:FontSize Absolute=14}" />
FontSize="{orctheming:FontSize 14}" />
<Label Content="This is 16"
FontSize="{orctheming:FontSize Absolute=16}" />
FontSize="{orctheming:FontSize 16}" />
<Label Content="This is 18"
FontSize="{orctheming:FontSize Absolute=18}" />
FontSize="{orctheming:FontSize 18}" />
</StackPanel>
</GroupBox>
</StackPanel>
Expand Down Expand Up @@ -111,15 +111,15 @@
<StackPanel Orientation="Vertical"
HorizontalAlignment="Left">
<Label Content="This is 10"
FontSize="{orctheming:FontSize Absolute=10, SubscribeToEvents=True}" />
FontSize="{orctheming:FontSize 10, SubscribeToEvents=True}" />
<Label Content="This is 12"
FontSize="{orctheming:FontSize Absolute=12, SubscribeToEvents=True}" />
FontSize="{orctheming:FontSize 12, SubscribeToEvents=True}" />
<Label Content="This is 14"
FontSize="{orctheming:FontSize Absolute=14, SubscribeToEvents=True}" />
FontSize="{orctheming:FontSize 14, SubscribeToEvents=True}" />
<Label Content="This is 16"
FontSize="{orctheming:FontSize Absolute=16, SubscribeToEvents=True}" />
FontSize="{orctheming:FontSize 16, SubscribeToEvents=True}" />
<Label Content="This is 18"
FontSize="{orctheming:FontSize Absolute=18, SubscribeToEvents=True}" />
FontSize="{orctheming:FontSize 18, SubscribeToEvents=True}" />
</StackPanel>
</GroupBox>
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ namespace Orc.Theming
public class FontSize : Catel.Windows.Markup.UpdatableMarkupExtension
{
public FontSize() { }
[System.Windows.Markup.ConstructorArgument("delta")]
public FontSize(double absolute) { }
[System.Windows.Markup.ConstructorArgument("absolute")]
public double? Absolute { get; set; }
[System.Windows.Markup.ConstructorArgument("delta")]
public double? Delta { get; set; }
Expand Down
8 changes: 7 additions & 1 deletion src/Orc.Theming/Markup/FontSize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public FontSize()
Mode = FontSizeMode.Default;
}

public FontSize(double absolute)
: this()
{
Absolute = absolute;
}

/// <summary>
/// Gets or sets the font size scaling.
/// </summary>
Expand All @@ -57,7 +63,7 @@ public FontSize()
/// Gets or sets the absolute font size, that will be scaled to the default font size of 12.
/// </summary>
/// <value>The absolute font size.</value>
[ConstructorArgument("delta")]
[ConstructorArgument("absolute")]
public double? Absolute { get; set; }

/// <summary>
Expand Down

0 comments on commit d446465

Please sign in to comment.