PrivacyRing selecteditem
ADD
WalletWasabi.Fluent/Behaviors/ListBoxItemPointerOverSelectedBehavior.cs
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.VisualTree;
+using Avalonia.Xaml.Interactions.Custom;
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+
+namespace WalletWasabi.Fluent.Behaviors;
+
+public class ListBoxItemPointerOverSelectedBehavior : DisposingBehavior<ListBoxItem>
+{
+ protected override void OnAttached(CompositeDisposable disposables)
+ {
+ if (AssociatedObject is null)
+ {
+ return;
+ }
+
+ //var listBox = AssociatedObject.FindAncestorOfType<ListBox>();
+
+ //if (listBox is null)
+ //{
+ // return;
+ //}
+
+ Observable.FromEventPattern<AvaloniaPropertyChangedEventArgs>(AssociatedObject, nameof(PropertyChanged))
+ .Select(x => x.EventArgs)
+ .Subscribe(e =>
+ {
+ if (e.Property == InputElement.IsPointerOverProperty && e.NewValue is true)
+ {
+ AssociatedObject.IsSelected = true;
+ //listBox.SelectedItem = AssociatedObject.DataContext;
+ }
+ })
+ .DisposeWith(disposables);
+ }
+}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyRingView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyRingView.axaml
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:i="using:Avalonia.Xaml.Interactivity"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c="using:WalletWasabi.Fluent.Controls"
+ xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.PrivacyRingView">
<UserControl.Styles>
<Style Selector="Path.nonPrivate">
<Setter Property="Fill" Value="{DynamicResource PrivacyLevelNoneBrush}"/>
</Style>
+
+ <Style Selector="ListBoxItem">
+ <Setter Property="IsSelected" Value="{Binding IsPointerOver, Mode=TwoWay}"/>
+ <Setter Property="ClipToBounds" Value="False"/>
+ <Setter Property="Margin" Value="0"/>
+ <Setter Property="Template">
+ <ControlTemplate TargetType="ListBoxItem">
+ <ContentPresenter Content="{TemplateBinding Content}"
+ ContentTemplate="{TemplateBinding ContentTemplate}"/>
+ </ControlTemplate>
+ </Setter>
+
+ <Setter Property="(i:Interaction.Behaviors)">
+ <i:BehaviorCollectionTemplate>
+ <i:BehaviorCollection>
+ <behaviors:ListBoxItemPointerOverSelectedBehavior/>
+ </i:BehaviorCollection>
+ </i:BehaviorCollectionTemplate>
+ </Setter>
+ </Style>
+
+ <Style Selector="ListBoxItem:selected">
+ <Setter Property="Background" Value="Red"/>
+ </Style>
</UserControl.Styles>
<c:ContentArea Title="{Binding Title}"
EnableNext="True" NextContent="Done"
EnableCancel="False"
EnableBack="True">
- <ItemsControl Items="{Binding Items}" ClipToBounds="False" Margin="250 250 0 0" HorizontalAlignment="Center">
- <ItemsControl.ItemsPanel>
+ <ListBox Items="{Binding Items}" ClipToBounds="False" Margin="250 250 0 0" HorizontalAlignment="Center">
+ <ListBox.Template>
+ <ControlTemplate TargetType="ListBox">
+ <ItemsPresenter Name="PART_ItemsPresenter"
+ Items="{TemplateBinding Items}"
+ ItemsPanel="{TemplateBinding ItemsPanel}"
+ ItemTemplate="{TemplateBinding ItemTemplate}"/>
+ </ControlTemplate>
+ </ListBox.Template>
+ <ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Panel />
</ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
+ </ListBox.ItemsPanel>
+ <ListBox.ItemTemplate>
<DataTemplate>
<Path Stretch="None" Height="{Binding OuterRadius}" Width="{Binding OuterRadius}"
Classes.private="{Binding IsPrivate}"
</Path.Data>
</Path>
</DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
+ </ListBox.ItemTemplate>
+ </ListBox>
</c:ContentArea>
</UserControl>

PrivacyRing selecteditem