target items with psuedoclasses.
MODIFY
WalletWasabi.Fluent/Behaviors/ListBoxPreviewBehavior.cs
WalletWasabi.Fluent/Behaviors/ListBoxPreviewBehavior.cs
@@ -11,6 +11,7 @@ namespace WalletWasabi.Fluent.Behaviors
public class ListBoxPreviewBehavior : DisposingBehavior<ListBox>
{
private object? _previewItem;
+ private ListBoxItem? _previewControl;
/// <summary>
/// Defines the <see cref="SelectedItem"/> property.
@@ -24,6 +25,22 @@ namespace WalletWasabi.Fluent.Behaviors
set => SetValue(PreviewItemProperty, value);
}
+ private void ClearPsuedoClasses()
+ {
+ if (_previewControl is StyledElement se && se.Classes is IPseudoClasses pc)
+ {
+ pc.Remove(":previewitem");
+ }
+ }
+
+ private void SetPsuedoClasses()
+ {
+ if (_previewControl is StyledElement se && se.Classes is IPseudoClasses pc)
+ {
+ pc.Add(":previewitem");
+ }
+ }
+
protected override void OnAttached(CompositeDisposable disposables)
{
Observable.FromEventPattern<PointerEventArgs>(AssociatedObject, nameof(AssociatedObject.PointerMoved))
@@ -31,15 +48,21 @@ namespace WalletWasabi.Fluent.Behaviors
{
var visual = AssociatedObject.GetVisualAt(x.EventArgs.GetPosition(AssociatedObject));
- if (visual is IControl control)
+ if (visual is IControl control && control.TemplatedParent is ListBoxItem item)
{
if (control.DataContext != PreviewItem)
{
+ ClearPsuedoClasses();
+ _previewControl = item;
PreviewItem = control.DataContext;
+
+ SetPsuedoClasses();
}
}
else
{
+ ClearPsuedoClasses();
+ _previewControl = null;
PreviewItem = null;
}
})

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -217,8 +217,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
PrivacySuggestions.WhenAnyValue(x => x.PreviewSuggestion)
.Subscribe(x =>
+ {
+ if (x is { })
{
Console.WriteLine(x.TransactionResult.CalculateDestinationAmount());
+ }
});
SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: false);

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
HorizontalAlignment="Center"
Items="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}">
<i:Interaction.Behaviors>
- <behaviors:ListBoxPreviewBehavior PreviewItem="{Binding PreviewSuggestion}" />
+ <behaviors:ListBoxPreviewBehavior PreviewItem="{Binding PreviewSuggestion, Mode=TwoWay}" />
</i:Interaction.Behaviors>
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" />
</Style>
- <Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
+ <Style Selector="ListBoxItem:previewitem /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" />
</Style>
</Setter>
</Style>
- <Style Selector="ListBoxItem:selected Border#PART_DecorationBorder">
+ <Style Selector="ListBoxItem:previewitem Border#PART_DecorationBorder">
<Setter Property="Opacity" Value="1" />
</Style>
</ListBox.Styles>

target items with psuedoclasses.