In This Article

ProgressBarHighlightBrushConverter Class

Represents a converter that can be used by a progress bar control to construct a Brush that can be used to highlight a progress bar indicator.

public class ProgressBarHighlightBrushConverter
Inheritance:
object object

Remarks

This converter expects the following source values to be specified:

  1. Source Brush - A Brush that should be used as a basis for the Brush created by this converter.
  2. Width - A double that indicates the width of the progress bar.
  3. Height - A double that indicates the height of the progress bar.

Examples

 <-- Below is an example definition of the PART_Indicator for the AnimatedProgressBar. A similar definition could be
 used for the ProgressBar control. -->
 <Rectangle x:Name="animation">
    <Rectangle.OpacityMask>
        <MultiBinding>
            <MultiBinding.Converter>
                <themes:ProgressBarHighlightBrushConverter />
            </MultiBinding.Converter>
            <Binding Path="Foreground" RelativeSource="{RelativeSource TemplatedParent}" />
            <Binding Path="ActualWidth" ElementName="grid" />
            <Binding Path="ActualHeight" ElementName="grid" />
        </MultiBinding>
    </Rectangle.OpacityMask>
</Rectangle>

Constructors

ProgressBarHighlightBrushConverter()

Initializes an instance of the class.

public ProgressBarHighlightBrushConverter()

Methods

Convert(object[]?, Type, object?, CultureInfo)

Converts source values into a Brush that can be used to render a progress bar indicator.

public object? Convert(object[]? values, Type targetType, object? parameter, CultureInfo culture)
Parameter Type Description
values object[]

The array of values that the source bindings in the MultiBinding produces. The value System.Windows.DependencyProperty.UnsetValue indicates that the source binding has no value to provide for conversion.

targetType Type

The type of the binding target property.

parameter object

The converter parameter to use.

culture CultureInfo

The culture to use in the converter.

Returns

object:

A Brush that can be used to render a progress bar indicator; otherwise null.

ConvertBack(object, Type[], object?, CultureInfo)

This method always returns null and should not be used.

public object[]? ConvertBack(object value, Type[] targetTypes, object? parameter, CultureInfo culture)
Parameter Type Description
value object

Not used.

targetTypes Type[]

Not used.

parameter object

Not used.

culture CultureInfo

Not used.

Returns

object[]:

null.

Inherited Members

Extension Methods