Loading...
Loading...
Guide for implementing the Syncfusion WinUI Shimmer control to display loading placeholders and skeleton screens. Use this skill when implementing shimmer effects, skeleton screens, content loading animations, or loading placeholders during data fetching in WinUI applications. Essential for enhancing perceived performance during async operations, list loading, profile loading, article loading, or any content loading scenario requiring visual feedback.
npx skill4agent add syncfusion/winui-ui-components-skills syncfusion-winui-shimmerSyncfusion.UI.Xaml.CoreSyncfusion.Core.WinUI<Page
xmlns:syncfusion="using:Syncfusion.UI.Xaml.Core">
<Grid>
<syncfusion:SfShimmer
x:Name="shimmer"
Type="Article"
Fill="#F6F6F6"
WaveColor="#E0E0E0"
RepeatCount="3"/>
</Grid>
</Page>using Syncfusion.UI.Xaml.Core;
using Microsoft.UI;
// Create and configure Shimmer
SfShimmer shimmer = new SfShimmer
{
Type = ShimmerType.Article,
Fill = Colors.LightGray,
WaveColor = Colors.White,
RepeatCount = 3
};
// Add to UI
this.Content = shimmer;<syncfusion:SfShimmer Type="Profile"/><Grid>
<syncfusion:SfShimmer
Type="Article"
RepeatCount="5"
Fill="#F5F5F5"
WaveColor="#E0E0E0"/>
</Grid><syncfusion:SfShimmer
Type="Shopping"
RepeatCount="6"
WaveDuration="1500"/><syncfusion:SfShimmer
Type="Video"
RepeatCount="4"
Fill="#000000"
WaveColor="#333333"/><Grid>
<!-- Shimmer while loading -->
<syncfusion:SfShimmer
x:Name="shimmer"
Type="Feed"
Visibility="{x:Bind IsLoading, Mode=OneWay}"/>
<!-- Actual content when loaded -->
<ListView
x:Name="contentListView"
Visibility="{x:Bind IsLoaded, Mode=OneWay}"
ItemsSource="{x:Bind Items}"/>
</Grid>private bool isLoading = true;
public bool IsLoading
{
get => isLoading;
set
{
isLoading = value;
OnPropertyChanged();
}
}
public bool IsLoaded => !IsLoading;
private async void LoadContentAsync()
{
IsLoading = true;
try
{
var data = await FetchDataAsync();
contentListView.ItemsSource = data;
}
finally
{
IsLoading = false;
}
}<syncfusion:SfShimmer>
<syncfusion:SfShimmer.CustomLayout>
<Grid RowSpacing="10" ColumnSpacing="15">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Profile image placeholder -->
<Ellipse Grid.Row="0" Grid.RowSpan="2" Width="60" Height="60"/>
<!-- Name placeholder -->
<Rectangle Grid.Row="0" Grid.Column="1"
Height="15" RadiusX="3" RadiusY="3"
HorizontalAlignment="Left" Width="200"/>
<!-- Description placeholder -->
<Rectangle Grid.Row="1" Grid.Column="1"
Height="12" RadiusX="3" RadiusY="3"
HorizontalAlignment="Left" Width="250"/>
<!-- Content placeholder -->
<Rectangle Grid.Row="2" Grid.ColumnSpan="2"
Height="100" RadiusX="5" RadiusY="5"/>
</Grid>
</syncfusion:SfShimmer.CustomLayout>
</syncfusion:SfShimmer>| Property | Type | Default | Description |
|---|---|---|---|
| ShimmerType | CirclePersona | The built-in shimmer layout type. Options: CirclePersona, SquarePersona, Profile, Article, Video, Feed, Shopping. |
| UIElement | null | Custom layout for creating shimmer designs that match your specific content structure. |
| Brush | #F6F6F6 | Background color of the shimmer view (placeholder color). |
| Brush | White | Color of the animated wave that moves across the shimmer. |
| double | 200 | Width of the animated wave in pixels. Larger values = wider wave. |
| int | 1000 | Duration of the wave animation in milliseconds. Higher values = slower animation. |
| int | 1 | Number of times the built-in shimmer view is repeated vertically. Useful for lists. |
RepeatCount