Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into net9
  • Loading branch information
Edward Miller committed Nov 20, 2024
2 parents bef1876 + 344ae22 commit 8e0ae56
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Maui.DataGrid.Sample/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
BorderColor="{StaticResource GridBorderColor}" BorderThickness="{Binding BorderThickness}"
HeaderBackground="{StaticResource GridHeaderBgColor}" HeaderBordersVisible="{Binding HeaderBordersVisible}"
BackgroundColor="{StaticResource GridBgColor}" ActiveRowColor="{StaticResource ActiveRowColor}"
FooterBackground="{StaticResource GridFooterBgColor}" SortedColumnIndex="1"
FooterBackground="{StaticResource GridFooterBgColor}" FooterTextColor="{StaticResource GridFooterTextColor}" SortedColumnIndex="1"
PaginationEnabled="{Binding PaginationEnabled}" PageSize="{Binding PageSize}" PageText="{Binding PaginationText}" PerPageText="{Binding PerPageText}"
PullToRefreshCommand="{Binding Commands[Refresh]}" IsRefreshing="{Binding IsRefreshing}"
RowHeight="70" HeaderHeight="75" x:Name="_dataGrid1"
Expand Down
1 change: 1 addition & 0 deletions Maui.DataGrid.Sample/Resources/Styles/Colors.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<Color x:Key="ActiveRowColor">#8899AA</Color>
<Color x:Key="GridHeaderBgColor">#E0E6F8</Color>
<Color x:Key="GridFooterBgColor">#E0E6F8</Color>
<Color x:Key="GridFooterTextColor">#404040</Color>
<Color x:Key="GridBorderColor">#CCCCCC</Color>
<Color x:Key="GridBgColor">#CCCCCC</Color>
</ResourceDictionary>
21 changes: 21 additions & 0 deletions Maui.DataGrid/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:Maui.DataGrid.DataGrid.FooterTextColorProperty</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:Maui.DataGrid.DataGrid.HeaderFilterStyleProperty</Target>
Expand Down Expand Up @@ -78,6 +85,13 @@
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Maui.DataGrid.DataGrid.get_FooterTextColor</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Maui.DataGrid.DataGrid.get_HeaderFilterStyle</Target>
Expand Down Expand Up @@ -106,6 +120,13 @@
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Maui.DataGrid.DataGrid.set_FooterTextColor(Microsoft.Maui.Graphics.Color)</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Maui.DataGrid.DataGrid.set_HeaderFilterStyle(Microsoft.Maui.Controls.Style)</Target>
Expand Down
8 changes: 4 additions & 4 deletions Maui.DataGrid/DataGrid.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<HorizontalStackLayout VerticalOptions="Center" IsVisible="{Binding PageSizeVisible, Source={Reference self}}">
<Label Text="{Binding PerPageText, Source={Reference self}}" Margin="5,0,0,0" VerticalTextAlignment="Center" TextColor="Black" />
<Picker ItemsSource="{Binding PageSizeList, Source={Reference self}, Mode=TwoWay}" SelectedItem="{Binding PageSize, Source={Reference self}}" TextColor="Black" MinimumWidthRequest="50" ios:Picker.UpdateMode="WhenFinished"/>
<Label Text="{Binding PerPageText, Source={Reference self}}" Margin="5,0,0,0" VerticalTextAlignment="Center" TextColor="{Binding FooterTextColor, Source={Reference self}}" />
<Picker ItemsSource="{Binding PageSizeList, Source={Reference self}, Mode=TwoWay}" SelectedItem="{Binding PageSize, Source={Reference self}}" TextColor="{Binding FooterTextColor, Source={Reference self}}" MinimumWidthRequest="50" ios:Picker.UpdateMode="WhenFinished"/>
</HorizontalStackLayout>
<HorizontalStackLayout Grid.Column="2" VerticalOptions="Center">
<Label Text="{Binding PageText, Source={Reference self}}" Margin="0,0,5,0" VerticalTextAlignment="Center" TextColor="Black" />
<Label Text="{Binding PageNumber, Source={Reference self}}" VerticalTextAlignment="Center" TextColor="Black" />
<Label Text="{Binding PageText, Source={Reference self}}" Margin="0,0,5,0" VerticalTextAlignment="Center" TextColor="{Binding FooterTextColor, Source={Reference self}}" />
<Label Text="{Binding PageNumber, Source={Reference self}}" VerticalTextAlignment="Center" TextColor="{Binding FooterTextColor, Source={Reference self}}" />
<Stepper x:Name="_paginationStepper" Value="{Binding PageNumber, Source={Reference self}}" Style="{Binding PaginationStepperStyle, Source={Reference self}}" Minimum="1" />
</HorizontalStackLayout>
</Grid>
Expand Down
16 changes: 16 additions & 0 deletions Maui.DataGrid/DataGrid.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ public partial class DataGrid
public static readonly BindableProperty FooterBackgroundProperty =
BindablePropertyExtensions.Create<DataGrid, Color>(Colors.White);

/// <summary>
/// Gets or sets the text color of the footer.
/// </summary>
public static readonly BindableProperty FooterTextColorProperty =
BindablePropertyExtensions.Create<DataGrid, Color>(Colors.Black);

/// <summary>
/// Gets or sets the color of the border.
/// </summary>
Expand Down Expand Up @@ -779,6 +785,16 @@ public Color FooterBackground
set => SetValue(FooterBackgroundProperty, value);
}

/// <summary>
/// Gets or sets textColor of the footer that contains pagination elements
/// Default value is <see cref="Colors.Black"/>.
/// </summary>
public Color FooterTextColor
{
get => (Color)GetValue(FooterTextColorProperty);
set => SetValue(FooterTextColorProperty, value);
}

/// <summary>
/// Gets or sets border color
/// Default Value is Black.
Expand Down

0 comments on commit 8e0ae56

Please sign in to comment.