Browse Source
Merge pull request #2436 from MarchingCube/fix-treeview-selectionmode
Fix TreeView.SelectionModeProperty not working via styles
pull/2449/head
Steven Kirk
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
7 deletions
-
src/Avalonia.Controls/ListBox.cs
-
src/Avalonia.Controls/TreeView.cs
|
|
|
@ -30,13 +30,13 @@ namespace Avalonia.Controls |
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="SelectedItems"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly new AvaloniaProperty<IList> SelectedItemsProperty = |
|
|
|
public static readonly new DirectProperty<SelectingItemsControl, IList> SelectedItemsProperty = |
|
|
|
SelectingItemsControl.SelectedItemsProperty; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="SelectionMode"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly new AvaloniaProperty<SelectionMode> SelectionModeProperty = |
|
|
|
public static readonly new StyledProperty<SelectionMode> SelectionModeProperty = |
|
|
|
SelectingItemsControl.SelectionModeProperty; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
@ -40,17 +40,15 @@ namespace Avalonia.Controls |
|
|
|
/// Defines the <see cref="SelectedItems"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly DirectProperty<TreeView, IList> SelectedItemsProperty = |
|
|
|
AvaloniaProperty.RegisterDirect<TreeView, IList>( |
|
|
|
nameof(SelectedItems), |
|
|
|
ListBox.SelectedItemsProperty.AddOwner<TreeView>( |
|
|
|
o => o.SelectedItems, |
|
|
|
(o, v) => o.SelectedItems = v); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="SelectionMode"/> property.
|
|
|
|
/// </summary>
|
|
|
|
protected static readonly StyledProperty<SelectionMode> SelectionModeProperty = |
|
|
|
AvaloniaProperty.Register<SelectingItemsControl, SelectionMode>( |
|
|
|
nameof(SelectionMode)); |
|
|
|
public static readonly StyledProperty<SelectionMode> SelectionModeProperty = |
|
|
|
ListBox.SelectionModeProperty.AddOwner<TreeView>(); |
|
|
|
|
|
|
|
private static readonly IList Empty = new object[0]; |
|
|
|
private object _selectedItem; |
|
|
|
|