|
|
@ -36,6 +36,12 @@ namespace Avalonia.Controls |
|
|
public static readonly DirectProperty<ItemsControl, IEnumerable> ItemsProperty = |
|
|
public static readonly DirectProperty<ItemsControl, IEnumerable> ItemsProperty = |
|
|
AvaloniaProperty.RegisterDirect<ItemsControl, IEnumerable>(nameof(Items), o => o.Items, (o, v) => o.Items = v); |
|
|
AvaloniaProperty.RegisterDirect<ItemsControl, IEnumerable>(nameof(Items), o => o.Items, (o, v) => o.Items = v); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the <see cref="ItemCount"/> property.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static readonly DirectProperty<ItemsControl, int> ItemCountProperty = |
|
|
|
|
|
AvaloniaProperty.RegisterDirect<ItemsControl, int>(nameof(ItemCount), o => o.ItemCount); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Defines the <see cref="ItemsPanel"/> property.
|
|
|
/// Defines the <see cref="ItemsPanel"/> property.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
@ -55,6 +61,7 @@ namespace Avalonia.Controls |
|
|
AvaloniaProperty.Register<ItemsControl, IMemberSelector>(nameof(MemberSelector)); |
|
|
AvaloniaProperty.Register<ItemsControl, IMemberSelector>(nameof(MemberSelector)); |
|
|
|
|
|
|
|
|
private IEnumerable _items = new AvaloniaList<object>(); |
|
|
private IEnumerable _items = new AvaloniaList<object>(); |
|
|
|
|
|
private int _itemCount; |
|
|
private IItemContainerGenerator _itemContainerGenerator; |
|
|
private IItemContainerGenerator _itemContainerGenerator; |
|
|
private IDisposable _itemsCollectionChangedSubscription; |
|
|
private IDisposable _itemsCollectionChangedSubscription; |
|
|
|
|
|
|
|
|
@ -110,10 +117,13 @@ namespace Avalonia.Controls |
|
|
set { SetAndRaise(ItemsProperty, ref _items, value); } |
|
|
set { SetAndRaise(ItemsProperty, ref _items, value); } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the number of items in <see cref="Items"/>.
|
|
|
|
|
|
/// </summary>
|
|
|
public int ItemCount |
|
|
public int ItemCount |
|
|
{ |
|
|
{ |
|
|
get; |
|
|
get => _itemCount; |
|
|
private set; |
|
|
private set => SetAndRaise(ItemCountProperty, ref _itemCount, value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
|