In This Article

ProgressBarSegmentedBrushConverter Class

Represents a converter that can be used by a progress bar control to construct a Brush that can be used as an opacity mask for a segmented progress bar indicator.

public class ProgressBarSegmentedBrushConverter
Inheritance:
object object

Remarks

This converter expects the following source values to be specified:

  1. Continuous - A bool that indicates whether the Brush created is intended for use by a progress bar that has a continuous indicator.
  2. Orientation - An Orientation that indicates the orientation of the progress bar.
  3. Indicator Width - A double that indicates the width of the progress bar indicator.
  4. Indicator Height - A double that indicates the height of the progress bar indicator.
  5. Track Width - A double that indicates the width of the progress bar track.
  6. Track Height - A double that indicates the height of the progress bar track.
  7. Indeterminate - A bool that indicates whether the Brush created is intended for use by a progress bar that is indeterminate.

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="PART_Indicator">
    <Rectangle.Fill>
        <MultiBinding>
            <MultiBinding.Converter>
                <themes:ProgressBarSegmentedBrushConverter />
            </MultiBinding.Converter>
            <Binding Path="IsContinuous" RelativeSource="{RelativeSource TemplatedParent}" />
            <Binding Path="Orientation" RelativeSource="{RelativeSource TemplatedParent}" />
            <Binding Path="ActualWidth" ElementName="PART_Indicator" />
            <Binding Path="ActualHeight" ElementName="PART_Indicator" />
            <Binding Path="ActualWidth" ElementName="PART_Track" />
            <Binding Path="ActualHeight" ElementName="PART_Track" />
            <Binding Path="IsIndeterminate" RelativeSource="{RelativeSource TemplatedParent}" />
        </MultiBinding>
    </Rectangle.Fill>
</Rectangle>

Constructors

ProgressBarSegmentedBrushConverter()

Initializes an instance of the class.

public ProgressBarSegmentedBrushConverter()

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.

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.

Remarks

See ProgressBarSegmentedBrushConverter for more information on the expected source values.

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