Search code examples
c#xamlwinui-3

Default Control Template of ProgressBar Control in WinUI 3


I am working on a WinUI 3 app and I am not able to find a way to change the control template of the ProgressBar.

My actual requirement is to change the height of "Track Line".

Check below image. I want to change height of this thin line marked in Red.

enter image description here

I can change default control template as well if you can share the whole style of ProgressBar in WinUI 3.


Solution

  • You can find the default template of ProgressBar in this link.

    If you want to set the height only, you can override the ProgressBarTrackHeight resource (see line 232 in the source code)

    In essence you can just create a new ThemeResource with the same key in your code to override the default value.
    https://learn.microsoft.com/en-us/windows/apps/design/style/xaml-theme-resources

    Hope this helps