Skip to content

fix(controls): LoadingScreen template: bind Foreground to ProgressRing and use A…#1707

Open
Qrasa510 wants to merge 2 commits intolepoco:mainfrom
Qrasa510:patch-1
Open

fix(controls): LoadingScreen template: bind Foreground to ProgressRing and use A…#1707
Qrasa510 wants to merge 2 commits intolepoco:mainfrom
Qrasa510:patch-1

Conversation

@Qrasa510
Copy link
Copy Markdown

@Qrasa510 Qrasa510 commented May 3, 2026

Fix LoadingScreen Foreground not applied to ProgressRing

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

The LoadingScreen control exposes a Foreground property, but it is not applied to the inner ProgressRing inside the control template. As a result, setting Foreground on LoadingScreen has no effect on the loading indicator color.

Additionally, the style contains duplicate Background setters, where the first one is overridden and has no effect.

Issue Number: N/A

What is the new behavior?

  • The Foreground property is now bound to the inner ProgressRing via TemplateBinding
  • A default Foreground value is introduced using AccentBrush to align with Wpf.Ui theme behavior
  • The redundant Background setter is removed

As a result:

  • Foreground correctly controls the loading indicator color
  • Default behavior follows the current theme accent color
  • Style definition is cleaned up and more consistent

Other information

This change improves consistency with expected WPF behavior, where control-level Foreground should cascade into visual elements within the control template.

Example usage:

<ui:LoadingScreen Foreground="Red" />

…ccentBrush by default

### Fix: LoadingScreen does not apply Foreground to ProgressRing

#### Problem
The `LoadingScreen` control exposes the `Foreground` property, but it is not used within the control template. As a result, setting `Foreground` has no effect on the visual appearance of the loading indicator.

Additionally, the style contains duplicate `Background` setters, where the first one is overridden.

#### Changes
- Bind `Foreground` to the inner `ProgressRing` via `TemplateBinding`
- Add a default `Foreground` value using `AccentBrush` to match Wpf.Ui theming
- Remove the redundant `Background` setter

#### Result
- `Foreground` now correctly controls the `ProgressRing` color
- Default appearance follows the current theme accent color
- Cleans up redundant style definition

#### Example
```xml
<ui:LoadingScreen Foreground="Red"/>

Now correctly changes the loading indicator color.
@Qrasa510 Qrasa510 requested a review from pomianowski as a code owner May 3, 2026 12:08
@github-actions github-actions Bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request release labels May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. PR Pull request release styles Topic is related to styles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants