Add VisibleItems property
MODIFY
WalletWasabi.Fluent/Controls/LabelsPanel.cs
WalletWasabi.Fluent/Controls/LabelsPanel.cs
@@ -8,12 +8,25 @@ public class LabelsPanel : VirtualizingStackPanel
public static readonly StyledProperty<Control?> EllipsisControlProperty =
AvaloniaProperty.Register<LabelsPanel, Control?>(nameof(EllipsisControl));
+ public static readonly DirectProperty<LabelsPanel, int> VisibleItemsProperty =
+ AvaloniaProperty.RegisterDirect<LabelsPanel, int>(
+ nameof(VisibleItems),
+ o => o.VisibleItems);
+
+ private int _visibleItems;
+
public Control? EllipsisControl
{
get => GetValue(EllipsisControlProperty);
set => SetValue(EllipsisControlProperty, value);
}
+ public int VisibleItems
+ {
+ get => _visibleItems;
+ private set => SetAndRaise(VisibleItemsProperty, ref _visibleItems, value);
+ }
+
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
if (EllipsisControl is { } ellipsisControl)
@@ -127,6 +140,8 @@ public class LabelsPanel : VirtualizingStackPanel
}
}
+ VisibleItems = count;
+
return new Size(width, height);
}
}

Add VisibleItems property