Class SfShimmer
The SfShimmer control is used to display a predefined built-in animation when an operation runs in the background of your application to await completion.
Inheritance
Namespace: Syncfusion.UI.Xaml.Core
Assembly: Syncfusion.Core.WinUI.dll
Syntax
public class SfShimmer : ContentControl
Examples
This example illustrates how to set the SfShimmer.
<syncfusion:SfShimmer x:Name="SfShimmer" WaveWidth="200" WaveColor="Red" WaveDirection="RightToLeft">
SfShimmer shimmer = new SfShimmer();
shimmer.WaveWidth = 200;
shimmer.WaveColor = Colors.Black;
shimmer.WaveDirection = ShimmerWaveDirection.RightToLeft;
Constructors
SfShimmer()
Initializes a new instance of the SfShimmer class.
Declaration
public SfShimmer()
Fields
CustomLayoutProperty
Identifies the CustomLayout dependency property.
Declaration
public static readonly DependencyProperty CustomLayoutProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for CustomLayout dependency property. |
FillProperty
Identifies the Fill dependency property.
Declaration
public static readonly DependencyProperty FillProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for Fill dependency property. |
IsActiveProperty
Identifies the IsActive dependency property.
Declaration
public static readonly DependencyProperty IsActiveProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for IsActive dependency property. |
RepeatCountProperty
Identifies the RepeatCount dependency property.
Declaration
public static readonly DependencyProperty RepeatCountProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for RepeatCount dependency property. |
TypeProperty
Identifies the Type dependency property.
Declaration
public static readonly DependencyProperty TypeProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for Type dependency property. |
WaveColorProperty
Identifies the WaveColor dependency property.
Declaration
public static readonly DependencyProperty WaveColorProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for WaveColor dependency property. |
WaveDurationProperty
Identifies WaveDuration dependency property.
Declaration
public static readonly DependencyProperty WaveDurationProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for the WaveDuration dependency property. |
WaveWidthProperty
Identifies WaveWidth dependency property.
Declaration
public static readonly DependencyProperty WaveWidthProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for the WaveWidth dependency property. |
Properties
CustomLayout
Gets or sets the custom layout that is used for shimmer effect animation.
Declaration
public FrameworkElement CustomLayout { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.FrameworkElement | The default value of CustomLayout is null. |
Examples
<shimmer:SfShimmer x:Name="Shimmer" >
<shimmer:SfShimmer.CustomLayout>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="0.75*"/>
</Grid.ColumnDefinitions>
<Ellipse Grid.Row="0" Grid.Column="0" Height="200" Width="200" HorizontalAlignment="Left" />
<Rectangle Grid.Row="0" Grid.Column="1" Height="60" Width="800" />
<Rectangle Grid.Row="1" Grid.Column= "1" Height= "60" Width= "400" HorizontalAlignment= "Left" />
</Grid>
</shimmer:SfShimmer.CustomLayout>
</shimmer:SfShimmer>
Fill
Gets or sets the background color of shimmer view.
Declaration
public Brush Fill { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.Media.Brush | The default value of Fill is LightGrey. |
Examples
<shimmer:SfShimmer x:Name="Shimmer" Fill="AliceBlue"/>
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
<syncfusion:SfShimmer IsActiver="False"/>
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. |
Examples
<shimmer:SfShimmer x:Name="Shimmer" RepeatCount="2"/>
Type
Gets or sets the built-in shimmer type.
Declaration
public ShimmerType Type { get; set; }
Property Value
Type | Description |
---|---|
ShimmerType | The default value of Type is CirclePersona. |
Examples
<shimmer:SfShimmer x:Name="Shimmer" Type="Video"/>
WaveColor
Gets or sets the shimmer wave color.
Declaration
public Color WaveColor { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Color | The default value of WaveColor is LightGray. |
Examples
<syncfusion:SfShimmer WaveColor="AliceBlue"/>
WaveDuration
Gets or sets the duration of the wave animation in milliseconds.
Declaration
public double WaveDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value of WaveDuration is 1000. |
Examples
<syncfusion:SfShimmer WaveDuration="1000"/>
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
<syncfusion:SfShimmer WaveWidth="100"/>
Methods
OnContentChanged(Object, Object)
Called when Microsoft.UI.Xaml.Controls.ContentControl.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. |