Need an .Class method for Class in the Style<T> extension #368
mdelgadov
started this conversation in
New Feature Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With Xaml styles and classes, we can compose flexible styles.
Nevertheless, we can't create classes with the Markup Style extension.
So, currently we need to do this:
Style s = Style().Add()... etc.
s.Class = "class";
etc.
Which is not elegant, takes the style out of the wrapper and feels incomplete.
I propose to create an extension method:
public Style Class(BindableProperty property, string className)
{
MauiStyle.Class = className;
return this
}
That fits nicely with the fluent notation.
If approved, I write the code, test it and present the PR....
Beta Was this translation helpful? Give feedback.
All reactions