use Control instead of Rectangle on NavBar selection indicators
MODIFY
WalletWasabi.Fluent/Behaviors/NavBarSelectedIndicatorChildBehavior.cs
WalletWasabi.Fluent/Behaviors/NavBarSelectedIndicatorChildBehavior.cs
@@ -8,7 +8,7 @@ using Avalonia.Threading;
namespace WalletWasabi.Fluent.Behaviors;
-public class NavBarSelectedIndicatorChildBehavior : AttachedToVisualTreeBehavior<Rectangle>
+public class NavBarSelectedIndicatorChildBehavior : AttachedToVisualTreeBehavior<Control>
{
public static readonly AttachedProperty<Control> NavBarItemParentProperty =
AvaloniaProperty.RegisterAttached<NavBarSelectedIndicatorChildBehavior, Control, Control>(

MODIFY
WalletWasabi.Fluent/Behaviors/NavBarSelectedIndicatorState.cs
WalletWasabi.Fluent/Behaviors/NavBarSelectedIndicatorState.cs
@@ -2,6 +2,7 @@ using System.Threading;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Animation.Easings;
+using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.Layout;
using Avalonia.Media;
@@ -17,7 +18,7 @@ public class NavBarSelectedIndicatorState : IDisposable
private readonly TimeSpan _totalDuration = TimeSpan.FromSeconds(0.4);
private CancellationTokenSource _currentAnimationCts = new();
- private Rectangle? _activeIndicator;
+ private Control? _activeIndicator;
private bool _isDisposed;
private bool _previousAnimationOngoing;
@@ -62,7 +63,7 @@ public class NavBarSelectedIndicatorState : IDisposable
return identity;
}
- public async void AnimateIndicatorAsync(Rectangle next)
+ public async void AnimateIndicatorAsync(Control next)
{
if (_isDisposed)
{
@@ -160,7 +161,7 @@ public class NavBarSelectedIndicatorState : IDisposable
nextIndicator.ZIndex = oldZ;
}
- public void SetActive(Rectangle initial)
+ public void SetActive(Control initial)
{
if (_activeIndicator is not null)
{

use Control instead of Rectangle on NavBar selection indicators