HorusSoftwareUY / Xamarin.Forms.Skeleton

The new loading approach for cool apps in Xamarin Forms
MIT License
450 stars 52 forks source link

{Binding Source={x:Reference this}, Path=IsBusy} Doesn't work #35

Open georgeemr opened 4 months ago

georgeemr commented 4 months ago

If I try to use a global IsBusy for example on a CollectionView there's no effect. To make it work I need to add a IsBusy variable for each item. Is this on purpose? Or is there a way to make it work?

<CollectionView HeightRequest="110"
                HorizontalScrollBarVisibility="Never"
                ItemsSource="{Binding Source={x:Reference this}, Path=ItemsSource}">
    <CollectionView.ItemTemplate>
        <DataTemplate x:DataType="model:ItemRound">
            <Grid RowDefinitions="Auto,Auto,*"
                  Margin="5,0,0,0">
                <Border Padding="0"
                        WidthRequest="70"
                        HeightRequest="70"
                        StrokeShape="RoundRectangle 100"
                        Stroke="Transparent"
                        StrokeThickness="1"
                        BackgroundColor="{StaticResource ColorOnDarkBackground}"
                        VerticalOptions="Start"
                        HorizontalOptions="Start"
                        sk:Skeleton.IsBusy="{Binding Source={x:Reference this}, Path=IsBusy}"
                        sk:Skeleton.BackgroundColor="{StaticResource ShimmerColor}"
                        sk:Skeleton.Animation="{sk:DefaultAnimation Fade}">
                    <Image Source="{Binding Image}"
                           Aspect="AspectFill"
                           sk:Skeleton.Hide="True"
                           sk:Skeleton.IsBusy="{Binding Source={x:Reference this}, Path=IsBusy}">
                    </Image>
                </Border>               
            </Grid>
        </DataTemplate>
    </CollectionView.ItemTemplate>   
</CollectionView>