Skip to content

Commit

Permalink
use new collection initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Dec 22, 2023
1 parent e41b223 commit f9bf46e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Maui.DataGrid/DataGrid.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public partial class DataGrid
{
#region Fields

private static readonly ColumnDefinitionCollection HeaderColumnDefinitions = new()
{
private static readonly ColumnDefinitionCollection HeaderColumnDefinitions =
[
new() { Width = new(1, GridUnitType.Star) },
new() { Width = new(1, GridUnitType.Auto) }
};
];

private readonly WeakEventManager _itemSelectedEventManager = new();
private readonly WeakEventManager _refreshingEventManager = new();
Expand Down Expand Up @@ -289,7 +289,7 @@ private void SortAndPaginate(SortData? sortData = null)
});

public static readonly BindableProperty ColumnsProperty =
BindablePropertyExtensions.Create<DataGrid, ObservableCollection<DataGridColumn>>(new(),
BindablePropertyExtensions.Create<DataGrid, ObservableCollection<DataGridColumn>>([],
propertyChanged: (b, o, n) =>
{
if (n == o || b is not DataGrid self)
Expand Down Expand Up @@ -741,7 +741,7 @@ public int PageSize
/// <summary>
/// List of page sizes
/// </summary>
public List<int> PageSizeList { get; } = new() { 5, 10, 50, 100, 200, 1000 };
public List<int> PageSizeList { get; } = [5, 10, 50, 100, 200, 1000];

/// <summary>
/// Gets or sets whether the page size picker is visible
Expand Down

0 comments on commit f9bf46e

Please sign in to comment.