mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-22 00:46:48 +08:00
Refactor datagrid event args
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="AtomUI.Controls.DataGrid" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Win32" Version="$(AvaloniaVersion)"/>
|
||||
|
||||
|
||||
@@ -19,5 +19,9 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Automation\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -11,7 +11,7 @@ using Avalonia.Metadata;
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a <see cref="T:Avalonia.Controls.DataGrid" /> column that can
|
||||
/// Represents a <see cref="T:AtomUI.Controls.DataGrid" /> column that can
|
||||
/// bind to a property in the grid's data source.
|
||||
/// </summary>
|
||||
public abstract class DataGridBoundColumn : DataGridColumn
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
public event EventHandler<PointerReleasedEventArgs>? HeaderPointerReleased;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridColumn" /> class.
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridColumn" /> class.
|
||||
/// </summary>
|
||||
protected internal DataGridColumn(DataGrid owningGrid)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="T:Avalonia.Controls.DataGrid"/> control that contains this column.
|
||||
/// Gets the <see cref="T:AtomUI.Controls.DataGrid"/> control that contains this column.
|
||||
/// </summary>
|
||||
protected internal DataGrid? OwningGrid { get; internal set; }
|
||||
|
||||
@@ -224,7 +224,7 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
/// dragging the column header.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// true if the user can drag the column header to a new position; otherwise, false. The default is the current <see cref="P:Avalonia.Controls.DataGrid.CanUserReorderColumns" /> property value.
|
||||
/// true if the user can drag the column header to a new position; otherwise, false. The default is the current <see cref="P:AtomUI.Controls.DataGrid.CanUserReorderColumns" /> property value.
|
||||
/// </returns>
|
||||
public bool CanUserReorder
|
||||
{
|
||||
@@ -238,7 +238,7 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
/// Gets or sets a value that indicates whether the user can adjust the column width using the mouse.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// true if the user can resize the column; false if the user cannot resize the column. The default is the current <see cref="P:Avalonia.Controls.DataGrid.CanUserResizeColumns" /> property value.
|
||||
/// true if the user can resize the column; false if the user cannot resize the column. The default is the current <see cref="P:AtomUI.Controls.DataGrid.CanUserResizeColumns" /> property value.
|
||||
/// </returns>
|
||||
public bool CanUserResize
|
||||
{
|
||||
@@ -257,7 +257,7 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
/// Gets or sets a value that indicates whether the user can sort the column by clicking the column header.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// true if the user can sort the column; false if the user cannot sort the column. The default is the current <see cref="P:Avalonia.Controls.DataGrid.CanUserSortColumns" /> property value.
|
||||
/// true if the user can sort the column; false if the user cannot sort the column. The default is the current <see cref="P:AtomUI.Controls.DataGrid.CanUserSortColumns" /> property value.
|
||||
/// </returns>
|
||||
public bool CanUserSort
|
||||
{
|
||||
@@ -291,20 +291,20 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display position of the column relative to the other columns in the <see cref="T:Avalonia.Controls.DataGrid" />.
|
||||
/// Gets or sets the display position of the column relative to the other columns in the <see cref="T:AtomUI.Controls.DataGrid" />.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The zero-based position of the column as it is displayed in the associated <see cref="T:Avalonia.Controls.DataGrid" />. The default is the index of the corresponding <see cref="P:System.Collections.ObjectModel.Collection`1.Item(System.Int32)" /> in the <see cref="P:Avalonia.Controls.DataGrid.Columns" /> collection.
|
||||
/// The zero-based position of the column as it is displayed in the associated <see cref="T:AtomUI.Controls.DataGrid" />. The default is the index of the corresponding <see cref="P:System.Collections.ObjectModel.Collection`1.Item(System.Int32)" /> in the <see cref="P:AtomUI.Controls.DataGrid.Columns" /> collection.
|
||||
/// </returns>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// When setting this property, the specified value is less than -1 or equal to <see cref="F:System.Int32.MaxValue" />.
|
||||
///
|
||||
/// -or-
|
||||
///
|
||||
/// When setting this property on a column in a <see cref="T:Avalonia.Controls.DataGrid" />, the specified value is less than zero or greater than or equal to the number of columns in the <see cref="T:Avalonia.Controls.DataGrid" />.
|
||||
/// When setting this property on a column in a <see cref="T:AtomUI.Controls.DataGrid" />, the specified value is less than zero or greater than or equal to the number of columns in the <see cref="T:AtomUI.Controls.DataGrid" />.
|
||||
/// </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">
|
||||
/// When setting this property, the <see cref="T:Avalonia.Controls.DataGrid" /> is already making <see cref="P:Avalonia.Controls.DataGridColumn.DisplayIndex" /> adjustments. For example, this exception is thrown when you attempt to set <see cref="P:Avalonia.Controls.DataGridColumn.DisplayIndex" /> in a <see cref="E:Avalonia.Controls.DataGrid.ColumnDisplayIndexChanged" /> event handler.
|
||||
/// When setting this property, the <see cref="T:AtomUI.Controls.DataGrid" /> is already making <see cref="P:AtomUI.Controls.DataGridColumn.DisplayIndex" /> adjustments. For example, this exception is thrown when you attempt to set <see cref="P:AtomUI.Controls.DataGridColumn.DisplayIndex" /> in a <see cref="E:AtomUI.Controls.DataGrid.ColumnDisplayIndexChanged" /> event handler.
|
||||
///
|
||||
/// -or-
|
||||
///
|
||||
@@ -668,7 +668,7 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When overridden in a derived class, gets an editing element that is bound to the column's <see cref="P:Avalonia.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// When overridden in a derived class, gets an editing element that is bound to the column's <see cref="P:AtomUI.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// </summary>
|
||||
/// <param name="cell">
|
||||
/// The cell that will contain the generated element.
|
||||
@@ -678,13 +678,13 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
/// </param>
|
||||
/// <param name="binding">When the method returns, contains the applied binding.</param>
|
||||
/// <returns>
|
||||
/// A new editing element that is bound to the column's <see cref="P:Avalonia.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// A new editing element that is bound to the column's <see cref="P:AtomUI.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// </returns>
|
||||
protected abstract Control? GenerateEditingElement(DataGridCell cell, object dataItem, out ICellEditBinding? binding);
|
||||
|
||||
/// <summary>
|
||||
/// When overridden in a derived class, gets a read-only element that is bound to the column's
|
||||
/// <see cref="P:Avalonia.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// <see cref="P:AtomUI.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// </summary>
|
||||
/// <param name="cell">
|
||||
/// The cell that will contain the generated element.
|
||||
@@ -693,7 +693,7 @@ public abstract class DataGridColumn : AvaloniaObject
|
||||
/// The data item represented by the row that contains the intended cell.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A new, read-only element that is bound to the column's <see cref="P:Avalonia.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// A new, read-only element that is bound to the column's <see cref="P:AtomUI.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// </returns>
|
||||
protected abstract Control? GenerateElement(DataGridCell cell, object dataItem);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ using Avalonia.Utilities;
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an individual <see cref="T:Avalonia.Controls.DataGrid" /> column header.
|
||||
/// Represents an individual <see cref="T:AtomUI.Controls.DataGrid" /> column header.
|
||||
/// </summary>
|
||||
[PseudoClasses(StdPseudoClass.DragIndicator, StdPseudoClass.Pressed, SortAscendingPC, SortDescendingPC)]
|
||||
public class DataGridColumnHeader : ContentControl
|
||||
|
||||
@@ -10,7 +10,7 @@ using Avalonia.Media;
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Used within the template of a <see cref="T:Avalonia.Controls.DataGrid" /> to specify the
|
||||
/// Used within the template of a <see cref="T:AtomUI.Controls.DataGrid" /> to specify the
|
||||
/// location in the control's visual tree where the column headers are to be added.
|
||||
/// </summary>
|
||||
public sealed class DataGridColumnHeadersPresenter : Panel, IChildIndexProvider
|
||||
|
||||
@@ -11,7 +11,7 @@ using Avalonia.Styling;
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a <see cref="T:Avalonia.Controls.DataGrid" /> column that hosts textual content in its cells.
|
||||
/// Represents a <see cref="T:AtomUI.Controls.DataGrid" /> column that hosts textual content in its cells.
|
||||
/// </summary>
|
||||
public class DataGridTextColumn : DataGridBoundColumn
|
||||
{
|
||||
@@ -19,7 +19,7 @@ public class DataGridTextColumn : DataGridBoundColumn
|
||||
private readonly Lazy<ControlTheme?> _cellTextBlockTheme;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridTextColumn" /> class.
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridTextColumn" /> class.
|
||||
/// </summary>
|
||||
public DataGridTextColumn(DataGrid ownerGrid)
|
||||
: base(ownerGrid)
|
||||
@@ -152,11 +152,11 @@ public class DataGridTextColumn : DataGridBoundColumn
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="T:Avalonia.Controls.TextBox" /> control that is bound to the column's <see cref="P:Avalonia.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// Gets a <see cref="T:Avalonia.Controls.TextBox" /> control that is bound to the column's <see cref="P:AtomUI.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// </summary>
|
||||
/// <param name="cell">The cell that will contain the generated element.</param>
|
||||
/// <param name="dataItem">The data item represented by the row that contains the intended cell.</param>
|
||||
/// <returns>A new <see cref="T:Avalonia.Controls.TextBox" /> control that is bound to the column's <see cref="P:Avalonia.Controls.DataGridBoundColumn.Binding" /> property value.</returns>
|
||||
/// <returns>A new <see cref="T:Avalonia.Controls.TextBox" /> control that is bound to the column's <see cref="P:AtomUI.Controls.DataGridBoundColumn.Binding" /> property value.</returns>
|
||||
protected override Control GenerateEditingElementDirect(DataGridCell cell, object? dataItem)
|
||||
{
|
||||
var textBox = new TextBox
|
||||
@@ -174,11 +174,11 @@ public class DataGridTextColumn : DataGridBoundColumn
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a read-only <see cref="T:Avalonia.Controls.TextBlock" /> element that is bound to the column's <see cref="P:Avalonia.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// Gets a read-only <see cref="T:Avalonia.Controls.TextBlock" /> element that is bound to the column's <see cref="P:AtomUI.Controls.DataGridBoundColumn.Binding" /> property value.
|
||||
/// </summary>
|
||||
/// <param name="cell">The cell that will contain the generated element.</param>
|
||||
/// <param name="dataItem">The data item represented by the row that contains the intended cell.</param>
|
||||
/// <returns>A new, read-only <see cref="T:Avalonia.Controls.TextBlock" /> element that is bound to the column's <see cref="P:Avalonia.Controls.DataGridBoundColumn.Binding" /> property value.</returns>
|
||||
/// <returns>A new, read-only <see cref="T:Avalonia.Controls.TextBlock" /> element that is bound to the column's <see cref="P:AtomUI.Controls.DataGridBoundColumn.Binding" /> property value.</returns>
|
||||
protected override Control GenerateElement(DataGridCell cell, object dataItem)
|
||||
{
|
||||
var textBlockElement = new TextBlock
|
||||
|
||||
@@ -3142,7 +3142,7 @@ public partial class DataGrid
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises the <see cref="E:Avalonia.Controls.DataGrid.RowDetailsVisibilityChanged" /> event.
|
||||
/// Raises the <see cref="E:AtomUI.Controls.DataGrid.RowDetailsVisibilityChanged" /> event.
|
||||
/// </summary>
|
||||
/// <param name="e">The event data.</param>
|
||||
protected internal virtual void OnRowDetailsVisibilityChanged(DataGridRowDetailsEventArgs e)
|
||||
|
||||
@@ -458,7 +458,7 @@ public partial class DataGrid : TemplatedControl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum width of columns in the <see cref="T:Avalonia.Controls.DataGrid" /> .
|
||||
/// Gets or sets the maximum width of columns in the <see cref="T:AtomUI.Controls.DataGrid" /> .
|
||||
/// </summary>
|
||||
public double MaxColumnWidth
|
||||
{
|
||||
@@ -478,7 +478,7 @@ public partial class DataGrid : TemplatedControl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum width of columns in the <see cref="T:Avalonia.Controls.DataGrid" />.
|
||||
/// Gets or sets the minimum width of columns in the <see cref="T:AtomUI.Controls.DataGrid" />.
|
||||
/// </summary>
|
||||
public double MinColumnWidth
|
||||
{
|
||||
@@ -647,7 +647,7 @@ public partial class DataGrid : TemplatedControl
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value that indicates whether columns are created
|
||||
/// automatically when the <see cref="P:Avalonia.Controls.DataGrid.ItemsSource" /> property is set.
|
||||
/// automatically when the <see cref="P:AtomUI.Controls.DataGrid.ItemsSource" /> property is set.
|
||||
/// </summary>
|
||||
public bool AutoGenerateColumns
|
||||
{
|
||||
@@ -769,7 +769,7 @@ public partial class DataGrid : TemplatedControl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGrid" /> class.
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGrid" /> class.
|
||||
/// </summary>
|
||||
public DataGrid()
|
||||
{
|
||||
@@ -1279,8 +1279,8 @@ public partial class DataGrid : TemplatedControl
|
||||
|
||||
/// <summary>
|
||||
/// Occurs one time for each public, non-static property in the bound data type when the
|
||||
/// <see cref="P:Avalonia.Controls.DataGrid.ItemsSource" /> property is changed and the
|
||||
/// <see cref="P:Avalonia.Controls.DataGrid.AutoGenerateColumns" /> property is true.
|
||||
/// <see cref="P:AtomUI.Controls.DataGrid.ItemsSource" /> property is changed and the
|
||||
/// <see cref="P:AtomUI.Controls.DataGrid.AutoGenerateColumns" /> property is true.
|
||||
/// </summary>
|
||||
public event EventHandler<DataGridAutoGeneratingColumnEventArgs>? AutoGeneratingColumn;
|
||||
|
||||
@@ -1305,7 +1305,7 @@ public partial class DataGrid : TemplatedControl
|
||||
public event EventHandler<DataGridCellPointerPressedEventArgs>? CellPointerPressed;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the <see cref="P:Avalonia.Controls.DataGridColumn.DisplayIndex" />
|
||||
/// Occurs when the <see cref="P:AtomUI.Controls.DataGridColumn.DisplayIndex" />
|
||||
/// property of a column changes.
|
||||
/// </summary>
|
||||
public event EventHandler<DataGridColumnEventArgs>? ColumnDisplayIndexChanged;
|
||||
@@ -1328,13 +1328,13 @@ public partial class DataGrid : TemplatedControl
|
||||
public event EventHandler<EventArgs>? CurrentCellChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs after a <see cref="T:Avalonia.Controls.DataGridRow" />
|
||||
/// Occurs after a <see cref="T:AtomUI.Controls.DataGridRow" />
|
||||
/// is instantiated, so that you can customize it before it is used.
|
||||
/// </summary>
|
||||
public event EventHandler<DataGridRowEventArgs>? LoadingRow;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a cell in a <see cref="T:Avalonia.Controls.DataGridTemplateColumn" /> enters editing mode.
|
||||
/// Occurs when a cell in a <see cref="T:AtomUI.Controls.DataGridTemplateColumn" /> enters editing mode.
|
||||
///
|
||||
/// </summary>
|
||||
public event EventHandler<DataGridPreparingCellForEditEventArgs>? PreparingCellForEdit;
|
||||
@@ -1353,8 +1353,8 @@ public partial class DataGrid : TemplatedControl
|
||||
RoutedEvent.Register<DataGrid, SelectionChangedEventArgs>(nameof(SelectionChanged), RoutingStrategies.Bubble);
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the <see cref="P:Avalonia.Controls.DataGrid.SelectedItem" /> or
|
||||
/// <see cref="P:Avalonia.Controls.DataGrid.SelectedItems" /> property value changes.
|
||||
/// Occurs when the <see cref="P:AtomUI.Controls.DataGrid.SelectedItem" /> or
|
||||
/// <see cref="P:AtomUI.Controls.DataGrid.SelectedItems" /> property value changes.
|
||||
/// </summary>
|
||||
public event EventHandler<SelectionChangedEventArgs>? SelectionChanged
|
||||
{
|
||||
@@ -1368,7 +1368,7 @@ public partial class DataGrid : TemplatedControl
|
||||
public event EventHandler<DataGridColumnEventArgs>? Sorting;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a <see cref="T:Avalonia.Controls.DataGridRow" />
|
||||
/// Occurs when a <see cref="T:AtomUI.Controls.DataGridRow" />
|
||||
/// object becomes available for reuse.
|
||||
/// </summary>
|
||||
public event EventHandler<DataGridRowEventArgs>? UnloadingRow;
|
||||
@@ -1380,7 +1380,7 @@ public partial class DataGrid : TemplatedControl
|
||||
public event EventHandler<DataGridRowDetailsEventArgs>? LoadingRowDetails;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the <see cref="P:Avalonia.Controls.DataGrid.RowDetailsVisibilityMode" />
|
||||
/// Occurs when the <see cref="P:AtomUI.Controls.DataGrid.RowDetailsVisibilityMode" />
|
||||
/// property value changes.
|
||||
/// </summary>
|
||||
public event EventHandler<DataGridRowDetailsEventArgs>? RowDetailsVisibilityChanged;
|
||||
@@ -2003,13 +2003,13 @@ public partial class DataGrid : TemplatedControl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Arranges the content of the <see cref="T:Avalonia.Controls.DataGridRow" />.
|
||||
/// Arranges the content of the <see cref="T:AtomUI.Controls.DataGridRow" />.
|
||||
/// </summary>
|
||||
/// <param name="finalSize">
|
||||
/// The final area within the parent that this element should use to arrange itself and its children.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The actual size used by the <see cref="T:Avalonia.Controls.DataGridRow" />.
|
||||
/// The actual size used by the <see cref="T:AtomUI.Controls.DataGridRow" />.
|
||||
/// </returns>
|
||||
protected override Size ArrangeOverride(Size finalSize)
|
||||
{
|
||||
@@ -2029,12 +2029,12 @@ public partial class DataGrid : TemplatedControl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Measures the children of a <see cref="T:Avalonia.Controls.DataGridRow" /> to prepare for
|
||||
/// Measures the children of a <see cref="T:AtomUI.Controls.DataGridRow" /> to prepare for
|
||||
/// arranging them during the
|
||||
/// <see cref="M:Avalonia.Controls.DataGridRow.ArrangeOverride(System.Windows.Size)" /> pass.
|
||||
/// <see cref="M:AtomUI.Controls.DataGridRow.ArrangeOverride(System.Windows.Size)" /> pass.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The size that the <see cref="T:Avalonia.Controls.DataGridRow" /> determines it needs during layout, based on its calculations of child object allocated sizes.
|
||||
/// The size that the <see cref="T:AtomUI.Controls.DataGridRow" /> determines it needs during layout, based on its calculations of child object allocated sizes.
|
||||
/// </returns>
|
||||
/// <param name="availableSize">
|
||||
/// The available size that this element can give to child elements. Indicates an upper limit that
|
||||
|
||||
@@ -13,7 +13,7 @@ public enum DataGridLengthUnitType
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the lengths of elements within the <see cref="T:Avalonia.Controls.DataGrid" /> control.
|
||||
/// Represents the lengths of elements within the <see cref="T:AtomUI.Controls.DataGrid" /> control.
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(DataGridError.DataGridLengthConverter))]
|
||||
public struct DataGridLength : IEquatable<DataGridLength>
|
||||
@@ -37,7 +37,7 @@ public struct DataGridLength : IEquatable<DataGridLength>
|
||||
internal const double DefaultValue = 1.0;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridLength" /> class.
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridLength" /> class.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public DataGridLength(double value)
|
||||
@@ -136,10 +136,10 @@ public struct DataGridLength : IEquatable<DataGridLength>
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="T:Avalonia.Controls.DataGridLength" /> structure that represents the standard automatic sizing mode.
|
||||
/// Gets a <see cref="T:AtomUI.Controls.DataGridLength" /> structure that represents the standard automatic sizing mode.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="T:Avalonia.Controls.DataGridLength" /> structure that represents the standard automatic sizing mode.
|
||||
/// A <see cref="T:AtomUI.Controls.DataGridLength" /> structure that represents the standard automatic sizing mode.
|
||||
/// </returns>
|
||||
public static DataGridLength Auto => _auto;
|
||||
|
||||
@@ -182,31 +182,31 @@ public struct DataGridLength : IEquatable<DataGridLength>
|
||||
public bool IsStar => _unitType == DataGridLengthUnitType.Star;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="T:Avalonia.Controls.DataGridLength" /> structure that represents the cell-based automatic sizing mode.
|
||||
/// Gets a <see cref="T:AtomUI.Controls.DataGridLength" /> structure that represents the cell-based automatic sizing mode.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="T:Avalonia.Controls.DataGridLength" /> structure that represents the cell-based automatic sizing mode.
|
||||
/// A <see cref="T:AtomUI.Controls.DataGridLength" /> structure that represents the cell-based automatic sizing mode.
|
||||
/// </returns>
|
||||
public static DataGridLength SizeToCells => _sizeToCells;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="T:Avalonia.Controls.DataGridLength" /> structure that represents the header-based automatic sizing mode.
|
||||
/// Gets a <see cref="T:AtomUI.Controls.DataGridLength" /> structure that represents the header-based automatic sizing mode.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="T:Avalonia.Controls.DataGridLength" /> structure that represents the header-based automatic sizing mode.
|
||||
/// A <see cref="T:AtomUI.Controls.DataGridLength" /> structure that represents the header-based automatic sizing mode.
|
||||
/// </returns>
|
||||
public static DataGridLength SizeToHeader => _sizeToHeader;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="T:Avalonia.Controls.DataGridLengthUnitType" /> that represents the current sizing mode.
|
||||
/// Gets the <see cref="T:AtomUI.Controls.DataGridLengthUnitType" /> that represents the current sizing mode.
|
||||
/// </summary>
|
||||
public DataGridLengthUnitType UnitType => _unitType;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the absolute value of the <see cref="T:Avalonia.Controls.DataGridLength" /> in pixels.
|
||||
/// Gets the absolute value of the <see cref="T:AtomUI.Controls.DataGridLength" /> in pixels.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The absolute value of the <see cref="T:Avalonia.Controls.DataGridLength" /> in pixels.
|
||||
/// The absolute value of the <see cref="T:AtomUI.Controls.DataGridLength" /> in pixels.
|
||||
/// </returns>
|
||||
public double Value => _unitValue;
|
||||
|
||||
|
||||
@@ -1,439 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:Avalonia.Controls.DataGrid.AutoGeneratingColumn" /> event.
|
||||
/// </summary>
|
||||
public class DataGridAutoGeneratingColumnEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridAutoGeneratingColumnEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">
|
||||
/// The name of the property bound to the generated column.
|
||||
/// </param>
|
||||
/// <param name="propertyType">
|
||||
/// The <see cref="T:System.Type" /> of the property bound to the generated column.
|
||||
/// </param>
|
||||
/// <param name="column">
|
||||
/// The generated column.
|
||||
/// </param>
|
||||
public DataGridAutoGeneratingColumnEventArgs(string propertyName, Type propertyType, DataGridColumn column)
|
||||
{
|
||||
Column = column;
|
||||
PropertyName = propertyName;
|
||||
PropertyType = propertyType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the generated column.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the property bound to the generated column.
|
||||
/// </summary>
|
||||
public string PropertyName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="T:System.Type" /> of the property bound to the generated column.
|
||||
/// </summary>
|
||||
public Type PropertyType { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:Avalonia.Controls.DataGrid.BeginningEdit" /> event.
|
||||
/// </summary>
|
||||
public class DataGridBeginningEditEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the
|
||||
/// <see cref="T:Avalonia.Controls.DataGridBeginningEditEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="column">
|
||||
/// The column that contains the cell to be edited.
|
||||
/// </param>
|
||||
/// <param name="row">
|
||||
/// The row that contains the cell to be edited.
|
||||
/// </param>
|
||||
/// <param name="editingEventArgs">
|
||||
/// Information about the user gesture that caused the cell to enter edit mode.
|
||||
/// </param>
|
||||
public DataGridBeginningEditEventArgs(DataGridColumn column,
|
||||
DataGridRow row,
|
||||
RoutedEventArgs? editingEventArgs)
|
||||
{
|
||||
Column = column;
|
||||
Row = row;
|
||||
EditingEventArgs = editingEventArgs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the column that contains the cell to be edited.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets information about the user gesture that caused the cell to enter edit mode.
|
||||
/// </summary>
|
||||
public RoutedEventArgs? EditingEventArgs { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row that contains the cell to be edited.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides information just after a cell has exited editing mode.
|
||||
/// </summary>
|
||||
public class DataGridCellEditEndedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="column">The column of the cell that has just exited edit mode.</param>
|
||||
/// <param name="row">The row container of the cell container that has just exited edit mode.</param>
|
||||
/// <param name="editAction">The editing action that has been taken.</param>
|
||||
public DataGridCellEditEndedEventArgs(DataGridColumn column, DataGridRow row, DataGridEditAction editAction)
|
||||
{
|
||||
Column = column;
|
||||
Row = row;
|
||||
EditAction = editAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The column of the cell that has just exited edit mode.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The edit action taken when leaving edit mode.
|
||||
/// </summary>
|
||||
public DataGridEditAction EditAction { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell container that has just exited edit mode.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides information after the cell has been pressed.
|
||||
/// </summary>
|
||||
public class DataGridCellPointerPressedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="cell">The cell that has been pressed.</param>
|
||||
/// <param name="row">The row container of the cell that has been pressed.</param>
|
||||
/// <param name="column">The column of the cell that has been pressed.</param>
|
||||
/// <param name="e">The pointer action that has been taken.</param>
|
||||
public DataGridCellPointerPressedEventArgs(DataGridCell cell,
|
||||
DataGridRow row,
|
||||
DataGridColumn column,
|
||||
PointerPressedEventArgs e)
|
||||
{
|
||||
Cell = cell;
|
||||
Row = row;
|
||||
Column = column;
|
||||
PointerPressedEventArgs = e;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The cell that has been pressed.
|
||||
/// </summary>
|
||||
public DataGridCell Cell { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell that has been pressed.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The column of the cell that has been pressed.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The pointer action that has been taken.
|
||||
/// </summary>
|
||||
public PointerPressedEventArgs PointerPressedEventArgs { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides information just before a cell exits editing mode.
|
||||
/// </summary>
|
||||
public class DataGridCellEditEndingEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="column">The column of the cell that is about to exit edit mode.</param>
|
||||
/// <param name="row">The row container of the cell container that is about to exit edit mode.</param>
|
||||
/// <param name="editingElement">The editing element within the cell.</param>
|
||||
/// <param name="editAction">The editing action that will be taken.</param>
|
||||
public DataGridCellEditEndingEventArgs(DataGridColumn column,
|
||||
DataGridRow row,
|
||||
Control editingElement,
|
||||
DataGridEditAction editAction)
|
||||
{
|
||||
Column = column;
|
||||
Row = row;
|
||||
EditingElement = editingElement;
|
||||
EditAction = editAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The column of the cell that is about to exit edit mode.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The edit action to take when leaving edit mode.
|
||||
/// </summary>
|
||||
public DataGridEditAction EditAction { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The editing element within the cell.
|
||||
/// </summary>
|
||||
public Control EditingElement { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell container that is about to exit edit mode.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
|
||||
internal class DataGridCellEventArgs : EventArgs
|
||||
{
|
||||
internal DataGridCellEventArgs(DataGridCell dataGridCell)
|
||||
{
|
||||
Debug.Assert(dataGridCell != null);
|
||||
this.Cell = dataGridCell;
|
||||
}
|
||||
|
||||
internal DataGridCell Cell { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for <see cref="T:Avalonia.Controls.DataGrid" /> column-related events.
|
||||
/// </summary>
|
||||
public class DataGridColumnEventArgs : HandledEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridColumnEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="column">The column that the event occurs for.</param>
|
||||
public DataGridColumnEventArgs(DataGridColumn column)
|
||||
{
|
||||
Column = column ?? throw new ArgumentNullException(nameof(column));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the column that the event occurs for.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:Avalonia.Controls.DataGrid.ColumnReordering" /> event.
|
||||
/// </summary>
|
||||
public class DataGridColumnReorderingEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridColumnReorderingEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="dataGridColumn"></param>
|
||||
public DataGridColumnReorderingEventArgs(DataGridColumn dataGridColumn)
|
||||
{
|
||||
Column = dataGridColumn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The column being moved.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The popup indicator displayed while dragging. If null and Handled = true, then do not display a tooltip.
|
||||
/// </summary>
|
||||
public Control? DragIndicator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UIElement to display at the insertion position. If null and Handled = true, then do not display an insertion indicator.
|
||||
/// </summary>
|
||||
public Control? DropLocationIndicator { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for <see cref="T:Avalonia.Controls.DataGrid" /> row-related events.
|
||||
/// </summary>
|
||||
public class DataGridRowEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridRowEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="dataGridRow">The row that the event occurs for.</param>
|
||||
public DataGridRowEventArgs(DataGridRow dataGridRow)
|
||||
{
|
||||
this.Row = dataGridRow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row that the event occurs for.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides information just before a row exits editing mode.
|
||||
/// </summary>
|
||||
public class DataGridRowEditEndingEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="row">The row container of the cell container that is about to exit edit mode.</param>
|
||||
/// <param name="editAction">The editing action that will be taken.</param>
|
||||
public DataGridRowEditEndingEventArgs(DataGridRow row, DataGridEditAction editAction)
|
||||
{
|
||||
this.Row = row;
|
||||
this.EditAction = editAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The editing action that will be taken.
|
||||
/// </summary>
|
||||
public DataGridEditAction EditAction { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell container that is about to exit edit mode.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides information just after a row has exited edit mode.
|
||||
/// </summary>
|
||||
public class DataGridRowEditEndedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="row">The row container of the cell container that has just exited edit mode.</param>
|
||||
/// <param name="editAction">The editing action that has been taken.</param>
|
||||
public DataGridRowEditEndedEventArgs(DataGridRow row, DataGridEditAction editAction)
|
||||
{
|
||||
Row = row;
|
||||
EditAction = editAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The editing action that has been taken.
|
||||
/// </summary>
|
||||
public DataGridEditAction EditAction { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell container that has just exited edit mode.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:Avalonia.Controls.DataGrid.PreparingCellForEdit" /> event.
|
||||
/// </summary>
|
||||
public class DataGridPreparingCellForEditEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridPreparingCellForEditEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="column">The column that contains the cell to be edited.</param>
|
||||
/// <param name="row">The row that contains the cell to be edited.</param>
|
||||
/// <param name="editingEventArgs">Information about the user gesture that caused the cell to enter edit mode.</param>
|
||||
/// <param name="editingElement">The element that the column displays for a cell in editing mode.</param>
|
||||
public DataGridPreparingCellForEditEventArgs(DataGridColumn column,
|
||||
DataGridRow row,
|
||||
RoutedEventArgs editingEventArgs,
|
||||
Control editingElement)
|
||||
{
|
||||
Column = column;
|
||||
Row = row;
|
||||
EditingEventArgs = editingEventArgs;
|
||||
EditingElement = editingElement;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the column that contains the cell to be edited.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the element that the column displays for a cell in editing mode.
|
||||
/// </summary>
|
||||
public Control EditingElement { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets information about the user gesture that caused the cell to enter edit mode.
|
||||
/// </summary>
|
||||
public RoutedEventArgs EditingEventArgs { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row that contains the cell to be edited.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// EventArgs used for the DataGrid's LoadingRowGroup and UnloadingRowGroup events
|
||||
/// </summary>
|
||||
public class DataGridRowGroupHeaderEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructs a DataGridRowGroupHeaderEventArgs instance
|
||||
/// </summary>
|
||||
/// <param name="rowGroupHeader"></param>
|
||||
public DataGridRowGroupHeaderEventArgs(DataGridRowGroupHeader rowGroupHeader)
|
||||
{
|
||||
RowGroupHeader = rowGroupHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DataGridRowGroupHeader associated with this instance
|
||||
/// </summary>
|
||||
public DataGridRowGroupHeader RowGroupHeader { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:Avalonia.Controls.DataGrid.LoadingRowDetails" />, <see cref="E:Avalonia.Controls.DataGrid.UnloadingRowDetails" />,
|
||||
/// and <see cref="E:Avalonia.Controls.DataGrid.RowDetailsVisibilityChanged" /> events.
|
||||
/// </summary>
|
||||
public class DataGridRowDetailsEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridRowDetailsEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="row">The row that the event occurs for.</param>
|
||||
/// <param name="detailsElement">The row details section as a framework element.</param>
|
||||
public DataGridRowDetailsEventArgs(DataGridRow row, Control detailsElement)
|
||||
{
|
||||
Row = row;
|
||||
DetailsElement = detailsElement;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row details section as a framework element.
|
||||
/// </summary>
|
||||
public Control DetailsElement { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row that the event occurs for.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:AtomUI.Controls.DataGrid.AutoGeneratingColumn" /> event.
|
||||
/// </summary>
|
||||
public class DataGridAutoGeneratingColumnEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridAutoGeneratingColumnEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">
|
||||
/// The name of the property bound to the generated column.
|
||||
/// </param>
|
||||
/// <param name="propertyType">
|
||||
/// The <see cref="T:System.Type" /> of the property bound to the generated column.
|
||||
/// </param>
|
||||
/// <param name="column">
|
||||
/// The generated column.
|
||||
/// </param>
|
||||
public DataGridAutoGeneratingColumnEventArgs(string propertyName, Type propertyType, DataGridColumn column)
|
||||
{
|
||||
Column = column;
|
||||
PropertyName = propertyName;
|
||||
PropertyType = propertyType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the generated column.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the property bound to the generated column.
|
||||
/// </summary>
|
||||
public string PropertyName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="T:System.Type" /> of the property bound to the generated column.
|
||||
/// </summary>
|
||||
public Type PropertyType { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System.ComponentModel;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:AtomUI.Controls.DataGrid.BeginningEdit" /> event.
|
||||
/// </summary>
|
||||
public class DataGridBeginningEditEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the
|
||||
/// <see cref="T:AtomUI.Controls.DataGridBeginningEditEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="column">
|
||||
/// The column that contains the cell to be edited.
|
||||
/// </param>
|
||||
/// <param name="row">
|
||||
/// The row that contains the cell to be edited.
|
||||
/// </param>
|
||||
/// <param name="editingEventArgs">
|
||||
/// Information about the user gesture that caused the cell to enter edit mode.
|
||||
/// </param>
|
||||
public DataGridBeginningEditEventArgs(DataGridColumn column,
|
||||
DataGridRow row,
|
||||
RoutedEventArgs? editingEventArgs)
|
||||
{
|
||||
Column = column;
|
||||
Row = row;
|
||||
EditingEventArgs = editingEventArgs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the column that contains the cell to be edited.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets information about the user gesture that caused the cell to enter edit mode.
|
||||
/// </summary>
|
||||
public RoutedEventArgs? EditingEventArgs { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row that contains the cell to be edited.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides information just after a cell has exited editing mode.
|
||||
/// </summary>
|
||||
public class DataGridCellEditEndedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="column">The column of the cell that has just exited edit mode.</param>
|
||||
/// <param name="row">The row container of the cell container that has just exited edit mode.</param>
|
||||
/// <param name="editAction">The editing action that has been taken.</param>
|
||||
public DataGridCellEditEndedEventArgs(DataGridColumn column, DataGridRow row, DataGridEditAction editAction)
|
||||
{
|
||||
Column = column;
|
||||
Row = row;
|
||||
EditAction = editAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The column of the cell that has just exited edit mode.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The edit action taken when leaving edit mode.
|
||||
/// </summary>
|
||||
public DataGridEditAction EditAction { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell container that has just exited edit mode.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.ComponentModel;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides information just before a cell exits editing mode.
|
||||
/// </summary>
|
||||
public class DataGridCellEditEndingEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="column">The column of the cell that is about to exit edit mode.</param>
|
||||
/// <param name="row">The row container of the cell container that is about to exit edit mode.</param>
|
||||
/// <param name="editingElement">The editing element within the cell.</param>
|
||||
/// <param name="editAction">The editing action that will be taken.</param>
|
||||
public DataGridCellEditEndingEventArgs(DataGridColumn column,
|
||||
DataGridRow row,
|
||||
Control editingElement,
|
||||
DataGridEditAction editAction)
|
||||
{
|
||||
Column = column;
|
||||
Row = row;
|
||||
EditingElement = editingElement;
|
||||
EditAction = editAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The column of the cell that is about to exit edit mode.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The edit action to take when leaving edit mode.
|
||||
/// </summary>
|
||||
public DataGridEditAction EditAction { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The editing element within the cell.
|
||||
/// </summary>
|
||||
public Control EditingElement { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell container that is about to exit edit mode.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
internal class DataGridCellEventArgs : EventArgs
|
||||
{
|
||||
internal DataGridCellEventArgs(DataGridCell dataGridCell)
|
||||
{
|
||||
Debug.Assert(dataGridCell != null);
|
||||
Cell = dataGridCell;
|
||||
}
|
||||
|
||||
internal DataGridCell Cell { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using Avalonia.Input;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides information after the cell has been pressed.
|
||||
/// </summary>
|
||||
public class DataGridCellPointerPressedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="cell">The cell that has been pressed.</param>
|
||||
/// <param name="row">The row container of the cell that has been pressed.</param>
|
||||
/// <param name="column">The column of the cell that has been pressed.</param>
|
||||
/// <param name="e">The pointer action that has been taken.</param>
|
||||
public DataGridCellPointerPressedEventArgs(DataGridCell cell,
|
||||
DataGridRow row,
|
||||
DataGridColumn column,
|
||||
PointerPressedEventArgs e)
|
||||
{
|
||||
Cell = cell;
|
||||
Row = row;
|
||||
Column = column;
|
||||
PointerPressedEventArgs = e;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The cell that has been pressed.
|
||||
/// </summary>
|
||||
public DataGridCell Cell { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell that has been pressed.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The column of the cell that has been pressed.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The pointer action that has been taken.
|
||||
/// </summary>
|
||||
public PointerPressedEventArgs PointerPressedEventArgs { get; }
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for <see cref="T:AtomUI.Controls.DataGrid" /> column-related events.
|
||||
/// </summary>
|
||||
public class DataGridColumnEventArgs : HandledEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridColumnEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="column">The column that the event occurs for.</param>
|
||||
public DataGridColumnEventArgs(DataGridColumn column)
|
||||
{
|
||||
Column = column ?? throw new ArgumentNullException(nameof(column));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the column that the event occurs for.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:AtomUI.Controls.DataGrid.ColumnReordering" /> event.
|
||||
/// </summary>
|
||||
public class DataGridColumnReorderingEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridColumnReorderingEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="dataGridColumn"></param>
|
||||
public DataGridColumnReorderingEventArgs(DataGridColumn dataGridColumn)
|
||||
{
|
||||
Column = dataGridColumn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The column being moved.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The popup indicator displayed while dragging. If null and Handled = true, then do not display a tooltip.
|
||||
/// </summary>
|
||||
public Control? DragIndicator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UIElement to display at the insertion position. If null and Handled = true, then do not display an insertion indicator.
|
||||
/// </summary>
|
||||
public Control? DropLocationIndicator { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:AtomUI.Controls.DataGrid.PreparingCellForEdit" /> event.
|
||||
/// </summary>
|
||||
public class DataGridPreparingCellForEditEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridPreparingCellForEditEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="column">The column that contains the cell to be edited.</param>
|
||||
/// <param name="row">The row that contains the cell to be edited.</param>
|
||||
/// <param name="editingEventArgs">Information about the user gesture that caused the cell to enter edit mode.</param>
|
||||
/// <param name="editingElement">The element that the column displays for a cell in editing mode.</param>
|
||||
public DataGridPreparingCellForEditEventArgs(DataGridColumn column,
|
||||
DataGridRow row,
|
||||
RoutedEventArgs editingEventArgs,
|
||||
Control editingElement)
|
||||
{
|
||||
Column = column;
|
||||
Row = row;
|
||||
EditingEventArgs = editingEventArgs;
|
||||
EditingElement = editingElement;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the column that contains the cell to be edited.
|
||||
/// </summary>
|
||||
public DataGridColumn Column { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the element that the column displays for a cell in editing mode.
|
||||
/// </summary>
|
||||
public Control EditingElement { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets information about the user gesture that caused the cell to enter edit mode.
|
||||
/// </summary>
|
||||
public RoutedEventArgs EditingEventArgs { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row that contains the cell to be edited.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for the <see cref="E:AtomUI.Controls.DataGrid.LoadingRowDetails" />, <see cref="E:AtomUI.Controls.DataGrid.UnloadingRowDetails" />,
|
||||
/// and <see cref="E:AtomUI.Controls.DataGrid.RowDetailsVisibilityChanged" /> events.
|
||||
/// </summary>
|
||||
public class DataGridRowDetailsEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridRowDetailsEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="row">The row that the event occurs for.</param>
|
||||
/// <param name="detailsElement">The row details section as a framework element.</param>
|
||||
public DataGridRowDetailsEventArgs(DataGridRow row, Control detailsElement)
|
||||
{
|
||||
Row = row;
|
||||
DetailsElement = detailsElement;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row details section as a framework element.
|
||||
/// </summary>
|
||||
public Control DetailsElement { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row that the event occurs for.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides information just after a row has exited edit mode.
|
||||
/// </summary>
|
||||
public class DataGridRowEditEndedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="row">The row container of the cell container that has just exited edit mode.</param>
|
||||
/// <param name="editAction">The editing action that has been taken.</param>
|
||||
public DataGridRowEditEndedEventArgs(DataGridRow row, DataGridEditAction editAction)
|
||||
{
|
||||
Row = row;
|
||||
EditAction = editAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The editing action that has been taken.
|
||||
/// </summary>
|
||||
public DataGridEditAction EditAction { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell container that has just exited edit mode.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides information just before a row exits editing mode.
|
||||
/// </summary>
|
||||
public class DataGridRowEditEndingEventArgs : CancelEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new instance of this class.
|
||||
/// </summary>
|
||||
/// <param name="row">The row container of the cell container that is about to exit edit mode.</param>
|
||||
/// <param name="editAction">The editing action that will be taken.</param>
|
||||
public DataGridRowEditEndingEventArgs(DataGridRow row, DataGridEditAction editAction)
|
||||
{
|
||||
this.Row = row;
|
||||
this.EditAction = editAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The editing action that will be taken.
|
||||
/// </summary>
|
||||
public DataGridEditAction EditAction { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row container of the cell container that is about to exit edit mode.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for <see cref="T:AtomUI.Controls.DataGrid" /> row-related events.
|
||||
/// </summary>
|
||||
public class DataGridRowEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridRowEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="dataGridRow">The row that the event occurs for.</param>
|
||||
public DataGridRowEventArgs(DataGridRow dataGridRow)
|
||||
{
|
||||
this.Row = dataGridRow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row that the event occurs for.
|
||||
/// </summary>
|
||||
public DataGridRow Row { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// EventArgs used for the DataGrid's LoadingRowGroup and UnloadingRowGroup events
|
||||
/// </summary>
|
||||
public class DataGridRowGroupHeaderEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructs a DataGridRowGroupHeaderEventArgs instance
|
||||
/// </summary>
|
||||
/// <param name="rowGroupHeader"></param>
|
||||
public DataGridRowGroupHeaderEventArgs(DataGridRowGroupHeader rowGroupHeader)
|
||||
{
|
||||
RowGroupHeader = rowGroupHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DataGridRowGroupHeader associated with this instance
|
||||
/// </summary>
|
||||
public DataGridRowGroupHeader RowGroupHeader { get; private set; }
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using Avalonia.Media;
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Used within the template of a <see cref="T:Avalonia.Controls.DataGrid" /> to specify the location in the control's visual tree
|
||||
/// Used within the template of a <see cref="T:AtomUI.Controls.DataGrid" /> to specify the location in the control's visual tree
|
||||
/// where the row details are to be added.
|
||||
/// </summary>
|
||||
public sealed class DataGridDetailsPresenter : Panel
|
||||
|
||||
@@ -146,7 +146,7 @@ public class DataGridRow : TemplatedControl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:Avalonia.Controls.DataGridRow" /> class.
|
||||
/// Initializes a new instance of the <see cref="T:AtomUI.Controls.DataGridRow" /> class.
|
||||
/// </summary>
|
||||
public DataGridRow()
|
||||
{
|
||||
@@ -417,10 +417,10 @@ public class DataGridRow : TemplatedControl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Arranges the content of the <see cref="T:Avalonia.Controls.DataGridRow" />.
|
||||
/// Arranges the content of the <see cref="T:AtomUI.Controls.DataGridRow" />.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The actual size used by the <see cref="T:Avalonia.Controls.DataGridRow" />.
|
||||
/// The actual size used by the <see cref="T:AtomUI.Controls.DataGridRow" />.
|
||||
/// </returns>
|
||||
/// <param name="finalSize">
|
||||
/// The final area within the parent that this element should use to arrange itself and its children.
|
||||
@@ -474,7 +474,7 @@ public class DataGridRow : TemplatedControl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Measures the children of a <see cref="T:Avalonia.Controls.DataGridRow" /> to
|
||||
/// Measures the children of a <see cref="T:AtomUI.Controls.DataGridRow" /> to
|
||||
/// prepare for arranging them during the <see cref="M:System.Windows.FrameworkElement.ArrangeOverride(System.Windows.Size)" /> pass.
|
||||
/// </summary>
|
||||
/// <param name="availableSize">
|
||||
|
||||
@@ -64,7 +64,7 @@ public class DataGridRowGroupHeader : TemplatedControl
|
||||
AvaloniaProperty.Register<DataGridRowGroupHeader, string?>(nameof(PropertyName));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the property that this <see cref="T:Avalonia.Controls.DataGrid" /> row is bound to.
|
||||
/// Gets or sets the name of the property that this <see cref="T:AtomUI.Controls.DataGrid" /> row is bound to.
|
||||
/// </summary>
|
||||
public string? PropertyName
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ using Avalonia.Media;
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an individual <see cref="T:Avalonia.Controls.DataGrid" /> row header.
|
||||
/// Represents an individual <see cref="T:AtomUI.Controls.DataGrid" /> row header.
|
||||
/// </summary>
|
||||
[TemplatePart(ElementRootNamePC, typeof(Control))]
|
||||
[PseudoClasses(StdPseudoClass.Invalid, StdPseudoClass.Selected, StdPseudoClass.Editing, StdPseudoClass.Current)]
|
||||
|
||||
@@ -10,7 +10,7 @@ using Avalonia.Utilities;
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Used within the template of a <see cref="T:Avalonia.Controls.DataGrid" /> to specify the
|
||||
/// Used within the template of a <see cref="T:AtomUI.Controls.DataGrid" /> to specify the
|
||||
/// location in the control's visual tree where the rows are to be added.
|
||||
/// </summary>
|
||||
public sealed class DataGridRowsPresenter : Panel, IChildIndexProvider
|
||||
|
||||
@@ -4,7 +4,7 @@ using Avalonia.Controls;
|
||||
namespace AtomUI.Controls.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a non-scrollable grid that contains <see cref="T:Avalonia.Controls.DataGrid" /> row headers.
|
||||
/// Represents a non-scrollable grid that contains <see cref="T:AtomUI.Controls.DataGrid" /> row headers.
|
||||
/// </summary>
|
||||
public class DataGridFrozenGrid : Grid
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user