akgulebubekir / Maui.DataGrid

DataGrid component for Maui
MIT License
241 stars 47 forks source link

Color of the next page button abnormal #189

Open rokorec31 opened 2 months ago

rokorec31 commented 2 months ago

Describe the bug I tried setting PaginationEnabled=true, and the color of next button became black.

To Reproduce Steps to reproduce the behavior:

  1. You can reproduce it using the code I provided.

Expected behavior Do not override the button color.

Screenshots Screenshot 2024-06-20 104614

Desktop (please complete the following information):

Xaml code

<dg:DataGrid Grid.Row="0"
             ItemsSource="{Binding Offices}"
             IsRefreshing="{Binding IsListRefreshing}"
             PullToRefreshCommand="{Binding RefreshOfficesCommand}"
             RefreshingEnabled="True"
             SelectionMode="Single"
             SortingEnabled="True"
             PaginationEnabled="True"
             HeaderBordersVisible="False"
             SelectedItem="{Binding SelectedOffice}"
             RowTappedCommand="{Binding SelectOfficeChangedCommand}"
             HeaderBackground="Transparent"
             FooterBackground="Transparent"
             ActiveRowColor="White"
             BorderColor="Transparent"
             BorderThickness="0"
             HeaderHeight="32"
             RowHeight="64"
             HeaderLabelStyle="{StaticResource GridHeaderLabelStyle}">
    <dg:DataGrid.Columns>
        <dg:DataGridColumn Title=""
                           PropertyName="."
                           SortingEnabled="False"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           Width="100">
            <dg:DataGridColumn.CellTemplate>
                <DataTemplate>
                    <StackLayout Padding="4">
                        <ff:CachedImage Source="{Binding FullUrl}"
                                        ErrorPlaceholder="img_default.png"
                                        LoadingPlaceholder="img_default.png"
                                        Aspect="AspectFit"
                                        HorizontalOptions="CenterAndExpand"
                                        VerticalOptions="CenterAndExpand" />
                    </StackLayout>
                </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
        </dg:DataGridColumn>

        <dg:DataGridColumn Title="Name"
                           PropertyName="Name"
                           SortingEnabled="True"
                           HorizontalContentAlignment="Start"
                           VerticalContentAlignment="Center"
                           Width="{OnIdiom 200, Phone=140}">
            <dg:DataGridColumn.CellTemplate>
                <DataTemplate>
                    <Label Style="{StaticResource LabelStyleBody1}"
                           Text="{Binding}"
                           TextColor="{StaticResource Greyscale700}"
                           VerticalTextAlignment="Center"
                           LineBreakMode="MiddleTruncation" />
                </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
        </dg:DataGridColumn>

        <dg:DataGridColumn Title="Total Devices"
                           PropertyName="Docks"
                           SortingEnabled="True"
                           HorizontalContentAlignment="Start"
                           VerticalContentAlignment="Center"
                           Width="{OnIdiom 160, Phone=110}">
            <dg:DataGridColumn.CellTemplate>
                <DataTemplate>
                    <Label Style="{StaticResource LabelStyleBody1}"
                           Text="{Binding Count, FallbackValue='-'}"
                           TextColor="{StaticResource Greyscale700}"
                           VerticalTextAlignment="Center"
                           LineBreakMode="MiddleTruncation" />
                </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
        </dg:DataGridColumn>

        <dg:DataGridColumn Title="Unassigned Devices"
                           PropertyName="UnassignedDevices"
                           SortingEnabled="True"
                           HorizontalContentAlignment="Start"
                           VerticalContentAlignment="Center"
                           IsVisible="{OnIdiom True, Phone=False}"
                           Width="160">
            <dg:DataGridColumn.CellTemplate>
                <DataTemplate>
                    <Label Style="{StaticResource LabelStyleBody1}"
                           Text="{Binding Count, FallbackValue='-'}"
                           TextColor="{StaticResource Greyscale700}"
                           VerticalTextAlignment="Center"
                           LineBreakMode="MiddleTruncation" />
                </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
        </dg:DataGridColumn>
    </dg:DataGrid.Columns>

    <dg:DataGrid.RowsBackgroundColorPalette>
        <dg:PaletteCollection>
            <Color>White</Color>
        </dg:PaletteCollection>
    </dg:DataGrid.RowsBackgroundColorPalette>
</dg:DataGrid>
symbiogenesis commented 1 month ago

The upstream MAUI stepper control we use isn't super great. We do expose PaginationStepperStyle which gives access to whatever limited styling options are available for the stepper.

Anything else would be an upstream limitation or bug.

If we moved away from that control it may help, at the cost of some added complexity. But the overall ethos of this library thus far is to basically just use the default MAUI cross-platform controls, and not reinvent any wheels.

PRs welcome.