Repository navigation
|
I use things like: var label = new Label() But when I want to create a style using Maui.Markup: Add("Label", new Style< Label >() I can't find a way to create the SyleClass as I can do in Xaml: <Style Class="LabelClass" TargetType="Label"> <...> </style>Is it possible to use style classes or should I use Keys only? Thanks in ad |
Answered by
mdelgadov
Jan 21, 2025
Replies: 1 comment
|
No big deal, in case anybody else has this one: var style = (Style)new Style< Label >() style.Class = "Class"; easy piece, with the cast... |
0 replies
Answer selected by
mdelgadov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No big deal, in case anybody else has this one:
var style = (Style)new Style< Label >()
.AddAppThemeBinding(Label.TextColorProperty, Colors3.OnBackground, Colors3.OnBackgroundDark)
.ApplyToDerivedTypes(true)
.CanCascade(true));
style.Class = "Class";
easy piece, with the cast...