@ -11,6 +11,7 @@ using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives ;
using Avalonia.Controls.Templates ;
using Avalonia.Controls.Utils ;
using Avalonia.Input ;
using Avalonia.LogicalTree ;
using Avalonia.Metadata ;
@ -106,6 +107,12 @@ namespace Avalonia.Controls
set { SetAndRaise ( ItemsProperty , ref _ items , value ) ; }
}
public int ItemCount
{
get ;
private set ;
}
/// <summary>
/// Gets or sets the panel used to display the items.
/// </summary>
@ -352,6 +359,10 @@ namespace Avalonia.Controls
RemoveControlItemsFromLogicalChildren ( e . OldItems ) ;
break ;
}
int? count = ( Items as IList ) ? . Count ;
if ( count ! = null )
ItemCount = ( int ) count ;
var collection = sender as ICollection ;
PseudoClasses . Set ( ":empty" , collection = = null | | collection . Count = = 0 ) ;