Class ProgressBarBase
Base class of SfLinearProgressBar and SfCircularProgressBar. It contains common logic of track, progress, etc that help to visualize the data.
Implements
Inherited Members
Namespace: Syncfusion.Maui.ProgressBar
Assembly: Syncfusion.Maui.ProgressBar.dll
Syntax
public abstract class ProgressBarBase : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider
Constructors
ProgressBarBase()
Initializes a new instance of the ProgressBarBase class.
Declaration
public ProgressBarBase()
Fields
AnimationDurationProperty
Identifies the AnimationDuration bindable property.
Declaration
public static readonly BindableProperty AnimationDurationProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for AnimationDuration bindable property. |
AnimationEasingProperty
Identifies the AnimationEasing bindable property.
Declaration
public static readonly BindableProperty AnimationEasingProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for AnimationEasing bindable property. |
GradientStopsProperty
Identifies the GradientStops bindable property.
Declaration
public static readonly BindableProperty GradientStopsProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for GradientStops bindable property. |
IndeterminateAnimationDurationProperty
Identifies the IndeterminateAnimationDuration bindable property.
Declaration
public static readonly BindableProperty IndeterminateAnimationDurationProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IndeterminateAnimationDuration bindable property. |
IndeterminateAnimationEasingProperty
Identifies the IndeterminateAnimationEasing bindable property.
Declaration
public static readonly BindableProperty IndeterminateAnimationEasingProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IndeterminateAnimationEasing bindable property. |
IndeterminateIndicatorWidthFactorProperty
Identifies the IndeterminateIndicatorWidthFactor bindable property.
Declaration
public static readonly BindableProperty IndeterminateIndicatorWidthFactorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IndeterminateIndicatorWidthFactor bindable property. |
IsIndeterminateProperty
Identifies the IsIndeterminate bindable property.
Declaration
public static readonly BindableProperty IsIndeterminateProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IsIndeterminate bindable property. |
MaximumProperty
Identifies the Maximum bindable property.
Declaration
public static readonly BindableProperty MaximumProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Maximum bindable property. |
MinimumProperty
Identifies the Minimum bindable property.
Declaration
public static readonly BindableProperty MinimumProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Minimum bindable property. |
ProgressFillProperty
Identifies the ProgressFill bindable property.
Declaration
public static readonly BindableProperty ProgressFillProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ProgressFill bindable property. |
ProgressProperty
Identifies the Progress bindable property.
Declaration
public static readonly BindableProperty ProgressProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Progress bindable property. |
SegmentCountProperty
Identifies the SegmentCount bindable property.
Declaration
public static readonly BindableProperty SegmentCountProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for SegmentCount bindable property. |
SegmentGapWidthProperty
Identifies the SegmentGapWidth bindable property.
Declaration
public static readonly BindableProperty SegmentGapWidthProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for SegmentGapWidth bindable property. |
TrackFillProperty
Identifies the TrackFill bindable property.
Declaration
public static readonly BindableProperty TrackFillProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TrackFill bindable property. |
Properties
AnimationDuration
Gets or sets a value that specifies the progress animation duration in milliseconds.
Declaration
public double AnimationDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar AnimationDuration="3000"
Progress="50" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar AnimationDuration="3000"
Progress="50" />
AnimationEasing
Gets or sets a value that specifies the easing effect for progress animation.
Declaration
public Easing AnimationEasing { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Easing | The default value is Microsoft.Maui.Easing.Linear. |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar AnimationEasing="{x:Static Easing.BounceIn}"
Progress="50" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar AnimationEasing="{x:Static Easing.BounceIn}"
Progress="50" />
GradientStops
Gets or sets a collection of ProgressGradientStop to fill the gradient brush to the progress.
Declaration
public ObservableCollection<ProgressGradientStop> GradientStops { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<ProgressGradientStop> | A collection of the ProgressGradientStop objects associated with the brush, each of which specifies a color and an offset along the axis. The default is an empty collection. |
Remarks
Gradient effect is not supported for segmented circular progress bar.
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar Progress="75">
<progressBar:SfLinearProgressBar.GradientStops>
<progressBar:ProgressGradientStop Color="Yellow" Value="30"/>
<progressBar:ProgressGradientStop Color="Green" Value="60"/>
</progressBar:SfLinearProgressBar.GradientStops>
</progressBar:SfLinearProgressBar>
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar Progress="75">
<progressBar:SfCircularProgressBar.GradientStops>
<progressBar:ProgressGradientStop Color="Yellow" Value="30"/>
<progressBar:ProgressGradientStop Color="Green" Value="60"/>
</progressBar:SfCircularProgressBar.GradientStops>
</progressBar:SfCircularProgressBar>
IndeterminateAnimationDuration
Gets or sets a value that specifies the indeterminate animation duration in milliseconds.
Declaration
public double IndeterminateAnimationDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar IsIndeterminate="True"
IndeterminateAnimationDuration="5000" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar IsIndeterminate="True"
IndeterminateAnimationDuration="5000" />
IndeterminateAnimationEasing
Gets or sets a value that specifies the easing effect for indeterminate animation.
Declaration
public Easing IndeterminateAnimationEasing { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Easing | The default value is Microsoft.Maui.Easing.Linear. |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar IsIndeterminate="True"
IndeterminateAnimationEasing="{x:Static Easing.BounceIn}" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar IsIndeterminate="True"
IndeterminateAnimationEasing="{x:Static Easing.BounceIn}" />
IndeterminateIndicatorWidthFactor
Gets or sets the value that specifies width of the indeterminate indicator.
Declaration
public double IndeterminateIndicatorWidthFactor { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It ranges from 0 to 1. The default value is |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar IsIndeterminate="True"
IndeterminateIndicatorWidthFactor="0.7" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar IsIndeterminate="True"
IndeterminateIndicatorWidthFactor="0.7" />
IsIndeterminate
Gets or sets a value indicating whether the progress bar is in indeterminate state or not.
Declaration
public bool IsIndeterminate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar IsIndeterminate="True" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar IsIndeterminate="True" />
Maximum
Gets or sets the maximum possible value of the progress bar. The progress bar ends at this value.
Declaration
public double Maximum { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The highest possible value of the progress bar. The default value is |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar Maximum="50" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar Maximum="50" />
Minimum
Gets or sets the minimum possible value of the progress bar. The progress bar range starts from this value.
Declaration
public double Minimum { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The minimum possible value of the progress bar. The default value is |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar Minimum="50" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar Minimum="50" />
Progress
Gets or sets the value that specifies the current value for the progress.
Declaration
public double Progress { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar Progress="75" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar Progress="75" />
ProgressFill
Gets or sets the brush that paints the interior area of the progress.
Declaration
public Brush ProgressFill { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush |
|
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar Progress="50"
ProgressFill="Violet" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar Progress="50"
ProgressFill="Violet" />
SegmentCount
Gets or sets the value that determine the segments count of progress bar.
Declaration
public int SegmentCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar SegmentCount="4"
Progress="75" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar SegmentCount="4"
Progress="75" />
SegmentGapWidth
Gets or sets the value that determine the gap between the segments.
Declaration
public double SegmentGapWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar SegmentCount="4"
SegmentGapWidth="10" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar SegmentCount="4"
SegmentGapWidth="10" />
TrackFill
Gets or sets the brush that paints the interior area of the track.
Declaration
public Brush TrackFill { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush |
|
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar TrackFill="Red" />
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar TrackFill="Red" />
Methods
OnBindingContextChanged()
Invoked whenever the binding context of the View changes.
Declaration
protected override void OnBindingContextChanged()
Overrides
OnDraw(ICanvas, RectF)
Draws the progress bar.
Declaration
protected override void OnDraw(ICanvas canvas, RectF dirtyRect)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.ICanvas | canvas | The canvas. |
Microsoft.Maui.Graphics.RectF | dirtyRect | The dirty rect. |
Overrides
SetProgress(Double, Nullable<Double>, Easing)
Sets Progress with corresponding animation duration and easing effects.
Declaration
public void SetProgress(double progress, Nullable<double> animationDuration = null, Easing easing = null)
Parameters
Type | Name | Description |
---|---|---|
System.Double | progress | Progress value. |
System.Nullable<System.Double> | animationDuration | Duration to animate the progress. If didn't passed the duration, then it takes AnimationDuration. |
Microsoft.Maui.Easing | easing | Easing effect for the animation. If didn't passed the Easing, then it takes AnimationEasing. |
Examples
Snippet for SfLinearProgressBar
<progressBar:SfLinearProgressBar x:Name="linearProgress"/>
Snippet for SfCircularProgressBar
<progressBar:SfCircularProgressBar x:Name="circularProgress"/>
Events
ProgressChanged
The value change event occurs when Progress is changed.
Declaration
public event EventHandler<ProgressValueEventArgs> ProgressChanged
Event Type
Type |
---|
System.EventHandler<ProgressValueEventArgs> |
Examples
This snippet shows how to hook ProgressChanged event for SfLinearProgressBar
<progressBar:SfLinearProgressBar ProgressChanged="progressBar_ProgressChanged"
Progress = "50" />
This snippet shows how to hook ProgressChanged event for SfCircularProgressBar
<progressBar:SfCircularProgressBar ProgressChanged="progressBar_ProgressChanged"
Progress = "50" />
ProgressCompleted
Declaration
public event EventHandler<ProgressValueEventArgs> ProgressCompleted
Event Type
Type |
---|
System.EventHandler<ProgressValueEventArgs> |
Examples
This snippet shows how to hook ProgressCompleted event for SfLinearProgressBar
<progressBar:SfLinearProgressBar ProgressCompleted="progressBar_ProgressCompleted"
Progress = "100"/>
This snippet shows how to hook ProgressCompleted event for SfCircularProgressBar
<progressBar:SfCircularProgressBar ProgressCompleted="progressBar_ProgressCompleted"
Progress = "100"/>