tiny refactoring for better understanding
MODIFY
WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
@@ -201,7 +201,15 @@ namespace WalletWasabi.Fluent.Controls
.AddDisposableHandler(KeyDownEvent, OnKeyDown, RoutingStrategies.Tunnel)
.DisposeWith(_compositeDisposable);
- LayoutUpdated += (sender, args) =>
+ LayoutUpdated += OnLayoutUpdated;
+ }
+
+ private void OnLayoutUpdated(object? sender, EventArgs e)
+ {
+ UpdateCounters();
+ }
+
+ private void UpdateCounters()
{
var containerControl = this.FindDescendantOfType<TagControl>()?.Parent?.Parent;
@@ -209,7 +217,7 @@ namespace WalletWasabi.Fluent.Controls
{
var tagItems = containerControl.GetVisualDescendants().OfType<TagControl>().ToArray();
- for (int i = 0; i < tagItems.Length; i++)
+ for (var i = 0; i < tagItems.Length; i++)
{
if (tagItems[i].FindDescendantOfType<TextBlock>() is { } textBlock)
{
@@ -217,7 +225,6 @@ namespace WalletWasabi.Fluent.Controls
}
}
}
- };
}
private void OnAutoCompleteBoxTemplateApplied(object? sender, TemplateAppliedEventArgs e)

tiny refactoring for better understanding