I'm wanting a progress bar to change it's color depending on the range the current value is currently in. I was wondering if there was an attribute on the progress bar that I could bind a view model property to to change the color. Does such an attribute exist on the WPF progressbar?
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
Just change the foreground color to the color you like:
Edit (answering your comment): Yes, you need a
Brush
property (Almost all color properties are Brushed in WPF)But don't worry it's very simple:
And the property:
Are you trying to change the entire color of the progress bar or are you trying to have different parts of the progress bar be different colors, based on the value? If the latter you'll want a gradient brush, setting different gradient stops according to the values in the progress bar.