I have defined 2 VisualStates A and B.
In an Extension property I set the default value to A.
On an visualelement I bind to the property
Problem: When the control is added to the screen, the visual state is not A but "Normal".
It seems the state property is only read when I trigger a state change after creation.
After switching states it goes from Normal -> A -> B -> A -> B
Expected: A->B->A->B->A
see linked repo for an example.
Additional problems:
1) When switching style these warnings are outputed in the console
Microsoft.Maui.Controls.Element: Warning: Microsoft.Maui.Controls.LinearGradientBrush is already a child of Microsoft.Maui.Controls.Grid. Remove Microsoft.Maui.Controls.LinearGradientBrush from Microsoft.Maui.Controls.Grid before adding to Microsoft.Maui.Controls.Grid.
Microsoft.Maui.Controls.Element: Warning: Microsoft.Maui.Controls.SolidColorBrush is already a child of Microsoft.Maui.Controls.Grid. Remove Microsoft.Maui.Controls.SolidColorBrush from Microsoft.Maui.Controls.Grid before adding to Microsoft.Maui.Controls.Grid.
2) visual studio complains about my extension property, but builds succesfully
Error XLS0415 The attachable property 'MyVisualState' was not found in type 'MyVisualStateExtension'. zz_maui_windows_visualstategroupbug C:_Sources\zz_maui_visualstatebug\MainPage.xaml 91
Description
I have defined 2 VisualStates A and B. In an Extension property I set the default value to A. On an visualelement I bind to the property
Problem: When the control is added to the screen, the visual state is not A but "Normal". It seems the state property is only read when I trigger a state change after creation.
After switching states it goes from Normal -> A -> B -> A -> B Expected: A->B->A->B->A
see linked repo for an example.
Additional problems: 1) When switching style these warnings are outputed in the console Microsoft.Maui.Controls.Element: Warning: Microsoft.Maui.Controls.LinearGradientBrush is already a child of Microsoft.Maui.Controls.Grid. Remove Microsoft.Maui.Controls.LinearGradientBrush from Microsoft.Maui.Controls.Grid before adding to Microsoft.Maui.Controls.Grid. Microsoft.Maui.Controls.Element: Warning: Microsoft.Maui.Controls.SolidColorBrush is already a child of Microsoft.Maui.Controls.Grid. Remove Microsoft.Maui.Controls.SolidColorBrush from Microsoft.Maui.Controls.Grid before adding to Microsoft.Maui.Controls.Grid.
2) visual studio complains about my extension property, but builds succesfully Error XLS0415 The attachable property 'MyVisualState' was not found in type 'MyVisualStateExtension'. zz_maui_windows_visualstategroupbug C:_Sources\zz_maui_visualstatebug\MainPage.xaml 91
Steps to Reproduce
download repo build (i tested on windows)
Link to public reproduction project repository
https://github.com/sjorsmiltenburg/maui_visualstatebug.git
Version with bug
7.0.86
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
windows
Did you find any workaround?
my workaround for now is to rename A to Normal
Relevant log output
No response