Migrate from Xamarin.Forms to .NET MAUI SfLinearProgressBar
19 Sep 202413 minutes to read
To make the migration from the Xamarin SfLinearProgressBar to .NET MAUI SfLinearProgressBar easier, most of the APIs from the Xamarin SfLinearProgressBar were kept in the .NET MAUI SfLinearProgressBar. However, to maintain the consistency of API naming in the .NET MAUI SfLinearProgressBar, some of the APIs have been renamed. Please find the difference in the following topics.
Initialize control
To initialize the control, import the ProgressBar namespace and initialize the SfLinearProgressBar as shown in the following code sample.
Xamarin SfLinearProgressBar | .NET MAUI SfLinearProgressBar |
---|---|
|
|
Properties
Xamarin SfLinearProgressBar | .NET MAUI SfLinearProgressBar | Description |
---|---|---|
Gets or sets the value that specifies the current value for the progress. | ||
Gets or sets the secondary progress value for the SfLinearProgressBar. | ||
Gets or sets a value indicating whether the progress bar is in indeterminate state or not. | ||
Gets or sets the minimum possible value of the progress bar. The progress bar range starts from this value. | ||
Gets or sets the maximum possible value of the progress bar. The progress bar ends at this value. | ||
Gets or sets the brush that paints the interior area of the progress. | ||
Gets or sets the brush that paints the interior area of the secondary progress. | ||
Gets or sets the brush that paints the interior area of the track. | ||
Gets or sets the value that determine the segments count of progress bar. | ||
Gets or sets the value that determines the gap between the segments. | ||
Gets or sets a collection of ProgressGradientStop to fill the gradient brush to the progress. | ||
Gets or sets a value that specifies the progress animation duration in milliseconds. | ||
Gets or sets a value that specifies the secondary progress animation duration in milliseconds. | ||
Gets or sets a value that specifies the indeterminate animation duration in milliseconds. | ||
Gets or sets a value that specifies the easing effect for progress animation. | ||
Gets or sets a value that specifies the easing effect for indeterminate animation. | ||
Gets or sets the value that specifies width of the indeterminate indicator. | ||
Divided into , and | Gets or sets a value to determine the height of track, progress and secondary progress. | |
Divided into , and | Gets or sets a value to determine the corner radius of the track, progress, and secondary progress. | |
The value change event occurs when the Progress is changed. | ||
The progress completed event occurs when Progress value attains Maximum value in ProgressBar. |
NOTE
All the (*) marked APIs are renamed from Xamarin SfLinearProgressBar to maintain the consistency of API naming in the .NET MAUI SfLinearProgressBar.
The following code example explains how to use the properties in the Xamarin linear progress bar and the .NET MAUI linear progress bar.
Xamarin |
---|
|
.NET MAUI |
|
Unsupported features from Xamarin.Forms
- In Xamarin, the
Padding
is used to adjust the padding of the progress and secondary progress at all the four (left, top, right, and bottom) sides. But in .NET MAUI, it can be achieved with theProgressPadding
,ProgressHeight
, andSecondaryProgressHeight
properties. Please refer to thesethickness
andpadding
documentation for details.