Refactor history item context menu as resource
MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
x:CompileBindings="True"
ClipToBounds="False"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.History.HistoryTable">
+ <UserControl.Resources>
+ <ContextMenu x:Key="TransactionContextMenu" x:DataType="historyItems:HistoryItemViewModelBase">
+ <!-- TODO: Show speed up transaction dialog.
+ <MenuItem Header="Speed-up transaction"
+ IsVisible="{Binding !IsConfirmed}"
+ Command="{Binding SpeedUpTransactionCommand}">
+ <MenuItem.Icon>
+ <PathIcon Data="{StaticResource rocket_regular}" />
+ </MenuItem.Icon>
+ </MenuItem>
+ -->
+ <MenuItem Header="Show details"
+ Command="{Binding ShowDetailsCommand}">
+ <MenuItem.Icon>
+ <PathIcon Data="{StaticResource details_regular}" />
+ </MenuItem.Icon>
+ </MenuItem>
+ </ContextMenu>
+ </UserControl.Resources>
<Panel>
<TreeDataGrid Source="{Binding Source}"
CanUserResizeColumns="False"
</DockPanel>
</ControlTemplate>
</Setter>
- <Setter Property="ContextMenu">
- <Setter.Value>
- <ContextMenu x:DataType="historyItems:HistoryItemViewModelBase">
- <!-- TODO: Show speed up transaction dialog.
- <MenuItem Header="Speed-up transaction"
- IsVisible="{Binding !IsConfirmed}"
- Command="{Binding SpeedUpTransactionCommand}">
- <MenuItem.Icon>
- <PathIcon Data="{StaticResource rocket_regular}" />
- </MenuItem.Icon>
- </MenuItem>
- -->
- <MenuItem Header="Show details"
- Command="{Binding ShowDetailsCommand}">
- <MenuItem.Icon>
- <PathIcon Data="{StaticResource details_regular}" />
- </MenuItem.Icon>
- </MenuItem>
- </ContextMenu>
- </Setter.Value>
- </Setter>
+ <Setter Property="ContextMenu" Value="{StaticResource TransactionContextMenu}" />
</Style>
<Style Selector="TreeDataGridRow /template/ Rectangle#BackgroundRectangle.selectAnimation">
<Setter Property="Fill" Value="{DynamicResource SystemAccentColor}" />

Refactor history item context menu as resource