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.
<ContentPagexmlns:shimmer="clr-namespace:Syncfusion.XForms.Shimmer;assembly=Syncfusion.Core.XForms"><shimmer:SfShimmerx:Name="shimmer"VerticalOptions="Fill"IsActive="{Binding IsActive}"><StackLayout><LabelText="Content is loaded!"HorizontalOptions="CenterAndExpand"VerticalOptions="CenterAndExpand"/></StackLayout></shimmer:SfShimmer></ContentPage>
usingSyncfusion.SfShimmer.XForms;...SfShimmershimmer=newSfShimmer();this.Content=shimmer;shimmer.VerticalOptions=LayoutOptions.Fill;shimmer.SetBinding(SfShimmer.IsActiveProperty,"IsActive");varstackLayout=newStackLayout();varlabel=newLabel();label.Text="Content is loaded!";label.HorizontalOptions=LayoutOptions.CenterAndExpand;label.VerticalOptions=LayoutOptions.CenterAndExpand;stackLayout.Children.Add(label);shimmer.Content=stackLayout;
<ContentPagexmlns:shimmer="clr-namespace:Syncfusion.Maui.Shimmer;assembly=Syncfusion.Maui.Core"><shimmer:SfShimmerx:Name="Shimmer"VerticalOptions="FillAndExpand"><StackLayout><LabelText="Content is loaded!!"HorizontalOptions="CenterAndExpand"VerticalOptions="CenterAndExpand"></Label></StackLayout></shimmer:SfShimmer></ContentPage>
usingSyncfusion.Maui.Shimmer;...SfShimmershimmer=newSfShimmer();this.Content=shimmer;shimmer.VerticalOptions=LayoutOptions.FillAndExpand;varstackLayout=newStackLayout();varlabel=newLabel();label.Text="Content is loaded!";label.HorizontalOptions=LayoutOptions.Fill;label.VerticalOptions=LayoutOptions.Fill;stackLayout.Children.Add(label);