make row flash when we programatically select it.
MODIFY
WalletWasabi.Fluent/Styles/DataGrid.axaml
WalletWasabi.Fluent/Styles/DataGrid.axaml
<Style Selector="DataGridRow:pointerover /template/ Rectangle#BackgroundRectangle">
<Setter Property="Fill" Value="{DynamicResource DataGridRowSelectedBackgroundColor}" />
</Style>
- <Style Selector="DataGridRow:selected /template/ Rectangle#BackgroundRectangle">
- <Style.Animations>
- <Animation Duration="1.25" Easing="BounceEasing">
- <KeyFrame KeyTime="0:0:0.0">
- <Setter Property="Fill" Value="LightGreen" />
- </KeyFrame>
- <KeyFrame KeyTime="0:0:0.25">
- <Setter Property="Fill" Value="Transparent" />
- </KeyFrame>
- <KeyFrame KeyTime="0:0:0.50">
- <Setter Property="Fill" Value="LightGreen" />
- </KeyFrame>
- <KeyFrame KeyTime="0:0:0.75">
- <Setter Property="Fill" Value="Transparent" />
- </KeyFrame>
- <KeyFrame KeyTime="0:0:1">
- <Setter Property="Fill" Value="LightGreen" />
- </KeyFrame>
- <KeyFrame KeyTime="0:0:1.25">
- <Setter Property="Fill" Value="Transparent" />
- </KeyFrame>
- </Animation>
- </Style.Animations>
- </Style>
<Style Selector="DataGridRow /template/ Border#PART_SelectionIndicator">
<Setter Property="BorderBrush" Value="Transparent" />
</Style>

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItemViewModel.cs
@@ -9,8 +9,10 @@ using WalletWasabi.Models;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
{
- public class HistoryItemViewModel
+ public class HistoryItemViewModel : ViewModelBase
{
+ private bool _isSelected;
+
public HistoryItemViewModel(int orderIndex, TransactionSummary transactionSummary, WalletViewModel walletViewModel, Money balance, IObservable<Unit> updateTrigger)
{
TransactionSummary = transactionSummary;
@@ -53,5 +55,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
public Money? OutgoingAmount { get; }
public bool IsCoinJoin { get; }
+
+ public bool IsSelected
+ {
+ get => _isSelected;
+ set => this.RaiseAndSetIfChanged(ref _isSelected, value);
+ }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
@@ -57,6 +57,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
.Filter(coinJoinFilter)
.Bind(_transactions)
.Subscribe();
+
+ this.WhenAnyValue(x => x.SelectedItem)
+ .Buffer(2, 1)
+ .Select(buf => buf[0])
+ .WhereNotNull()
+ .Subscribe(x => x.IsSelected = false);
}
public DataGridCollectionView CollectionView { get; }
@@ -72,6 +78,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
if (txnItem is { })
{
SelectedItem = txnItem;
+ SelectedItem.IsSelected = true;
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
<Setter Property="Spacing" Value="10" />
<Setter Property="Margin" Value="10 0" />
</Style>
+ <Style Selector="DataGridRow">
+ <Setter Property="Focusable" Value="False" />
+ <Setter Property="Template">
+ <ControlTemplate>
+ <DockPanel LastChildFill="True">
+ <Border Name="PART_SelectionIndicator"
+ BorderThickness="2 0 0 0"
+ DockPanel.Dock="Left"
+ VerticalAlignment="Stretch" />
+ <DataGridFrozenGrid Name="PART_Root"
+ RowDefinitions="*,Auto,Auto"
+ ColumnDefinitions="Auto,*">
+
+ <Rectangle Name="BackgroundRectangle"
+ Grid.RowSpan="2"
+ Grid.ColumnSpan="2" x:CompileBindings="False" Classes.selectAnimation="{Binding IsSelected}" />
+ <Rectangle x:Name="InvalidVisualElement"
+ Grid.ColumnSpan="2"
+ Fill="{DynamicResource DataGridRowInvalidBrush}" />
+
+ <DataGridRowHeader Name="PART_RowHeader"
+ Grid.RowSpan="3"
+ DataGridFrozenGrid.IsFrozen="True" />
+ <DataGridCellsPresenter Name="PART_CellsPresenter"
+ Grid.Column="1"
+ DataGridFrozenGrid.IsFrozen="True" />
+ <DataGridDetailsPresenter Name="PART_DetailsPresenter"
+ Grid.Row="1"
+ Grid.Column="1"
+ Background="{DynamicResource DataGridDetailsPresenterBackgroundBrush}" />
+ <Rectangle Name="PART_BottomGridLine"
+ Grid.Row="2"
+ Grid.Column="1"
+ HorizontalAlignment="Stretch"
+ Height="1" />
+
+ </DataGridFrozenGrid>
+ </DockPanel>
+ </ControlTemplate>
+ </Setter>
+ </Style>
+
+ <Style Selector="DataGridRow /template/ Rectangle#BackgroundRectangle.selectAnimation">
+ <Style.Animations>
+ <Animation Duration="1.25">
+ <KeyFrame KeyTime="0:0:0.0">
+ <Setter Property="Fill" Value="LightGreen" />
+ </KeyFrame>
+ <KeyFrame KeyTime="0:0:0.25">
+ <Setter Property="Fill" Value="Transparent" />
+ </KeyFrame>
+ <KeyFrame KeyTime="0:0:0.50">
+ <Setter Property="Fill" Value="LightGreen" />
+ </KeyFrame>
+ <KeyFrame KeyTime="0:0:0.75">
+ <Setter Property="Fill" Value="Transparent" />
+ </KeyFrame>
+ <KeyFrame KeyTime="0:0:1">
+ <Setter Property="Fill" Value="LightGreen" />
+ </KeyFrame>
+ <KeyFrame KeyTime="0:0:1.25">
+ <Setter Property="Fill" Value="Transparent" />
+ </KeyFrame>
+ </Animation>
+ </Style.Animations>
+ </Style>
+
</DataGrid.Styles>
<DataGrid.Columns>

make row flash when we programatically select it.