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:
- Continuous - A bool that indicates whether the Brush created is intended for use by a progress bar that has a continuous indicator.
- Orientation - An Orientation that indicates the orientation of the progress bar.
- Indicator Width - A double that indicates the width of the progress bar indicator.
- Indicator Height - A double that indicates the height of the progress bar indicator.
- Track Width - A double that indicates the width of the progress bar track.
- Track Height - A double that indicates the height of the progress bar track.
- 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. 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
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
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()