From e8a53a694c24912079cc43d221fa3c076c99a4d9 Mon Sep 17 00:00:00 2001 From: Edward Miller Date: Wed, 27 Dec 2023 13:55:42 -0600 Subject: [PATCH] generate comments --- Maui.DataGrid/DataGrid.xaml.cs | 66 +++++++++++++++++++++++++++++++++ Maui.DataGrid/DataGridColumn.cs | 45 ++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/Maui.DataGrid/DataGrid.xaml.cs b/Maui.DataGrid/DataGrid.xaml.cs index c166ec6..bb52c8e 100644 --- a/Maui.DataGrid/DataGrid.xaml.cs +++ b/Maui.DataGrid/DataGrid.xaml.cs @@ -442,6 +442,9 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets the page size for the DataGrid. + /// public static readonly BindableProperty PageSizeProperty = BindablePropertyExtensions.Create(100, propertyChanged: (b, o, n) => @@ -457,27 +460,51 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets a value indicating whether the page size is visible in the DataGrid. + /// public static readonly BindableProperty PageSizeVisibleProperty = BindablePropertyExtensions.Create(true); + /// + /// Gets or sets the row height for the DataGrid. + /// public static readonly BindableProperty RowHeightProperty = BindablePropertyExtensions.Create(40); + /// + /// Gets or sets the height of the footer in the DataGrid. + /// public static readonly BindableProperty FooterHeightProperty = BindablePropertyExtensions.Create(DeviceInfo.Platform == DevicePlatform.Android ? 50 : 40); + /// + /// Gets or sets the height of the header in the DataGrid. + /// public static readonly BindableProperty HeaderHeightProperty = BindablePropertyExtensions.Create(40); + /// + /// Gets or sets a value indicating whether the DataGrid is sortable. + /// public static readonly BindableProperty IsSortableProperty = BindablePropertyExtensions.Create(true); + /// + /// Gets or sets the font size for the DataGrid. + /// public static readonly BindableProperty FontSizeProperty = BindablePropertyExtensions.Create(13.0); + /// + /// Gets or sets the font family for the DataGrid. + /// public static readonly BindableProperty FontFamilyProperty = BindablePropertyExtensions.Create(Font.Default.Family); + /// + /// Gets or sets the selected item in the DataGrid. + /// public static readonly BindableProperty SelectedItemProperty = BindablePropertyExtensions.Create(null, BindingMode.TwoWay, propertyChanged: (b, _, n) => @@ -509,6 +536,9 @@ private void SortAndPaginate(SortData? sortData = null) } ); + /// + /// Gets or sets a value indicating whether pagination is enabled in the DataGrid. + /// public static readonly BindableProperty PaginationEnabledProperty = BindablePropertyExtensions.Create(false, propertyChanged: (b, o, n) => @@ -520,6 +550,9 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets a value indicating whether selection is enabled in the DataGrid. + /// public static readonly BindableProperty SelectionEnabledProperty = BindablePropertyExtensions.Create(true, propertyChanged: (b, o, n) => @@ -531,6 +564,9 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets a value indicating whether refreshing is enabled in the DataGrid. + /// public static readonly BindableProperty RefreshingEnabledProperty = BindablePropertyExtensions.Create(true, propertyChanged: (b, o, n) => @@ -542,6 +578,9 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets the command to execute when the data grid is pulled to refresh. + /// public static readonly BindableProperty PullToRefreshCommandProperty = BindablePropertyExtensions.Create( propertyChanged: (b, o, n) => @@ -562,9 +601,15 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets a value indicating whether the DataGrid is refreshing. + /// public static readonly BindableProperty IsRefreshingProperty = BindablePropertyExtensions.Create(false, BindingMode.TwoWay); + /// + /// Gets or sets the thickness of the border around the DataGrid. + /// public static readonly BindableProperty BorderThicknessProperty = BindablePropertyExtensions.Create(new Thickness(1), propertyChanged: (b, o, n) => @@ -575,11 +620,17 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets a value indicating whether the header borders are visible in the DataGrid. + /// public static readonly BindableProperty HeaderBordersVisibleProperty = BindablePropertyExtensions.Create(true, propertyChanged: (b, _, n) => ((DataGrid)b)._headerView.BackgroundColor = n ? ((DataGrid)b).BorderColor : ((DataGrid)b).HeaderBackground); + /// + /// Gets or sets the index of the sorted column in the DataGrid. + /// public static readonly BindableProperty SortedColumnIndexProperty = BindablePropertyExtensions.Create(null, BindingMode.TwoWay, (b, v) => @@ -606,6 +657,9 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets the current page number in the DataGrid. + /// public static readonly BindableProperty PageNumberProperty = BindablePropertyExtensions.Create(1, BindingMode.TwoWay, (b, v) => @@ -625,12 +679,21 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets the style for the header labels in the DataGrid. + /// public static readonly BindableProperty HeaderLabelStyleProperty = BindablePropertyExtensions.Create(); + /// + /// Gets or sets the sort icons for the DataGrid. + /// public static readonly BindableProperty SortIconProperty = BindablePropertyExtensions.Create(); + /// + /// Gets or sets the style for the sort icons in the DataGrid. + /// public static readonly BindableProperty SortIconStyleProperty = BindablePropertyExtensions.Create( propertyChanged: (b, o, n) => @@ -644,6 +707,9 @@ private void SortAndPaginate(SortData? sortData = null) } }); + /// + /// Gets or sets the view to be displayed when the DataGrid has no data. + /// public static readonly BindableProperty NoDataViewProperty = BindablePropertyExtensions.Create( propertyChanged: (b, o, n) => diff --git a/Maui.DataGrid/DataGridColumn.cs b/Maui.DataGrid/DataGridColumn.cs index 6fc6b6d..9c0a854 100644 --- a/Maui.DataGrid/DataGridColumn.cs +++ b/Maui.DataGrid/DataGridColumn.cs @@ -20,6 +20,9 @@ public sealed class DataGridColumn : BindableObject, IDefinition #endregion Fields + /// + /// Initializes a new instance of the class. + /// public DataGridColumn() { HeaderLabel = new(); @@ -35,6 +38,9 @@ public DataGridColumn() #region Events + /// + /// Occurs when the size of the column changes. + /// public event EventHandler SizeChanged { add => _sizeChangedEventManager.AddEventHandler(value); @@ -45,6 +51,9 @@ public event EventHandler SizeChanged #region Bindable Properties + /// + /// Gets or sets the width of the column. + /// public static readonly BindableProperty WidthProperty = BindablePropertyExtensions.Create(GridLength.Star, propertyChanged: (b, o, n) => @@ -56,17 +65,29 @@ public event EventHandler SizeChanged } }); + /// + /// Gets or sets the title of the column. + /// public static readonly BindableProperty TitleProperty = BindablePropertyExtensions.Create(string.Empty, propertyChanged: (b, _, n) => ((DataGridColumn)b).HeaderLabel.Text = n); + /// + /// Gets or sets the formatted title of the column. + /// public static readonly BindableProperty FormattedTitleProperty = BindablePropertyExtensions.Create( propertyChanged: (b, _, n) => ((DataGridColumn)b).HeaderLabel.FormattedText = n); + /// + /// Gets or sets the name of the property associated with the column. + /// public static readonly BindableProperty PropertyNameProperty = BindablePropertyExtensions.Create(); + /// + /// Gets or sets a value indicating whether the column is visible. + /// public static readonly BindableProperty IsVisibleProperty = BindablePropertyExtensions.Create(true, propertyChanged: (b, o, n) => @@ -85,27 +106,51 @@ public event EventHandler SizeChanged } }); + /// + /// Gets or sets the string format for the column. + /// public static readonly BindableProperty StringFormatProperty = BindablePropertyExtensions.Create(); + /// + /// Gets or sets the cell template for the column. + /// public static readonly BindableProperty CellTemplateProperty = BindablePropertyExtensions.Create(); + /// + /// Gets or sets the cell template for editing the column. + /// public static readonly BindableProperty EditCellTemplateProperty = BindablePropertyExtensions.Create(); + /// + /// Gets or sets the line break mode for the column. + /// public static readonly BindableProperty LineBreakModeProperty = BindablePropertyExtensions.Create(LineBreakMode.WordWrap); + /// + /// Gets or sets the horizontal content alignment for the column. + /// public static readonly BindableProperty HorizontalContentAlignmentProperty = BindablePropertyExtensions.Create(LayoutOptions.Center); + /// + /// Gets or sets the vertical content alignment for the column. + /// public static readonly BindableProperty VerticalContentAlignmentProperty = BindablePropertyExtensions.Create(LayoutOptions.Center); + /// + /// Gets or sets a value indicating whether sorting is enabled for the column. + /// public static readonly BindableProperty SortingEnabledProperty = BindablePropertyExtensions.Create(true); + /// + /// Gets or sets the style for the header label of the column. + /// public static readonly BindableProperty HeaderLabelStyleProperty = BindablePropertyExtensions.Create( propertyChanged: (b, o, n) =>