Skip to content

Commit

Permalink
set styles to default when set to null
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Nov 13, 2024
1 parent 07ef524 commit 1b048ba
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Maui.DataGrid/DataGrid.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,14 @@ public partial class DataGrid
{
foreach (var column in self.Columns)
{
column.SortingIcon.Style = n;
if (n is null)
{
column.SortingIcon.Style = self.DefaultSortIconStyle;
}
else
{
column.SortingIcon.Style = n;
}
}
}
});
Expand Down
24 changes: 22 additions & 2 deletions Maui.DataGrid/DataGridColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,17 @@ public sealed class DataGridColumn : BindableObject, IDefinition
{
if (b is DataGridColumn self && self.HeaderLabel != null)
{
self.HeaderLabel.Style = n;
if (n is null)
{
if (self.DataGrid is not null)
{
self.HeaderLabel.Style = self.DataGrid.DefaultHeaderLabelStyle;
}
}
else
{
self.HeaderLabel.Style = n;
}
}
});

Expand All @@ -180,7 +190,17 @@ public sealed class DataGridColumn : BindableObject, IDefinition
{
if (b is DataGridColumn self)
{
self.FilterTextbox.Style = n;
if (n is null)
{
if (self.DataGrid is not null)
{
self.FilterTextbox.Style = self.DataGrid.DefaultHeaderFilterStyle;
}
}
else
{
self.FilterTextbox.Style = n;
}
}
});

Expand Down

0 comments on commit 1b048ba

Please sign in to comment.