Class SfShimmer
Initializes a new instance of the SfShimmer class. Represents a loading indicator control that provides modern animations when data is being loaded.
Implements
Inherited Members
Namespace: Syncfusion.Maui.Shimmer
Assembly: Syncfusion.Maui.Core.dll
Syntax
public class SfShimmer : SfContentView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IShimmer, IParentThemeElement, IThemeElement
Constructors
SfShimmer()
Initializes a new instance of the SfShimmer class.
Declaration
public SfShimmer()
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. |
CustomViewProperty
Identifies the CustomView bindable property.
Declaration
public static readonly BindableProperty CustomViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for CustomView bindable property. |
FillProperty
Identifies the Fill bindable property.
Declaration
public static readonly BindableProperty FillProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Fill bindable property. |
IsActiveProperty
Identifies the IsActive bindable property.
Declaration
public static readonly BindableProperty IsActiveProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IsActive bindable property. |
RepeatCountProperty
Identifies the RepeatCount bindable property.
Declaration
public static readonly BindableProperty RepeatCountProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for RepeatCount bindable property. |
TypeProperty
Identifies the Type bindable property.
Declaration
public static readonly BindableProperty TypeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Type bindable property. |
WaveColorProperty
Identifies the WaveColor bindable property.
Declaration
public static readonly BindableProperty WaveColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for WaveColor bindable property. |
WaveDirectionProperty
Identifies the WaveDirection bindable property.
Declaration
public static readonly BindableProperty WaveDirectionProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for WaveDirection bindable property. |
WaveWidthProperty
Identifies the WaveWidth bindable property.
Declaration
public static readonly BindableProperty WaveWidthProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for WaveWidth bindable property. |
Properties
AnimationDuration
Gets or sets the duration of the wave animation in milliseconds.
Declaration
public double AnimationDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value of AnimationDuration is 1000. |
Examples
The following code demonstrates, how to use the AnimationDuration property in the Shimmer.
CustomView
Gets or sets the custom view that is used for loading view.
Declaration
public View CustomView { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.View | The default value of CustomView is null. |
Examples
The following code demonstrates, how to use the CustomView property in the Shimmer.
<shimmer:SfShimmer x:Name="Shimmer">
<shimmer:SfShimmer.CustomView>
<Grid HeightRequest="50" WidthRequest="200">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="0.75*"/>
</Grid.ColumnDefinitions>
<shimmer:ShimmerView ShapeType="Circle" Grid.RowSpan="2"/>
<shimmer:ShimmerView Grid.Column="1" Margin="5"/>
<shimmer:ShimmerView ShapeType="RoundedRectangle" Grid.Row="1" Grid.Column="1" Margin="5"/>
</Grid>
</shimmer:SfShimmer.CustomView>
</shimmer:SfShimmer>
Fill
Gets or sets the background color of shimmer view.
Declaration
public Brush Fill { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | The default value of Fill is "#F3EDF6". |
Remarks
If the brush is a gradient brush then it only applies the first color.
Examples
The following code demonstrates, how to use the Fill property in the Shimmer.
IsActive
Gets or sets a value indicating whether to load actual content of shimmer.
Declaration
public bool IsActive { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value of IsActive is true. |
Examples
The following code demonstrates, how to use the IsActive property in the Shimmer.
RepeatCount
Gets or sets the number of times the built-in view should be repeated.
Declaration
public int RepeatCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value of RepeatCount is 1. |
Remarks
The repeat count is applicable only for the built-in views and not for the custom view.
Examples
The following code demonstrates, how to use the RepeatCount property in the Shimmer.
Type
Gets or sets the built-in shimmer view type.
Declaration
public ShimmerType Type { get; set; }
Property Value
Type | Description |
---|---|
ShimmerType | The default value of Type is CirclePersona. |
Examples
The following code demonstrates, how to use the Type property in the Shimmer.
WaveColor
Gets or sets the shimmer wave color.
Declaration
public Color WaveColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The default value of WaveColor is "#FFFBFE". |
Examples
The following code demonstrates, how to use the WaveColor property in the Shimmer.
WaveDirection
Gets or sets the animation direction for Shimmer.
Declaration
public ShimmerWaveDirection WaveDirection { get; set; }
Property Value
Type | Description |
---|---|
ShimmerWaveDirection | The default value of WaveDirection is Default. |
Examples
The following code demonstrates, how to use the WaveDirection property in the Shimmer.
WaveWidth
Gets or sets the width of the wave.
Declaration
public double WaveWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value of WaveWidth is 200. |
Examples
The following code demonstrates, how to use the WaveWidth property in the Shimmer.
Methods
MeasureContent(Double, Double)
Measures the size of layout required for child elements.
Declaration
protected override Size MeasureContent(double widthConstraint, double heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | widthConstraint | The widthConstraint. |
System.Double | heightConstraint | The heightConstraint. |
Returns
Type | Description |
---|---|
Microsoft.Maui.Graphics.Size | Return child element size. |
Overrides
OnContentChanged(Object, Object)
Called when Content property changed.
Declaration
protected override void OnContentChanged(object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oldValue | The old value. |
System.Object | newValue | The new value. |