Skip to content

ProgressRing keeps its old colour when the brush assigned to Foreground changes colour #24555

Closed

Description

@DerekRaven

Current behavior

A ProgressRing hands its colours to its animated visual only when the Foreground or Background dependency property itself changes, plus once when its template is applied. If the property keeps pointing at the same SolidColorBrush and that brush's Color changes, the ring goes on painting the old colour indefinitely.

This shows up in themed apps: a brush resource whose Color is re-evaluated at runtime is mutated in place rather than replaced, so every other control repaints and the ring does not.

The animation is not involved — a determinate ring that has never animated behaves the same way.

Expected behavior

The ring repaints in the brush's new colour, like every other control drawn with the same brush.

How to reproduce

No theming needed:

var brush = new SolidColorBrush(Colors.Red);
var ring = new ProgressRing
{
    Foreground = brush,
    IsActive = true,
    IsIndeterminate = false,
    Value = 70,
    Width = 80,
    Height = 80,
};
// put it in the tree and let it render -> the ring paints red

brush.Color = Colors.Lime;
// -> the ring still paints red

Measured by rasterising the ring with RenderTargetBitmap and reading the pixels back:

step rendered
baseline, brush is red red
brush.Color = Colors.Lime still red
IsIndeterminate toggled true then false lime
Foreground set to null and back to the same brush lime
the ring replaced by a new instance lime

Workaround

Force the property to change. Toggling IsIndeterminate and putting it straight back makes the ring build its animated visual again and read the brush as it then is.

Environment

Uno Platform 6.8.0-dev.112, net9.0-desktop (Skia), .NET 9. Not checked on other targets.

Notes

ProgressRing registers property-changed callbacks on Foreground and Background and pushes the colour into the animated visual from there, plus once in OnApplyTemplate. Nothing observes the brush's own changes, so a brush mutated in place never reaches the ring.

Activity

  1. Jen-Uno commented on Sep 30, 2026

    @Jen-Uno
    Contributor

    QA: closing out without a manual pass. The fix in #24613 ships with automated tests (Given_ProgressRing.cs) that exercise the change.

    If you still see this behaviour on a build that includes that PR, please reopen or comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions