share code between dialog and suggestions flyout.
MODIFY
WalletWasabi.Fluent/App.axaml
WalletWasabi.Fluent/App.axaml
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/TileControl.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/StatusItem.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml" />
+ <StyleInclude Source="avares://WalletWasabi.Fluent/Controls/SuggestionItem.axaml" />
</Application.Styles>
<TrayIcon.Icons>

ADD
WalletWasabi.Fluent/Controls/SuggestionItem.axaml
+<Styles xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:controls="using:WalletWasabi.Fluent.Controls">
+ <Design.PreviewWith>
+ <controls:SuggestionItem />
+ </Design.PreviewWith>
+
+ <Style Selector="controls|SuggestionItem">
+ <!-- Set Defaults -->
+ <Setter Property="Template">
+ <ControlTemplate>
+ <Panel>
+ <Border Name="PART_DecorationBorderUnselected" >
+ <Border.Transitions>
+ <Transitions>
+ <DoubleTransition Property="Opacity"
+ Easing="{StaticResource FluentEasing}"
+ Duration="0:0:0.25" />
+ </Transitions>
+ </Border.Transitions>
+ </Border>
+ <Border Name="PART_DecorationBorderHover" >
+ <Border.Transitions>
+ <Transitions>
+ <DoubleTransition Property="Opacity"
+ Easing="{StaticResource FluentEasing}"
+ Duration="0:0:0.25" />
+ </Transitions>
+ </Border.Transitions>
+ </Border>
+ <Border Name="PART_MainContentBorder">
+ <ContentControl Name="PART_ContentPresenter"
+ ClipToBounds="{TemplateBinding ClipToBounds}"
+ BorderBrush="{TemplateBinding BorderBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ ContentTemplate="{TemplateBinding ContentTemplate}"
+ Content="{TemplateBinding Content}"
+ Padding="{TemplateBinding Padding}"
+ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
+ HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
+ </Border>
+ </Panel>
+ </ControlTemplate>
+ </Setter>
+ </Style>
+</Styles>

ADD
WalletWasabi.Fluent/Controls/SuggestionItem.axaml.cs
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+namespace WalletWasabi.Fluent.Controls;
+
+public class SuggestionItem : ContentControl
+{
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/ChangeAvoidanceSuggestionControl.axaml
WalletWasabi.Fluent/Views/Wallets/Send/ChangeAvoidanceSuggestionControl.axaml
ClipToBounds="False"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.Wallets.Send.ChangeAvoidanceSuggestionControl">
- <Panel>
- <Border Name="PART_DecorationBorderUnselected" >
- <Border.Transitions>
- <Transitions>
- <DoubleTransition Property="Opacity"
- Easing="{StaticResource FluentEasing}"
- Duration="0:0:0.25" />
- </Transitions>
- </Border.Transitions>
- </Border>
- <Border Name="PART_DecorationBorderHover" >
- <Border.Transitions>
- <Transitions>
- <DoubleTransition Property="Opacity"
- Easing="{StaticResource FluentEasing}"
- Duration="0:0:0.25" />
- </Transitions>
- </Border.Transitions>
- </Border>
- <Border Name="PART_MainContentBorder">
<StackPanel Spacing="20">
<Panel MinHeight="80" MinWidth="100">
<StackPanel Spacing="10" VerticalAlignment="Top">
<TextBlock TextWrapping="Wrap" Text="Avoid Change by sending:" TextAlignment="Center" />
<StackPanel Spacing="10">
- <TextBlock Text="{Binding DifferenceFiat}" FontSize="20" HorizontalAlignment="Center" Foreground="{DynamicResource SystemAccentColor}" />
+ <TextBlock Text="{Binding DifferenceFiat}" FontSize="20" HorizontalAlignment="Center"
+ Foreground="{DynamicResource SystemAccentColor}" />
<TextBlock Text="{Binding Amount}" FontSize="12" HorizontalAlignment="Center" Opacity="0.6" />
<TextBlock Text="{Binding AmountFiat}" FontSize="12" HorizontalAlignment="Center" Opacity="0.6" />
</StackPanel>
</StackPanel>
</Panel>
</StackPanel>
- </Border>
- </Panel>
</UserControl>
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/ConfirmLabelsDialogView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/ConfirmLabelsDialogView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
xmlns:send="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Send"
+ xmlns:sendControls="clr-namespace:WalletWasabi.Fluent.Views.Wallets.Send"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:CompileBindings="True"
x:DataType="send:ConfirmLabelsDialogViewModel"
<controls:QuestionControl HighlightButton="YesButton"
YesCommand="{Binding NextCommand}"
NoCommand="{Binding CancelCommand}">
- <StackPanel Spacing="20" DataContext="{Binding Suggestion}">
- <PathIcon DockPanel.Dock="Top" Data="{StaticResource incognito_filled}" Height="25" Width="25"
- Foreground="{DynamicResource SystemAccentColor}" />
-
- <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap"
- Text="Some people or companies could know about this:" />
-
- <DockPanel LastChildFill="False" HorizontalAlignment="Center">
- <controls:TagsBox Padding="0"
- Margin="0"
- MinWidth="0"
- BorderThickness="0"
- DockPanel.Dock="Left"
- IsReadOnly="True"
- Items="{Binding Labels}"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Center" />
- <Button Classes="labelFlyout"
- DockPanel.Dock="Left"
- IsVisible="{Binding !!FilteredLabels.Count}"
- Content="..."
- Margin="0 4 0 0">
- <Button.Flyout>
- <Flyout Placement="BottomEdgeAlignedLeft" ShowMode="TransientWithDismissOnPointerMoveAway">
- <controls:TagsBox IsReadOnly="True"
- Items="{Binding FilteredLabels}" />
- </Flyout>
- </Button.Flyout>
- <ToolTip.Tip>
- <Panel>
- <controls:TagsBox IsReadOnly="True"
- Margin="4,6,0,0"
- Items="{Binding FilteredLabels}" />
- </Panel>
- </ToolTip.Tip>
- </Button>
- </DockPanel>
-
- <TextBlock Text="Control your privacy?" TextWrapping="Wrap" HorizontalAlignment="Center" />
-
- </StackPanel>
+ <sendControls:PocketSuggestionControl DataContext="{Binding Suggestion}" />
</controls:QuestionControl>
</controls:ContentArea>
</UserControl>
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/PocketSuggestionControl.axaml
WalletWasabi.Fluent/Views/Wallets/Send/PocketSuggestionControl.axaml
ClipToBounds="False"
x:DataType="send:PocketSuggestionViewModel"
x:Class="WalletWasabi.Fluent.Views.Wallets.Send.PocketSuggestionControl">
- <Panel>
- <Border Name="PART_DecorationBorderUnselected" >
- <Border.Transitions>
- <Transitions>
- <DoubleTransition Property="Opacity"
- Easing="{StaticResource FluentEasing}"
- Duration="0:0:0.25" />
- </Transitions>
- </Border.Transitions>
- </Border>
- <Border Name="PART_DecorationBorderHover" >
- <Border.Transitions>
- <Transitions>
- <DoubleTransition Property="Opacity"
- Easing="{StaticResource FluentEasing}"
- Duration="0:0:0.25" />
- </Transitions>
- </Border.Transitions>
- </Border>
- <Border Name="PART_MainContentBorder">
<StackPanel Spacing="20">
<PathIcon DockPanel.Dock="Top" Data="{StaticResource incognito_filled}" Height="25" Width="25"
Foreground="{DynamicResource SystemAccentColor}" />
<TextBlock Text="Control your privacy?" TextWrapping="Wrap" HorizontalAlignment="Center" />
</StackPanel>
- </Border>
- </Panel>
</UserControl>
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
</ListBox.ItemsPanel>
<ListBox.DataTemplates>
<DataTemplate DataType="vm:ChangeAvoidanceSuggestionViewModel">
+ <c:SuggestionItem>
<send:ChangeAvoidanceSuggestionControl />
+ </c:SuggestionItem>
</DataTemplate>
<DataTemplate DataType="vm:PocketSuggestionViewModel">
+ <c:SuggestionItem>
<send:PocketSuggestionControl />
+ </c:SuggestionItem>
</DataTemplate>
</ListBox.DataTemplates>
</ListBox>

share code between dialog and suggestions flyout.