dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.2k stars 1.75k forks source link

Switch BackgroundColor properties are not updated from ViewModel #18884

Open vadimffe opened 11 months ago

vadimffe commented 11 months ago

Description

This issue is related to previously addressed one. All controls that I have currently added in example attached, seems to be working except Switch. Also I have noticed that checkbox behaves strange as once you hover mouse on it, it's background colour disappears.

<CheckBox BackgroundColor="{Binding SColor}"></CheckBox>

Switch control colour stays always grey so OnColor and ThumbColor does not seem to work, as you can see from the screenshot below:

image

P.S. My snipping tool video recording does not work for some reason. Only screenshot can be provided for the time being.

Old issue: https://github.com/dotnet/maui/issues/12749

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/vadimffe/ControlsBackgroundColorIssue

Version with bug

8.0.3

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 11

Did you find any workaround?

No response

Relevant log output

No response

ghost commented 11 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

jsauve commented 11 months ago

What happens when you set the Background property to solid Brush? (instead of using BackgroundColor). Or perhaps the OnColor property instead of BackgroundColor?

evandeveydt123 commented 10 months ago

I also have the switch color problem on windows. It broke when I updated to .net 8.

<Switch x:Name="darkModeSwitch" HorizontalOptions="End" Margin="30,2,0,0" OnColor="#8A3676" ThumbColor="#631F60" Toggled="DarkModeSwitcher"/>

image

AnnYang01 commented 10 months ago

Verified this on Visual Studio Enterprise 17.9.0 Preview 2 (.Net8.0). Repro on Windows 11, Android 14.0-API34 ,iOS(OS: 17.0) and MacCatalyst 13.6.1 with below Project: ControlsColorIssue.zip Windows 11: Issue1:Switch BackgroundColor properties are not updated Issue2:Checkbox behaves strange as once you hover mouse on it, it's background colour disappears. 18884 Android 14.0-API34 ,iOS(OS: 17.0) and MacCatalyst 13.6.1: Switch BackgroundColor properties are not updated 18884_1

vadimffe commented 8 months ago

Any updates regarding this one?