use AdorningContentControl instead of Popup
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PocketViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PocketViewModel.cs
@@ -9,8 +9,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private bool _isSelected;
[AutoNotify] private decimal _totalBtc;
[AutoNotify] private SmartLabel _labels;
- [AutoNotify] private bool _isWarningOpen;
- [AutoNotify] private string? _warningMessage;
public PocketViewModel((SmartLabel labels, ICoinsView coins) pocket)
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
@@ -27,6 +27,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private decimal _stillNeeded;
[AutoNotify] private bool _enoughSelected;
+ [AutoNotify] private bool _isWarningOpen;
public PrivacyControlViewModel(Wallet wallet, TransactionInfo transactionInfo)
{
@@ -47,10 +48,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
selected.Sum(x => x.TotalBtc)
.Subscribe(x =>
{
- if (_privatePocket is { })
- {
- _privatePocket.IsWarningOpen = _privatePocket.IsSelected && selectedList.Count > 1;
- }
+ IsWarningOpen = selectedList.Count > 1 && selectedList.Items.Any(x => x == _privatePocket);
StillNeeded = transactionInfo.Amount.ToDecimal(MoneyUnit.BTC) - x;
EnoughSelected = StillNeeded <= 0;
@@ -149,12 +147,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
if (pocket.SmartLabel.Labels.Any(x => x == CoinPocketHelper.PrivateFundsText))
{
- _privatePocket = new PocketViewModel(pocket)
- {
- WarningMessage =
- "Warning, using both private and non-private funds in the same transaction can destroy your privacy."
- };
-
+ _privatePocket = new PocketViewModel(pocket);
_pocketSource.Add(_privatePocket);
}
else

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/PrivacyControlView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/PrivacyControlView.axaml
IsBusy="{Binding IsBusy}"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
<DockPanel>
+
+ <!-- Warning messages -->
<Panel Margin="0 10 0 0" DockPanel.Dock="Bottom">
<Panel.Styles>
<Style Selector="c|InfoMessage[IsVisible=False]">
Content="Not in a hurry? Consider making more of your funds private by CoinJoining before making this transaction."
HorizontalAlignment="Center" />
</Panel>
+
+ <c:AdorningContentControl ClipToBounds="False" IsAdornmentVisible="{Binding IsWarningOpen}" RevealMode="Manual" DockPanel.Dock="Top" VerticalAlignment="Top">
+ <c:AdorningContentControl.Adornment>
+
+ <!-- Private funds warning -->
+ <c:InfoMessage Classes="overlay" Padding="15" MaxWidth="400" Foreground="{DynamicResource SystemErrorTextColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom">
+ <TextBlock Text="Warning, using both private and non-private funds in the same transaction can destroy your privacy." TextWrapping="Wrap" />
+ </c:InfoMessage>
+ </c:AdorningContentControl.Adornment>
+
+ <!-- List -->
<DataGrid AutoGenerateColumns="False"
Items="{Binding Pockets}">
<DataGrid.Resources>
<DataGridTemplateColumn CanUserSort="False" Width="*" Header="Labels">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="vm:PocketViewModel">
- <Panel x:Name="ContainerPanel" HorizontalAlignment="Left">
<c:TagsBox Items="{Binding Labels}" IsReadOnly="True" HorizontalAlignment="Left" />
- <Popup IsOpen="{Binding IsWarningOpen, Mode=TwoWay, FallbackValue=False}" PlacementTarget="ContainerPanel" PlacementMode="Right">
- <c:InfoMessage Classes="overlay" Padding="15" MaxWidth="400" Foreground="{DynamicResource SystemErrorTextColor}">
- <TextBlock Text="{Binding WarningMessage}" TextWrapping="Wrap" />
- </c:InfoMessage>
- </Popup>
- </Panel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
+ </c:AdorningContentControl>
</DockPanel>
</c:ContentArea>
</UserControl>

use AdorningContentControl instead of Popup