Make Styles apply to Elements #15284
Unanswered
mike-rowley
asked this question in
Ideas
Replies: 1 comment
-
why not use css frameworks like boostrap it is so simple to do |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In trying to apply a Style to a Popup using this code in Styles.xaml
It was discovered that Popup is an Element and not a VisualElement because it can't be a ViewHandler the reason is to be a ViewHandler the control should inherit from what represents a View on each platform, (UIView on apple, View on Android, etc) the popup doesn't have that so it should be an ElementHandler and because of that an Element on the Maui world
I believe not allowing Styles on Elements is a huge oversight and creates an inconsistency for developers. Creating a situation where we have to know the base classes of anything to know if Styles works or not, that doesn't seem to make any sense and creates a situation where Styles works for some controls and not others, that inconsistency is one of the many failings of Xamarin that lead to the creation of MAUI, hopefully we can correct these inconsistencies.
I'm sure there are technical considerations at play as to why it was done this way but IMO those are far less important than presenting a complete, consistent and usable Styling interface for developers.
In talking with the folks in the CommunityToolkit repo they suggested I elevate my question there to the main Maui repo, here is the original conversation for reference
Beta Was this translation helpful? Give feedback.
All reactions