Skip to content

Skeleton.BackgroundColor not working #23

@Vladovi

Description

@Vladovi

Hi, for some reason it does not work for me Skeleton.BackgroundColor, problem with element label,
below is my code, please point out my mistakes.

Xaml:
`

       <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <Grid Padding="0, 5"> 
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="5*"/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="2*"/>
                        </Grid.ColumnDefinitions>
                       <imageRender:ImageRender Source="{Binding Image, Converter= {StaticResource Key=ByteArrayConverter}}"
                                                 WidthRequest="40"
                                                 HeightRequest="40"
                                                 HorizontalOptions="CenterAndExpand"
                                                 VerticalOptions="CenterAndExpand"
                                                 Aspect="AspectFill"
                                                 BackgroundColor="Black"
                                                 skeleton:Skeleton.IsBusy="{Binding IsBusy}"
                                                 skeleton:Skeleton.BackgroundColor="Black">
                        </imageRender:ImageRender>

                        
                        <Label FontSize="Large"
                               Grid.Column="1"
                               VerticalOptions="Center"
                               Margin="5"
                               Visual="Material"
                               skeleton:Skeleton.IsBusy="{Binding IsBusy}"
                           skeleton:Skeleton.BackgroundColor="Black">
                            <Label.FormattedText>
                                <FormattedString>
                                    <Span Text="{Binding Model1.Text}">
                                        <Span.GestureRecognizers>
                                            <TapGestureRecognizer Command="{Binding BindingContext.NavigateToProfileCommand,
                                                                            Source={x:Reference Name=list}}"
                                                                    CommandParameter="{Binding Command}"
                                                                    NumberOfTapsRequired="1"/>
                                        </Span.GestureRecognizers>
                                    </Span>
                                </FormattedString>
                            </Label.FormattedText>
                        </Label>
                       .........................
                     </Grid>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>`

ViewModel:

void Skeleton()
        {
            Model = new ObservableCollection<Model>();
            IsBusy = true;
            var model1 = new Model1()
            {
                Text = "xxxxxxxxxx",
                Image = null
            };
            var model = new Model()
            {
                Image = null,
                Model1 = model1
                
            };
            for (int i = 0; i < 5; i++)
            {
                Model.Add(model);
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions