Add ScrollToSelectedItemBehavior
ADD
WalletWasabi.Fluent/Behaviors/ScrollToSelectedItemBehavior.cs
+using System.Linq;
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+using ReactiveUI;
+
+namespace WalletWasabi.Fluent.Behaviors;
+
+public class ScrollToSelectedItemBehavior : AttachedToVisualTreeBehavior<Avalonia.Controls.TreeDataGrid>
+{
+ protected override void OnAttachedToVisualTree(CompositeDisposable disposable)
+ {
+ if (AssociatedObject is not { SelectionInteraction: { } selection, RowSelection: { } rowSelection })
+ {
+ return;
+ }
+
+ Observable.FromEventPattern(selection, nameof(selection.SelectionChanged))
+ .Select(x => rowSelection.SelectedIndex.FirstOrDefault())
+ .WhereNotNull()
+ .Do(
+ index =>
+ {
+ if (AssociatedObject.RowsPresenter is not null)
+ {
+ AssociatedObject.RowsPresenter.BringIntoView(index);
+ }
+ })
+ .Subscribe()
+ .DisposeWith(disposable);
+ }
+}

MODIFY
WalletWasabi.Fluent/ViewModels/SearchBar/Sources/TransactionItemsSource.cs
WalletWasabi.Fluent/ViewModels/SearchBar/Sources/TransactionItemsSource.cs
@@ -17,6 +17,10 @@ public class TransactionsSource : ISearchItemSource
{
var transactionId = new string(r.HistoryItem.Id.ToString().Trim('0').Take(10).ToArray());
var keywords = new []{ r.HistoryItem.Id.ToString() };
- return new ActionableItem(transactionId, $"Found in {r.Wallet.WalletName}", async () => r.Wallet.NavigateAndHighlight(r.HistoryItem.Id), "Transactions", keywords);
+ return new ActionableItem(transactionId, $"Found in {r.Wallet.WalletName}", async () =>
+ {
+ r.Wallet.NavigateAndHighlight(r.HistoryItem.Id);
+ App.Current.FocusManager.Focus(null);
+ }, "Transactions", keywords);
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
<TreeDataGrid Source="{Binding Source}"
CanUserResizeColumns="False"
Margin="0 0 0 0">
+ <i:Interaction.Behaviors>
+ <behaviors:ScrollToSelectedItemBehavior />
+ </i:Interaction.Behaviors>
<TreeDataGrid.ElementFactory>
<treeDataGrid:CustomElementFactory />
</TreeDataGrid.ElementFactory>

Add ScrollToSelectedItemBehavior