RadekVyM / SimpleToolkit

SimpleToolkit is a .NET MAUI library of helpers and simple, fully customizable controls, such as SimpleShell - custom Shell implementation that allows you to create unique navigation experiences.
MIT License
435 stars 44 forks source link

Using Styles from App.xaml on ListView breaks view #61

Open Perry89 opened 4 days ago

Perry89 commented 4 days ago

Hi, I've been using your shell for some time and I've noticed issue with views. I have 2 pages that contain similar listviews, recently I have changed one of them to use styles from app.xaml, and noticed that if you have a lot of items in your ListView and start to scroll them, the view breaks leaving just blank spaces. They are still interactivable, so it is pure display issue.

Here is xaml:

<ListView SelectedItem="{Binding SelectedTimesheet}" HasUnevenRows="True" HorizontalOptions="CenterAndExpand" BackgroundColor="{StaticResource Faded}" ItemsSource="{Binding WholeDayTimesheets}">
            <ListView.ItemTemplate>
                <DataTemplate x:DataType="models:WholeDayTimesheetViewModel">
                <ViewCell>
                    <Border Style="{StaticResource MainFormGridBorderStyle}">
                    <Grid Style="{StaticResource TimesheetGrid}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Label Style="{StaticResource TimesheetDayLabel}" Text="{Binding DayOfTheWeek}" Grid.Column="0" Grid.Row="0" />
                        <Label Style="{StaticResource TimesheetLabelPrimary}" Grid.Column="1" Grid.Row="0" Text="{Binding Date}" />
                        <StackLayout Orientation="Horizontal" HorizontalOptions="Start" Grid.Column="0" Grid.Row="1">
                            <Image Source="clock_white" HeightRequest="15" WidthRequest="15" />
                            <Label Style="{StaticResource TimesheetLabelPrimaryMargin}" Text="{Binding StartAndEndTimeLabel}" />
                        </StackLayout>
                        <Label Style="{StaticResource TimesheetLabelBold}" Text="Appointments" Grid.Column="1" Grid.Row="1"  />
                        <StackLayout Orientation="Horizontal" Grid.Column="0" Grid.Row="2">
                            <Label Style="{StaticResource TimesheetLabelBold}" Text="Value Total" />
                            <Label Style="{StaticResource TimesheetLabelPrimaryMargin}" Text="{Binding ValueTotal}" />
                        </StackLayout >

                        <StackLayout Orientation="Horizontal" HorizontalOptions="Start" Grid.Row="2" Grid.Column="1">
                            <Image Source="abacus_white" HeightRequest="15" WidthRequest="15" />
                            <Label Style="{StaticResource TimesheetLabelPrimaryMargin}" Text="{Binding AppointmentsCount}" />
                        </StackLayout>
                        <StackLayout Orientation="Horizontal" Grid.Column="0" Grid.Row="3">
                            <Label Style="{StaticResource TimesheetLabelBold}" Text="Hours Total" />
                            <Label Style="{StaticResource TimesheetLabelPrimaryMargin}" Text="{Binding TotalHours}" />  
                        </StackLayout>
                        <StackLayout Orientation="Horizontal" Grid.Column="1" Grid.Row="3">
                            <Label Style="{StaticResource TimesheetLabelBold}" Text="Day Hours Total" />
                            <Label Style="{StaticResource TimesheetLabelPrimaryMargin}" Text="{Binding HoursCount}" />
                        </StackLayout>
                        <StackLayout Orientation="Horizontal" Grid.Column="1" Grid.Row="4">
                            <Label Style="{StaticResource TimesheetLabelBold}" Text="Narrative" />
                            <Label Style="{StaticResource TimesheetLabelPrimaryMargin}" Text="{Binding Narrative}" /> 
                        </StackLayout>
                    </Grid> 
                    </Border>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

Please bear in mind that reverting the changes to don't use styles fixes the issue.