Description
When hovering the Switch control with the mouse, it goes invisible on Windows when the theme was switched at runtime.
Light => Dark: Switch is invisible on Dark Mode
Dark => Light: Switch is invisible on Light Mode
At the repro repository, you will find 3 projects.
- SharedMauiXamlStylesLibrary => All styles for core controls, like the switch (Resources\Themes\Controls\Switch.xaml)
- SharedMauiXamlStylesLibrary.Syncfusion (not relevant for this bug)
- SharedMauiXamlStylesLibrary.SampleApp
This is the setup for the StateGroups.
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<!--
<VisualState x:Name="PointOver">
<VisualState.Setters>
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray700}}" />
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray700}}" />
</VisualState.Setters>
</VisualState>
-->
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="On">
<VisualState.Setters>
<Setter Property="OnColor" Value="{OnPlatform Android={DynamicResource PrimaryColorLight}, Default={AppThemeBinding Light={StaticResource LightGreen}, Dark={StaticResource LightGreen}}}" />
<Setter Property="ThumbColor" Value="{OnPlatform Android={DynamicResource PrimaryColor}, Default={StaticResource White}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Off">
<VisualState.Setters>
<Setter Property="ThumbColor" Value="{StaticResource White}" />
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray700}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
Steps to Reproduce
- Clone this repository: https://github.com/AndreasReitberger/SharedMauiXamlStyles
- Run the "x.SampleApp" projcet in the solution for
Windows
- At the main menu, visit the
Switches page
- Hover the mouse over the switch control, see everything is ok.
- At the main menu, toggle the theme once
- Then hover the mouse again, see the control vanish on
PointOver

While mouse is hovering:
With a Background not equal to White, you can see that the control gets White on hovering.
Link to public reproduction project repository
https://github.com/AndreasReitberger/SharedMauiXamlStyles
Version with bug
9.0.110 SR11
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
Not yet
Relevant log output
Description
When hovering the
Switchcontrol with the mouse, it goes invisible onWindowswhen the theme was switched at runtime.Light => Dark: Switch is invisible on Dark Mode
Dark => Light: Switch is invisible on Light Mode
At the repro repository, you will find 3 projects.
This is the setup for the
StateGroups.Steps to Reproduce
WindowsSwitchespagePointOverWith a
Backgroundnot equal toWhite, you can see that the control getsWhiteon hovering.Link to public reproduction project repository
https://github.com/AndreasReitberger/SharedMauiXamlStyles
Version with bug
9.0.110 SR11
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
Not yet
Relevant log output