Skip to content

Commit

Permalink
refactor: use static/themeresourcekey
Browse files Browse the repository at this point in the history
  • Loading branch information
kazo0 committed Sep 28, 2023
1 parent 862ab0f commit d42dfde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/library/Uno.Themes.WinUI.Markup/Theme/ProgressBar.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Uno.Extensions.Markup;
using Uno.Extensions.Markup.Internals;

namespace Uno.Themes.Markup
Expand All @@ -11,22 +12,22 @@ public static class ProgressBar
public static class Resources
{
[ResourceKeyDefinition(typeof(Brush), "ProgressBarForeground")]
public static ResourceValue<Brush> Foreground => new("ProgressBarForeground", true);
public static ThemeResourceKey<Brush> Foreground => new("ProgressBarForeground");

[ResourceKeyDefinition(typeof(Brush), "ProgressBarBackground")]
public static ResourceValue<Brush> Background => new("ProgressBarBackground", true);
public static ThemeResourceKey<Brush> Background => new("ProgressBarBackground");

[ResourceKeyDefinition(typeof(double), "ProgressBarMinWidth")]
public static ResourceValue<double> MinWidth => new("ProgressBarMinWidth", true);
public static ThemeResourceKey<double> MinWidth => new("ProgressBarMinWidth");

[ResourceKeyDefinition(typeof(double), "ProgressBarHeight")]
public static ResourceValue<double> Height => new("ProgressBarHeight", true);
public static ThemeResourceKey<double> Height => new("ProgressBarHeight");
}

public static class Styles
{
[ResourceKeyDefinition(typeof(Style), "ProgressBarStyle", TargetType = typeof(ProgressBar))]
public static ResourceValue<Style> Default => new("ProgressBarStyle");
public static StaticResourceKey<Style> Default => new("ProgressBarStyle");
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/library/Uno.Themes.WinUI.Markup/Theme/ProgressRing.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Uno.Extensions.Markup;
using Uno.Extensions.Markup.Internals;

namespace Uno.Themes.Markup
Expand All @@ -13,20 +14,20 @@ public static class Resources
public static class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "ProgressRingForeground")]
public static ResourceValue<Brush> Default => new("ProgressRingForeground", true);
public static ThemeResourceKey<Brush> Default => new("ProgressRingForeground");
}

public static class Background
{
[ResourceKeyDefinition(typeof(Brush), "ProgressRingBackground")]
public static ResourceValue<Brush> Default => new("ProgressRingBackground", true);
public static ThemeResourceKey<Brush> Default => new("ProgressRingBackground");
}
}

public static class Styles
{
[ResourceKeyDefinition(typeof(Style), "ProgressRingStyle", TargetType = typeof(ProgressRing))]
public static ResourceValue<Style> Default => new("ProgressRingStyle");
public static StaticResourceKey<Style> Default => new("ProgressRingStyle");
}
}
}
Expand Down

0 comments on commit d42dfde

Please sign in to comment.