-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] Fixed: Setting BackgroundColor for Slider updates the MaximumTrackColor #30089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kubaflo
merged 7 commits into
dotnet:inflight/current
from
Tamilarasan-Paranthaman:fix-25921
Mar 21, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8caecd0
Fixed Slider BackgroundColor issue
Tamilarasan-Paranthaman 6d24650
Added test case
Tamilarasan-Paranthaman 41e0603
Added snapshots
Tamilarasan-Paranthaman ad66e25
Enable the Windows platform
Tamilarasan-Paranthaman 14be2a8
Added snapshots
Tamilarasan-Paranthaman 264d64a
Updated test sample
Tamilarasan-Paranthaman 551ba44
Added updated snapshots
Tamilarasan-Paranthaman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+22.1 KB
...Controls/tests/TestCases.Android.Tests/snapshots/android/VerifySliderColors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 25921, "[Windows] Setting BackgroundColor for Slider updates the Maximum Track Color", PlatformAffected.UWP)] | ||
| public class Issue25921 : ContentPage | ||
| { | ||
| public Issue25921() | ||
| { | ||
| var layout = new VerticalStackLayout(); | ||
| layout.VerticalOptions = LayoutOptions.Center; | ||
| layout.Spacing = 20; | ||
| var slider = new Slider() | ||
| { | ||
| WidthRequest = 300, | ||
| Maximum = 100, | ||
| Minimum = 0, | ||
| Value = 50, | ||
| BackgroundColor = Colors.Yellow, | ||
| MaximumTrackColor = Colors.Red, | ||
| MinimumTrackColor = Colors.Fuchsia, | ||
| }; | ||
|
|
||
| var secondSlider = new Slider() | ||
| { | ||
| WidthRequest = 300, | ||
| Maximum = 100, | ||
| Minimum = 0, | ||
| Value = 50, | ||
| Background = Colors.Grey, | ||
| MaximumTrackColor = Colors.SpringGreen, | ||
| MinimumTrackColor = Colors.BlueViolet, | ||
| }; | ||
|
|
||
| var button = new Button() | ||
| { | ||
| Text = "Change Background Color", | ||
| AutomationId = "ColorChangeButton", | ||
| Command = new Command(() => secondSlider.Background = Colors.Salmon) | ||
| }; | ||
|
|
||
| layout.Children.Add(slider); | ||
| layout.Children.Add(secondSlider); | ||
| layout.Children.Add(button); | ||
|
|
||
| Content = layout; | ||
| } | ||
| } | ||
Binary file added
BIN
+11.1 KB
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifySliderColors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25921.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue25921 : _IssuesUITest | ||
| { | ||
| public override string Issue => "[Windows] Setting BackgroundColor for Slider updates the Maximum Track Color"; | ||
|
|
||
| public Issue25921(TestDevice device) | ||
| : base(device) | ||
| { } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Slider)] | ||
| public void VerifySliderColors() | ||
| { | ||
| App.WaitForElement("ColorChangeButton"); | ||
| App.Tap("ColorChangeButton"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } |
Binary file added
BIN
+5.7 KB
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/Bugzilla29128Test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(190%)
...inUI.Tests/snapshots/windows/Slider_ChangeBackgroundColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(190%)
...ts/snapshots/windows/Slider_SetBackgroundColorAndIsEnable_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(190%)
...apshots/windows/Slider_SetBackgroundColorAndMaxTrackColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(190%)
...apshots/windows/Slider_SetBackgroundColorAndMinTrackColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.42 KB
(190%)
.../snapshots/windows/Slider_SetBackgroundColorAndThumbColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(190%)
...ts/snapshots/windows/Slider_SetIsEnableAndBackgroundColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(190%)
...s/snapshots/windows/Slider_SetIsVisibleAndBackgroundColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(190%)
...ts/snapshots/windows/Slider_SetMaxTrackAndBackgroundColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(190%)
...ts/snapshots/windows/Slider_SetMinTrackAndBackgroundColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.42 KB
(190%)
...Tests/snapshots/windows/Slider_SetThumbAndBackgroundColor_VerifyVisualState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.28 KB
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifySliderColors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.1 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifySliderColors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.