I have implemented the Skeleton plugin in my xamarin.form app. It's working fine in my listview page. Then I try it in my listView item detail, the animation and skeleton backgroundColor doesn't work. The function working fine and no error in my build.
This is what I've tried:
<ScrollView BackgroundColor="White">
<StackLayout
Margin="15"
extension:Skeleton.IsParent="True"
extension:Skeleton.IsBusy="{Binding IsLoadBusy}"
extension:Skeleton.BackgroundColor="{StaticResource GrayColor}"
extension:Skeleton.Animation="Fade"
extension:Skeleton.AnimationInterval="600">
<Image
x:Name="ImgSelfie"
HeightRequest="200" WidthRequest="200" BackgroundColor="White"
Source="selfie"
extension:Skeleton.IsBusy="{Binding IsLoadBusy}"
extension:Skeleton.Animation="Fade"
extension:Skeleton.BackgroundColor="{StaticResource DarkGrayColor}"/>
<Label Text="Location :" FontAttributes="Bold"/>
<Editor
Text="{Binding Attend.AddressDetail}" x:Name="EdtLocation" IsEnabled="False" AutoSize="TextChanges"
extension:Skeleton.IsBusy="{Binding IsLoadBusy}"
extension:Skeleton.Animation="Fade"
extension:Skeleton.BackgroundColor="{StaticResource DarkGrayColor}"/>
<Label Text="Time :" FontAttributes="Bold"/>
<Entry
Text="{Binding Attend.Created}" x:Name="EntTime" IsEnabled="False"
extension:Skeleton.IsBusy="{Binding IsLoadBusy}"
extension:Skeleton.Animation="Fade"
extension:Skeleton.BackgroundColor="{StaticResource DarkGrayColor}" />
<Label Text="Action :" FontAttributes="Bold"/>
<Label
Text="{Binding Attend.Activity}" x:Name="LblAction" FontSize="Medium" TextColor="Black"
extension:Skeleton.IsBusy="{Binding IsLoadBusy}"
extension:Skeleton.Animation="Fade"
extension:Skeleton.BackgroundColor="{StaticResource DarkGrayColor}"/>
<Label Text="Noted :" FontAttributes="Bold"/>
<Editor
Text="{Binding Attend.Note}" x:Name="EntNote" IsEnabled="False" AutoSize="TextChanges"
extension:Skeleton.IsBusy="{Binding IsLoadBusy}"
extension:Skeleton.Animation="Fade"
extension:Skeleton.BackgroundColor="{StaticResource DarkGrayColor}"/>
<StackLayout VerticalOptions="EndAndExpand">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<material:MaterialButton
mvx:Bi.nd="Command OnCancelButtonCommand" Text="Confirm"
ButtonType="Outlined" BorderColor="Black" BackgroundColor="White"
TextColor="Black" PressedBackgroundColor="Gray" BorderWidth="2" WidthRequest="25" Padding="15"/>
</Grid>
</StackLayout>
</StackLayout>
</ScrollView>
and the view model :
public async Task PerformShimmerAsyncTask(string id)
{
this.Attend = new Attendance
{
//Image = null,
AddressDetail = "x",
Created = DateTime.Now,
Activity = "x",
Note = "x"
};
this.IsLoadBusy = true;
await Task.Delay(2500);
this.IsLoadBusy = false;
//await GetItem(id);
this.Attend = new Attendance
{
//Image = "selfie.png",
AddressDetail = "asdasdasda",
Created = DateTime.Now,
Activity = "sadasdasdasfacf",
Note = "asuuusfasfa"
};
}
following based on this example.
Please help and correct if my question is not yet clear.
I use your code and it works well on my side, I can show you my sample project.
And the code in
Xaml
is same as yours. You should make sure that you have set the rightbindingContext
and callPerformShimmerAsyncTask
correctly.I uploaded my sample project here. Let me know if it works for you.