Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EnumOptionAttribute #228

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Poker-sang
Copy link

@Poker-sang Poker-sang commented Nov 18, 2024

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

@Poker-sang Poker-sang marked this pull request as draft November 18, 2024 15:37
@Poker-sang Poker-sang marked this pull request as ready for review November 18, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant