Migrate from Xamarin.Forms SfShimmer to .NET MAUI SfShimmer

To make the migration from the Xamarin SfShimmer to .NET MAUI SfShimmer easier, most of the APIs from the Xamarin SfShimmer were kept in the .NET MAUI SfShimmer. However, to maintain the consistency of API naming in the .NET MAUI SfShimmer, some of the APIs have been renamed. Please find the difference in the following topics.

Namespaces

Xamarin SfShimmer .NET MAUI SfShimmer
Syncfusion.XForms.Shimmer Syncfusion.Maui.Shimmer

Initialize control

To initialize the control, import the shimmer namespace and initialize SfShimmer as shown in the following code sample.

Xamarin SfShimmer .NET MAUI SfShimmer
<ContentPage
xmlns:shimmer="clr-namespace:Syncfusion.XForms.Shimmer;assembly=Syncfusion.Core.XForms">

    <shimmer:SfShimmer />

</ContentPage>
using Syncfusion.XForms.Shimmer;
...

SfShimmer shimmer = new SfShimmer();
this.Content = shimmer;
<ContentPage
xmlns:shimmer="clr-namespace:Syncfusion.Maui.Shimmer;assembly=Syncfusion.Maui.Core">

    <shimmer:SfShimmer />

</ContentPage>
using Syncfusion.Maui.Shimmer;
...

SfShimmer shimmer = new SfShimmer();
this.Content = shimmer;

Classes

Xamarin SfShimmer .NET MAUI SfShimmer Description

ShimmerView

ShimmerView

Represents a view used to achieve shimmer custom view.

Properties

SfShimmer

The following code example, explains how to initialize the properties of the Xamarin SfShimmer and .NET MAUI SfShimmer class.

Xamarin SfShimmer .NET MAUI SfShimmer
<ContentPage
xmlns:shimmer="clr-namespace:Syncfusion.XForms.Shimmer;assembly=Syncfusion.Core.XForms">
    
<shimmer:SfShimmer x:Name="shimmer" VerticalOptions="Fill"
                           IsActive="{Binding IsActive}">
                            <StackLayout>
                                <Label Text="Content is loaded!" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"/>
                            </StackLayout>
</shimmer:SfShimmer>

</ContentPage>
using Syncfusion.SfShimmer.XForms;
...

SfShimmer shimmer = new SfShimmer();
this.Content = shimmer;
shimmer.VerticalOptions = LayoutOptions.Fill;
shimmer.SetBinding(SfShimmer.IsActiveProperty, "IsActive");

var stackLayout = new StackLayout();

var label = new Label();
label.Text = "Content is loaded!";
label.HorizontalOptions = LayoutOptions.CenterAndExpand;
label.VerticalOptions = LayoutOptions.CenterAndExpand;

stackLayout.Children.Add(label);
shimmer.Content = stackLayout;
<ContentPage
xmlns:shimmer="clr-namespace:Syncfusion.Maui.Shimmer;assembly=Syncfusion.Maui.Core">

<shimmer:SfShimmer x:Name="Shimmer" VerticalOptions="FillAndExpand">
   <StackLayout>
      <Label 
         Text="Content is loaded!!"
         HorizontalOptions="CenterAndExpand"
         VerticalOptions="CenterAndExpand">
      </Label>
   </StackLayout>
</shimmer:SfShimmer>
</ContentPage>
using Syncfusion.Maui.Shimmer;
...

SfShimmer shimmer = new SfShimmer();
this.Content = shimmer;
shimmer.VerticalOptions = LayoutOptions.FillAndExpand;
var stackLayout = new StackLayout();
var label = new Label();
label.Text = "Content is loaded!";
label.HorizontalOptions = LayoutOptions.Fill;
label.VerticalOptions = LayoutOptions.Fill;

stackLayout.Children.Add(label);
Xamarin SfShimmer .NET MAUI SfShimmer Description

Content

Nil Not Supported.

CustomView

CustomView

Gets or sets the custom view that is used for loading view in the Shimmer.

WaveDirection

WaveDirection

Gets or sets the animation direction for Shimmer.

Type

Type

Gets or sets the built-in shimmer view type.

Color

Fill

Gets or sets the background color of shimmer view.

WaveColor

WaveColor

Gets or sets the shimmer wave color.

WaveWidth

WaveWidth

Gets or sets the width of the shimmer wave.

AnimationDuration

AnimationDuration

Gets or sets the duration of the wave animation in milliseconds.

IsActive

IsActive

Gets or sets a value indicating whether to load actual content of shimmer.
Nil

RepeatCount

Gets or sets the number of times the built-in view should be repeated.

ShimmerView

Xamarin SfShimmer .NET MAUI SfShimmer Description

BackgroundColor

Nil Not Supported.

CornerRadius

Nil Not Supported.
Nil

ShapeType

Gets or sets the shape for the shimmer view.

Enums

Xamarin SfShimmer .NET MAUI SfShimmer Description

WaveDirection

ShimmerWaveDirection

Defines the wave direction for the Shimmer.

ShimmerTypes

ShimmerType

Defines the type of the Shimmer.
Nil

ShimmerShapeType

Defines the shape for the Shimmer view.