diff --git a/Maui.DataGrid/DataGrid.xaml.cs b/Maui.DataGrid/DataGrid.xaml.cs index 17cda77..4fdf6de 100644 --- a/Maui.DataGrid/DataGrid.xaml.cs +++ b/Maui.DataGrid/DataGrid.xaml.cs @@ -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(); @@ -289,7 +289,7 @@ private void SortAndPaginate(SortData? sortData = null) }); public static readonly BindableProperty ColumnsProperty = - BindablePropertyExtensions.Create>(new(), + BindablePropertyExtensions.Create>([], propertyChanged: (b, o, n) => { if (n == o || b is not DataGrid self) @@ -741,7 +741,7 @@ public int PageSize /// /// List of page sizes /// - public List PageSizeList { get; } = new() { 5, 10, 50, 100, 200, 1000 }; + public List PageSizeList { get; } = [5, 10, 50, 100, 200, 1000]; /// /// Gets or sets whether the page size picker is visible