Skip to content

ProgressBar indicator width ignores BorderThickness #24561

Closed

Description

@MartinZikmund

Current behavior 🐛

ProgressBar sizes its indicators from the full layout-root width minus Padding only. BorderThickness is ignored, so a bar with a horizontal border overshoots its track: at 100% the determinate indicator is as wide as the whole control.

The port also diverges from WinUI in a few related ways:

  • The indeterminate indicators use 40%/60% of the full width instead of the content width.
  • Toggling ShowPaused/ShowError on an indeterminate bar changes the visual state but doesn't resize the second indicator to 100%.
  • A collapsed indeterminate bar stays in its indeterminate visual states.
  • ProgressBarAutomationPeer's IRangeValueProvider.SetValue throws ElementNotEnabledException instead of setting Value.

The port's header claims winui3/release/1.7-stable, but SetProgressBarIndicatorWidth predates WinUI 1.5.5.

Expected behavior 🎯

Match WinUI (winui3/release/2.5.1): subtract the layout-rounded BorderThickness plus Padding (clamped at 0), fall back to a 1.0 scale when XamlRoot is null, resize the indicators on ShowPaused/ShowError changes, use determinate states when not visible, and let the peer set Value.

How to reproduce it (as minimally and precisely as possible) 🔬

<ProgressBar Width="200" Maximum="100" Value="100" BorderThickness="4,0,4,0" BorderBrush="Red" />

DeterminateProgressBarIndicator.Width is 200; WinUI gives 192.

Workaround 🛠️

Re-template the control so the border lives outside the indicator's measurement, or avoid horizontal BorderThickness.

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

All platforms 🌍

Uno.Sdk version (and other relevant versions) 📦

master (7.0 dev)

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

Found while auditing Uno's WinUI ports against winui3/release/2.5.1.

Activity

  1. added
    kind/bug
    triage/untriaged
    on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugtriage/untriaged

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions