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 segemented progress bar indicator.
public class ProgressBarSegmentedBrushConverter : IMultiValueConverter
- Inheritance:
- Object Object
Remarks
This converter expects the following source values to be specified:
- Continuous - A Boolean 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 hieght of the progress bar track.
- Indeterminate - A Boolean 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()
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
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.