Browse Source

Use ListBox properties for TreeView implementation.

pull/2436/head
Dariusz Komosinski 8 years ago
parent
commit
cf1401e5f2
  1. 4
      src/Avalonia.Controls/ListBox.cs
  2. 6
      src/Avalonia.Controls/TreeView.cs

4
src/Avalonia.Controls/ListBox.cs

@ -30,13 +30,13 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Defines the <see cref="SelectedItems"/> property. /// Defines the <see cref="SelectedItems"/> property.
/// </summary> /// </summary>
public static readonly new AvaloniaProperty<IList> SelectedItemsProperty = public static readonly new DirectProperty<SelectingItemsControl, IList> SelectedItemsProperty =
SelectingItemsControl.SelectedItemsProperty; SelectingItemsControl.SelectedItemsProperty;
/// <summary> /// <summary>
/// Defines the <see cref="SelectionMode"/> property. /// Defines the <see cref="SelectionMode"/> property.
/// </summary> /// </summary>
public static readonly new AvaloniaProperty<SelectionMode> SelectionModeProperty = public static readonly new StyledProperty<SelectionMode> SelectionModeProperty =
SelectingItemsControl.SelectionModeProperty; SelectingItemsControl.SelectionModeProperty;
/// <summary> /// <summary>

6
src/Avalonia.Controls/TreeView.cs

@ -40,8 +40,7 @@ namespace Avalonia.Controls
/// Defines the <see cref="SelectedItems"/> property. /// Defines the <see cref="SelectedItems"/> property.
/// </summary> /// </summary>
public static readonly DirectProperty<TreeView, IList> SelectedItemsProperty = public static readonly DirectProperty<TreeView, IList> SelectedItemsProperty =
AvaloniaProperty.RegisterDirect<TreeView, IList>( ListBox.SelectedItemsProperty.AddOwner<TreeView>(
nameof(SelectedItems),
o => o.SelectedItems, o => o.SelectedItems,
(o, v) => o.SelectedItems = v); (o, v) => o.SelectedItems = v);
@ -49,8 +48,7 @@ namespace Avalonia.Controls
/// Defines the <see cref="SelectionMode"/> property. /// Defines the <see cref="SelectionMode"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<SelectionMode> SelectionModeProperty = public static readonly StyledProperty<SelectionMode> SelectionModeProperty =
AvaloniaProperty.Register<TreeView, SelectionMode>( ListBox.SelectionModeProperty.AddOwner<TreeView>();
nameof(SelectionMode));
private static readonly IList Empty = new object[0]; private static readonly IList Empty = new object[0];
private object _selectedItem; private object _selectedItem;

Loading…
Cancel
Save