Open
Description
Description
When using VisualStates they do not appear to obey the rules of style hierarchies. Styles defined at the page level do not seem to correctly override styles defined at the app level.
Steps to Reproduce
- Clone and compile the repository specified below (use the
main
branch). - Note that there are
Label
andPicker
styles defined in theStyles.xaml
document as well as at the top of theMainPage
. - Run the app and note the appearance of the controls. The styles in the
MainPage
do not seem to override those defined in theStyles.xaml
for theVisualState
s. If correct, the text should be red. The styles that are directly assigned usingx:Key
function as expected.
- Toggle the
Switch
to enable the controls. Note that style properties set without the use ofVisualState
s do override those in theStyles.xaml
document (all the text is green).
Based on the documentation, I would expect styles defined at the page level to override those at the app level. I would expect that for the visual states as well and the result would be both sets of controls (Override and Assigned) to function the same.
Link to public reproduction project repository
https://github.com/lendres/MauiPickerVisualStates
Version with bug
9.0.50 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
Windows
Affected platform versions
Windows 10.0.19041.0
Did you find any workaround?
The styles can be explicitly set using the Style
or StyleClass
attributes.