HorusSoftwareUY / Xamarin.Forms.Skeleton

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

It doesn't work on NEW Path Control #18

Open codebreakerlegend2019 opened 4 years ago

codebreakerlegend2019 commented 4 years ago

Here's my sample code.

    <CollectionView
                x:Name="PlacesCollectionView"
                sk:Skeleton.Animation="{sk:DefaultAnimation Fade}"
                sk:Skeleton.IsBusy="{Binding IsPlaceStillLoading}"
                sk:Skeleton.IsParent="True"
                ItemSizingStrategy="MeasureAllItems"
                ItemsSource="{Binding Places}">
                <CollectionView.ItemsLayout>
                    <LinearItemsLayout
                        ItemSpacing="5"
                        Orientation="Horizontal"
                        SnapPointsType="MandatorySingle" />
                </CollectionView.ItemsLayout>
                <CollectionView.EmptyView>
                    <StackLayout>
                        <Label
                            FontFamily="{StaticResource RobotoCondensed}"
                            FontSize="Subtitle"
                            HorizontalOptions="CenterAndExpand"
                            IsVisible="{Binding IsPlacesLoaded}"
                            TextColor="{AppThemeBinding Dark={StaticResource Dark_TitleTextColor},
                                                        Light={StaticResource Light_TitleTextColor}}"
                            VerticalOptions="CenterAndExpand">
                            <Label.Text>
                                <MultiBinding StringFormat="No {0} Found In {1}">
                                    <Binding Path="SelectedCategory.Name" />
                                    <Binding Path="SelectedCity.Name" />
                                </MultiBinding>
                            </Label.Text>
                        </Label>
                    </StackLayout>
                </CollectionView.EmptyView>
                <CollectionView.ItemTemplate>
                    <DataTemplate>
                        <StackLayout>
                            <Grid
                                ColumnDefinitions="Auto"
                                RowDefinitions="Auto,Auto,Auto"
                                Style="{StaticResource CollectionViewItemGrid}">
                                <Path
                                    Grid.Row="0"
                                    Margin="0,0,0,0"
                                    Aspect="Fill"
                                    Data="M3.6000366,0L28.400024,0C30.400024,0,32,1.6000366,32,3.6000366L32,28.400024C32,30.400024,30.400024,32,28.400024,32L3.6000366,32C1.6000366,32,0,30.400024,0,28.400024L0,3.6000366C0,1.6000366,1.6000366,0,3.6000366,0z"
                                    Fill="{AppThemeBinding Dark={StaticResource Dark_FrameBackgroundColor},
                                                           Light={StaticResource Light_FrameBackgroundColor}}"
                                    HeightRequest="275"
                                    Stroke="{AppThemeBinding Dark={StaticResource Dark_TitleTextColor},
                                                             Light={StaticResource Light_TitleTextColor}}"
                                    WidthRequest="350" />
                                <StackLayout Grid.Row="0" Padding="10">
                                    <forms:CachedImage
                                        Aspect="AspectFill"
                                        BitmapOptimizations="False"
                                        DownsampleToViewSize="True"
                                        ErrorPlaceholder="ic_defaultavatar.png"
                                        HeightRequest="150"
                                        HorizontalOptions="Center"
                                        LoadingDelay="0"
                                        LoadingPlaceholder="ic_imageloader.gif"
                                        RetryCount="3"
                                        RetryDelay="0"
                                        Source="{Binding ImageUrl}"
                                        VerticalOptions="Center"
                                        WidthRequest="150">
                                        <forms:CachedImage.Transformations>
                                            <ffTransformations:RoundedTransformation
                                                BorderHexColor="#FFFFFF"
                                                BorderSize="10"
                                                Radius="240" />
                                        </forms:CachedImage.Transformations>
                                    </forms:CachedImage>
                                    <Label
                                        Style="{StaticResource PlaceText}"
                                        Text="{Binding Name}"
                                        WidthRequest="250" />
                                </StackLayout>
                                <ImageButton
                                    Padding="10,10,10,0"
                                    BackgroundColor="Transparent"
                                    BorderWidth="5"
                                    Command="{Binding BindingContext.LikeUnlikeCommand, Source={x:Reference PlacesCollectionView}}"
                                    CommandParameter="{Binding .}"
                                    HorizontalOptions="End"
                                    VerticalOptions="Start"
                                    Visual="Material">
                                    <ImageButton.Source>
                                        <FontImageSource
                                            FontFamily="{DynamicResource MaterialFontFamily}"
                                            Glyph="{x:Static material:MaterialFonts.Heart}"
                                            Size="50"
                                            Color="{Binding LikedColor}" />
                                    </ImageButton.Source>

                                </ImageButton>
                                <ImageButton
                                    Padding="10,10,10,0"
                                    BackgroundColor="Transparent"
                                    BorderWidth="5"
                                    Command="{Binding BindingContext.NavigateDestinationCommand, Source={x:Reference PlacesCollectionView}}"
                                    CommandParameter="{Binding .}"
                                    HorizontalOptions="Start"
                                    VerticalOptions="Start"
                                    Visual="Material">
                                    <ImageButton.Source>
                                        <FontImageSource
                                            FontFamily="{DynamicResource MaterialFontFamily}"
                                            Glyph="{x:Static material:MaterialFonts.Map}"
                                            Size="50"
                                            Color="{AppThemeBinding Dark={StaticResource Dark_TitleTextColor},
                                                                    Light={StaticResource Light_TitleTextColor}}" />
                                    </ImageButton.Source>

                                </ImageButton>
                            </Grid>
                        </StackLayout>

                    </DataTemplate>
                </CollectionView.ItemTemplate>
            </CollectionView>

Expected: Output it will mimic the Actual Look of my Collection View Items using Path.

Output: Displays nothing while loading.