Browse Source

Merge pull request #5931 from Deadpikle/patch-1

Default DataGrid SelectedIndex & SelectedItem binding mode to TwoWay
release/0.10.6
Max Katz 5 years ago
committed by Dan Walmsley
parent
commit
4e907efedd
  1. 6
      src/Avalonia.Controls.DataGrid/DataGrid.cs

6
src/Avalonia.Controls.DataGrid/DataGrid.cs

@ -535,7 +535,8 @@ namespace Avalonia.Controls
AvaloniaProperty.RegisterDirect<DataGrid, int>( AvaloniaProperty.RegisterDirect<DataGrid, int>(
nameof(SelectedIndex), nameof(SelectedIndex),
o => o.SelectedIndex, o => o.SelectedIndex,
(o, v) => o.SelectedIndex = v); (o, v) => o.SelectedIndex = v,
defaultBindingMode: BindingMode.TwoWay);
/// <summary> /// <summary>
/// Gets or sets the index of the current selection. /// Gets or sets the index of the current selection.
@ -553,7 +554,8 @@ namespace Avalonia.Controls
AvaloniaProperty.RegisterDirect<DataGrid, object>( AvaloniaProperty.RegisterDirect<DataGrid, object>(
nameof(SelectedItem), nameof(SelectedItem),
o => o.SelectedItem, o => o.SelectedItem,
(o, v) => o.SelectedItem = v); (o, v) => o.SelectedItem = v,
defaultBindingMode: BindingMode.TwoWay);
/// <summary> /// <summary>
/// Gets or sets the data item corresponding to the selected row. /// Gets or sets the data item corresponding to the selected row.

Loading…
Cancel
Save