And worked like a charm :)
RENAME
WalletWasabi.Fluent/Behaviors/HistoryItemDetailsAdorner.cs
WalletWasabi.Fluent/Behaviors/DataBoxItemDetailsAdorner.cs
@@ -5,10 +5,10 @@ using DataBox;
namespace WalletWasabi.Fluent.Behaviors
{
- public class HistoryItemDetailsAdorner : TemplatedControl
+ public class DataBoxItemDetailsAdorner : TemplatedControl
{
public static readonly StyledProperty<DataBoxRow?> RowProperty =
- AvaloniaProperty.Register<HistoryItemDetailsAdorner, DataBoxRow?>(nameof(Row));
+ AvaloniaProperty.Register<DataBoxItemDetailsAdorner, DataBoxRow?>(nameof(Row));
public DataBoxRow? Row
{

MODIFY
WalletWasabi.Fluent/Behaviors/HistoryItemDetailsBehavior.cs
WalletWasabi.Fluent/Behaviors/HistoryItemDetailsBehavior.cs
@@ -12,7 +12,7 @@ namespace WalletWasabi.Fluent.Behaviors
{
public class HistoryItemDetailsBehavior : DisposingBehavior<DataBoxRow>
{
- private HistoryItemDetailsAdorner? _historyItemDetailsAdorner;
+ private DataBoxItemDetailsAdorner? _historyItemDetailsAdorner;
private IDisposable? _currentAdornerEvents;
protected override void OnAttached(CompositeDisposable disposables)
@@ -83,7 +83,7 @@ namespace WalletWasabi.Fluent.Behaviors
return;
}
- _historyItemDetailsAdorner = new HistoryItemDetailsAdorner
+ _historyItemDetailsAdorner = new DataBoxItemDetailsAdorner
{
[AdornerCanvas.AdornedElementProperty] = dataBoxRow,
[AdornerCanvas.IsClipEnabledProperty] = false,

ADD
WalletWasabi.Fluent/Behaviors/UnusedAddressItemDetailsBehavior.cs
+using System.Linq;
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Threading;
+using Avalonia.VisualTree;
+using DataBox;
+using WalletWasabi.Fluent.Controls;
+
+namespace WalletWasabi.Fluent.Behaviors;
+
+public class UnusedAddressItemDetailsBehavior : DisposingBehavior<DataBoxRow>
+{
+ private DataBoxItemDetailsAdorner? _historyItemDetailsAdorner;
+ private IDisposable? _currentAdornerEvents;
+
+ protected override void OnAttached(CompositeDisposable disposables)
+ {
+ if (AssociatedObject is not null)
+ {
+ Observable.FromEventPattern(AssociatedObject, nameof(AssociatedObject.DetachedFromVisualTree))
+ .Subscribe(x =>
+ {
+ Remove();
+ })
+ .DisposeWith(disposables);
+
+ AssociatedObject
+ .GetObservable(InputElement.IsPointerOverProperty)
+ .Subscribe(x =>
+ {
+ if (AssociatedObject.IsPointerOver)
+ {
+ AddAdorner(AssociatedObject);
+ }
+ else
+ {
+ CheckIfShouldRemove();
+ }
+ })
+ .DisposeWith(disposables);
+ }
+ }
+
+ private void CheckIfShouldRemove()
+ {
+ Dispatcher.UIThread.Post(() =>
+ {
+ if (AssociatedObject != null && _historyItemDetailsAdorner != null && !AssociatedObject.IsPointerOver && !_historyItemDetailsAdorner.IsPointerOver)
+ {
+ RemoveAdorner(AssociatedObject);
+ }
+ });
+ }
+
+ private void Remove()
+ {
+ if (AssociatedObject is not null)
+ {
+ RemoveAdorner(AssociatedObject);
+ }
+
+ _currentAdornerEvents?.Dispose();
+ _currentAdornerEvents = null;
+ }
+
+ protected override void OnDetaching()
+ {
+ Remove();
+
+ base.OnDetaching();
+ }
+
+ private void AddAdorner(DataBoxRow dataBoxRow)
+ {
+ _currentAdornerEvents?.Dispose();
+ _currentAdornerEvents = null;
+
+ var layer = dataBoxRow.GetVisualRoot().GetVisualDescendants().OfType<AdornerCanvas>()
+ .FirstOrDefault(x => x.Name == "DialogAdornerCanvas");
+
+ if (layer is null || _historyItemDetailsAdorner is not null)
+ {
+ return;
+ }
+
+ _historyItemDetailsAdorner = new DataBoxItemDetailsAdorner
+ {
+ [AdornerCanvas.AdornedElementProperty] = dataBoxRow,
+ [AdornerCanvas.IsClipEnabledProperty] = false,
+ Row = dataBoxRow
+ };
+
+ _currentAdornerEvents = _historyItemDetailsAdorner.GetObservable(InputElement.IsPointerOverProperty)
+ .Subscribe(_ => CheckIfShouldRemove());
+
+ ((ISetLogicalParent)_historyItemDetailsAdorner).SetParent(dataBoxRow);
+ layer.Children.Add(_historyItemDetailsAdorner);
+ }
+
+ private void RemoveAdorner(DataBoxRow dataBoxRow)
+ {
+ _currentAdornerEvents?.Dispose();
+ _currentAdornerEvents = null;
+
+ var layer = AdornerCanvas.GetAdornerLayer(dataBoxRow);
+ if (layer is null || _historyItemDetailsAdorner is null)
+ {
+ return;
+ }
+
+ layer.Children.Remove(_historyItemDetailsAdorner);
+ ((ISetLogicalParent)_historyItemDetailsAdorner).SetParent(null);
+ _historyItemDetailsAdorner = null;
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
</c:Dialog.Styles>
<ContentControl Content="{Binding CurrentPage}" />
</c:Dialog>
+ <c:AdornerCanvas Name="DialogAdornerCanvas" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Panel>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
</Setter>
</Style>
- <Style Selector="behaviors|HistoryItemDetailsAdorner">
+ <Style Selector="behaviors|DataBoxItemDetailsAdorner">
<Setter Property="Margin" Value="-31,0,0,0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />

MODIFY
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
<Setter Property="(Interaction.Behaviors)">
<BehaviorCollectionTemplate>
<BehaviorCollection>
- <behaviors:HistoryItemDetailsBehavior />
+ <behaviors:UnusedAddressItemDetailsBehavior />
</BehaviorCollection>
</BehaviorCollectionTemplate>
</Setter>
<Setter Property="Foreground" Value="{DynamicResource SystemAccentColor}" />
</Style>
- <Style Selector="behaviors|HistoryItemDetailsAdorner">
- <Setter Property="Margin" Value="0,0,0,0" />
+ <Style Selector="behaviors|DataBoxItemDetailsAdorner">
+ <Setter Property="Margin" Value="-32,0,0,0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="ClipToBounds" Value="False" />
NormalIcon="{StaticResource copy_regular}"
ClickIcon="{StaticResource copy_confirmed}"
InitialOpacity="1.0" />
-
-
- <Button Classes="plain addressActionButton" Command="{Binding NavigateCommand}"
- DockPanel.Dock="Right"
- ToolTip.Tip="QR Code">
- <PathIcon Data="{StaticResource qr_code_regular}" Classes=" addressActionIcon" />
- </Button>
-
</Panel>
</ControlTemplate>
</Setter>
</DataBox.Styles>
<DataBox.Columns>
-
<DataBoxTemplateColumn Width="70"
CanUserSort="True">
<DataBoxTemplateColumn.CellTemplate>
</DataTemplate>
</DataBoxTemplateColumn.CellTemplate>
</DataBoxTemplateColumn>
-
-
</DataBox.Columns>
</DataBox>
</c:ContentArea>

And worked like a charm :)