-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
2,321 additions
and
2,002 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/library/Uno.Themes.WinUI.Markup/ResourceKeyDefinitionAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
117 changes: 117 additions & 0 deletions
117
src/library/Uno.Themes.WinUI.Markup/Theme/CalendarDatePicker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.