Class SfProgressButton
ProgressButton visualizes the progression of an operation to indicate the user that a process is happening in the background with visual representation. It can contain a text, an icon, svg or both.
Inherited Members
Namespace: Syncfusion.Blazor.SplitButtons
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfProgressButton : SfBaseComponent
Remarks
Progress Button content is either by specifying Content property or by specifying content within SfProgressButton tag directive.
Examples
In the below code example, a basic button initialized with Content property.
<SfProgressButton Content="Click">
</SfProgressButton>
Constructors
SfProgressButton()
Declaration
public SfProgressButton()
Properties
ChildContent
Gets or sets a value that indicates the child content for the progress button including HTML element. If the child content is not specified, progress button is rendered using Content property.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | The template content. The default value is |
Remarks
The child content which is specified within SfProgressButton tag directive is either a string or HTML Element. The string content is also specified using Content property.
Content
Gets or sets a value that indicates the content of progress button.
Declaration
public string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts a string value. The default value is |
Remarks
Set child content within SfProgressButton tag directive, to render as HTML content.
CssClass
Gets or sets a value that indicates the CSS class string to customize the appearance of progress button.
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts a CSS class string separated by space to customize the appearance of progress button. The default value is |
Disabled
Gets or sets whether the progress button is disabled or not.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Duration
Gets or sets a value that indicates the duration of the progression in the progress.
Declaration
public double Duration { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Accepts a double value to set the duration of progress button. The default value is |
EnableProgress
Gets or sets whether the progress UI is enabled or not in progress button.
Declaration
public bool EnableProgress { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
EnableRtl
Gets or sets whether the right to left direction is enabled for progress button.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
HtmlAttributes
Gets or sets a collection of additional attributes that will applied to the progress button container element.
Declaration
public Dictionary<string, object> HtmlAttributes { get; set; }
Property Value
Type |
---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Remarks
Additional attributes can be added by specifying as inline attributes or by specifying @attributes
directive.
Examples
In the below code example, progress button width has been specified as style attribute in SfProgressButton tag directive.
<SfProgressButton style="width:200px">
</SfProgressButton>
IconCss
Gets or sets a value that indicates the CSS class string to include an icon or image for the progress button.
Declaration
public string IconCss { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts a CSS class string separated by space to include an icon or image for the button. The default value is |
IconPosition
Gets or sets a value that indicates how to display icons in the progress button ==.
Declaration
public IconPosition IconPosition { get; set; }
Property Value
Type | Description |
---|---|
IconPosition | One of the IconPosition enumeration. The default value is Left |
Remarks
If the IconPosition
is Left
, the icon will be placed left to the content of the progress button.
If the IconPosition
is Right
, the icon will be placed right to the content of the progress button.
If the IconPosition
is Top
, the icon will be placed above the content of the progress button.
If the IconPosition
is Bottom
, the icon will be placed below the content of the progress button.
IsPrimary
Gets or sets whether the primary style is enabled for progress button.
Declaration
public bool IsPrimary { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsToggle
Gets or sets whether the toggle option is enabled for progress button.
Declaration
public bool IsToggle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
OnClick
Gets or sets a event callback when button element is clicked.
Declaration
public EventCallback<MouseEventArgs> OnClick { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.MouseEventArgs> | An event callback function. |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
ClickAsync()
Clicks the button element to perform action.
Declaration
public Task ClickAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task. |
EndProgressAsync()
Completes the button progress.
Declaration
public Task EndProgressAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task. |
FocusAsync()
focuses the progress button to perform action.
Declaration
public Task FocusAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task. |
OnAfterRenderAsync(Boolean)
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender |
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
OnParametersSetAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |
StartAsync(Double)
Starts the button progress with the specified percent.
Declaration
public Task StartAsync(double percent = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Double | percent | Specifies the Progress percent. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task. |
StopAsync()
Stops the button progress.
Declaration
public Task StopAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task. |