Skip to content

Commit

Permalink
chore(markup): generated c#markup
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoy312 committed Oct 12, 2023
1 parent 0e81b72 commit d0d7fb8
Show file tree
Hide file tree
Showing 21 changed files with 2,321 additions and 2,002 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace Uno.Themes.WinUI.Markup;

// temporary workaround for ResourceKeyDefinition not applicable on field members.
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public sealed class ResourceKeyDefinitionAttribute : Attribute
{
public ResourceKeyDefinitionAttribute(Type propertyType, string key)
{
this.PropertyType = propertyType;
this.Key = key;
}

public string Key { get; }
public Type PropertyType { get; }
public Type? TargetType { get; set; }
}
594 changes: 274 additions & 320 deletions src/library/Uno.Themes.WinUI.Markup/Theme/Button.cs

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions src/library/Uno.Themes.WinUI.Markup/Theme/CalendarDatePicker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
using System;
using Windows.UI;
using Microsoft.UI.Text;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Uno.Extensions.Markup;
using Uno.Extensions.Markup.Internals;

using ResourceKeyDefinitionAttribute = Uno.Themes.WinUI.Markup.ResourceKeyDefinitionAttribute;

namespace Uno.Themes.Markup
{
public static partial class Theme
{
public static partial class CalendarDatePicker
{
public static partial class Resources
{
public static readonly BackgroundVSG Background = new();
public partial class BackgroundVSG
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBackground")]
public ThemeResourceKey<Brush> Default = new("CalendarDatePickerBackground");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBackgroundPointerOver")]
public ThemeResourceKey<Brush> PointerOver = new("CalendarDatePickerBackgroundPointerOver");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBackgroundPressed")]
public ThemeResourceKey<Brush> Pressed = new("CalendarDatePickerBackgroundPressed");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBackgroundDisabled")]
public ThemeResourceKey<Brush> Disabled = new("CalendarDatePickerBackgroundDisabled");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBackgroundFocused")]
public ThemeResourceKey<Brush> Focused = new("CalendarDatePickerBackgroundFocused");

public static implicit operator ThemeResourceKey<Brush>(BackgroundVSG self) => self.Default;
}

public static readonly BorderBrushVSG BorderBrush = new();
public partial class BorderBrushVSG
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBorderBrush")]
public ThemeResourceKey<Brush> Default = new("CalendarDatePickerBorderBrush");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBorderBrushPointerOver")]
public ThemeResourceKey<Brush> PointerOver = new("CalendarDatePickerBorderBrushPointerOver");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBorderBrushPressed")]
public ThemeResourceKey<Brush> Pressed = new("CalendarDatePickerBorderBrushPressed");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBorderBrushDisabled")]
public ThemeResourceKey<Brush> Disabled = new("CalendarDatePickerBorderBrushDisabled");

public static implicit operator ThemeResourceKey<Brush>(BorderBrushVSG self) => self.Default;
}

public static partial class Header
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerHeaderForeground")]
public static ThemeResourceKey<Brush> Foreground => new("CalendarDatePickerHeaderForeground");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerHeaderForegroundDisabled")]
public static ThemeResourceKey<Brush> ForegroundDisabled => new("CalendarDatePickerHeaderForegroundDisabled");
}

public static readonly TextForegroundVSG TextForeground = new();
public partial class TextForegroundVSG
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerTextForeground")]
public ThemeResourceKey<Brush> Default = new("CalendarDatePickerTextForeground");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerTextForegroundDisabled")]
public ThemeResourceKey<Brush> Disabled = new("CalendarDatePickerTextForegroundDisabled");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerTextForegroundSelected")]
public ThemeResourceKey<Brush> Selected = new("CalendarDatePickerTextForegroundSelected");

public static implicit operator ThemeResourceKey<Brush>(TextForegroundVSG self) => self.Default;
}

[ResourceKeyDefinition(typeof(CornerRadius), "CalendarDatePickerBackgroundCornerRadius")]
public static ThemeResourceKey<CornerRadius> BackgroundCornerRadius => new("CalendarDatePickerBackgroundCornerRadius");

[ResourceKeyDefinition(typeof(double), "CalendarDatePickerBackgroundMinHeight")]
public static ThemeResourceKey<double> BackgroundMinHeight => new("CalendarDatePickerBackgroundMinHeight");

[ResourceKeyDefinition(typeof(Thickness), "CalendarDatePickerBorderThemeThickness")]
public static ThemeResourceKey<Thickness> BorderThemeThickness => new("CalendarDatePickerBorderThemeThickness");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBottomBorderBrush")]
public static ThemeResourceKey<Brush> BottomBorderBrush => new("CalendarDatePickerBottomBorderBrush");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerCalendarGlyphForegroundDisabled")]
public static ThemeResourceKey<Brush> CalendarGlyphForegroundDisabled => new("CalendarDatePickerCalendarGlyphForegroundDisabled");

[ResourceKeyDefinition(typeof(Thickness), "CalendarDatePickerContentMargin")]
public static ThemeResourceKey<Thickness> ContentMargin => new("CalendarDatePickerContentMargin");

[ResourceKeyDefinition(typeof(CornerRadius), "CalendarDatePickerCornerRadius")]
public static ThemeResourceKey<CornerRadius> CornerRadius => new("CalendarDatePickerCornerRadius");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerForeground")]
public static ThemeResourceKey<Brush> Foreground => new("CalendarDatePickerForeground");

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

public static partial class Styles
{
[ResourceKeyDefinition(typeof(Style), "MaterialCalendarDatePickerStyle", TargetType = typeof(global::Microsoft.UI.Xaml.Controls.CalendarDatePicker))]
public static StaticResourceKey<Style> Default => new("MaterialCalendarDatePickerStyle");
}
}
}
}
36 changes: 36 additions & 0 deletions src/library/Uno.Themes.WinUI.Markup/Theme/CalendarView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using Windows.UI;
using Microsoft.UI.Text;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Uno.Extensions.Markup;
using Uno.Extensions.Markup.Internals;

using ResourceKeyDefinitionAttribute = Uno.Themes.WinUI.Markup.ResourceKeyDefinitionAttribute;

namespace Uno.Themes.Markup
{
public static partial class Theme
{
public static partial class CalendarView
{
public static partial class Resources
{
public static partial class Calendar
{
[ResourceKeyDefinition(typeof(Brush), "MaterialCalendarBlackoutForeground")]
public static ThemeResourceKey<Brush> BlackoutForeground => new("MaterialCalendarBlackoutForeground");

[ResourceKeyDefinition(typeof(Brush), "MaterialCalendarTodayForeground")]
public static StaticResourceKey<Brush> TodayForeground => new("MaterialCalendarTodayForeground");
}
}

public static partial class Styles
{
[ResourceKeyDefinition(typeof(Style), "MaterialCalendarViewStyle", TargetType = typeof(global::Microsoft.UI.Xaml.Controls.CalendarView))]
public static StaticResourceKey<Style> Default => new("MaterialCalendarViewStyle");
}
}
}
}
Loading

0 comments on commit d0d7fb8

Please sign in to comment.