Tooling-Windows-Submodule
Tooling-Windows-Submodule copied to clipboard
Feature: Add EnumOptionAttribute
Use:
[ToolkitSampleEnumOption<Visibility>("MyVisibility", Title = "Visibility")]
public partial class Sample : UserControl;
instead of
[ToolkitSampleEnumOption("MyVisibility", "Visible", "Collapsed", Title = "Visibility")]
public partial class Sample : UserControl;
And generate accurate enum type for ToolkitSampleEnumOption:
public Windows.UI.Xaml.Controls.Visibility MyVisibility
{
get => (Windows.UI.Xaml.Controls.Visibility)(...)!.Value!;
set ...
}
All the changes are AOT compatiable
Good to see that new C# 12 features might make this a bit simpler to set up.
However, we should be doing an evaluation of existing code before making refactors like this. We had custom logic for added flexibility, and this would need to be assessed and planned out before making improving.
We'll keep the PR around for now, but let's get a ticket open to track our rationale and methodology.