Use AvaloniaProperty instead of Typecheck.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
<converters:CoinStatusForegroundConverter x:Key="CoinStatusForegroundConverter" />
<converters:CoinItemExpanderColorConverter x:Key="CoinItemExpanderColorConverter" />
<converters:LurkingWifeModeStringConverter x:Key="LurkingWifeModeStringConverter" />
- <converters:SelectNonPrivateCheckBoxVisibilityConverter x:Key="SelectNonPrivateCheckBoxVisibilityConverter" />
</UserControl.Resources>
<UserControl.Styles>
<Style Selector="TextBlock">
<StackPanel Margin="0 10 0 0" Spacing="10" DockPanel.Dock="Bottom" Orientation="Horizontal">
<CheckBox Content="Select All" IsThreeState="True" IsChecked="{Binding SelectAllCheckBoxState}" Command="{Binding SelectAllCheckBoxCommand}" />
<CheckBox Content="Select All Private" IsThreeState="True" IsChecked="{Binding SelectPrivateCheckBoxState}" Command="{Binding SelectPrivateCheckBoxCommand}" ToolTip.Tip="Coins that have acquired the privacy target." />
- <CheckBox Content="Select All Non-Private" IsThreeState="True" IsChecked="{Binding SelectNonPrivateCheckBoxState}" Command="{Binding SelectNonPrivateCheckBoxCommand}" ToolTip.Tip="Coins that have not acquired the privacy target." IsVisible="{Binding CoinListContainerType, Converter={StaticResource SelectNonPrivateCheckBoxVisibilityConverter}}" />
+ <CheckBox Content="Select All Non-Private" IsThreeState="True" IsChecked="{Binding SelectNonPrivateCheckBoxState}" Command="{Binding SelectNonPrivateCheckBoxCommand}" IsVisible="{Binding SelectAllNonPrivateVisible}" ToolTip.Tip="Coins that have not acquired the privacy target." />
<StackPanel Spacing="10" DockPanel.Dock="Bottom" Orientation="Horizontal" IsVisible="{Binding IsAnyCoinSelected}">
<TextBlock Text="|" />
<TextBlock Text="Selected Amount:" />

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml.cs
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Data;
using Avalonia.Markup.Xaml;
+using ReactiveUI;
+using System;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public class CoinListView : UserControl
{
+ public static readonly StyledProperty<bool> SelectAllNonPrivateVisibleProperty =
+ AvaloniaProperty.Register<CoinListView, bool>(nameof(SelectAllNonPrivateVisible), defaultBindingMode: BindingMode.TwoWay);
+
+ public bool SelectAllNonPrivateVisible
+ {
+ get => GetValue(SelectAllNonPrivateVisibleProperty);
+ set => SetValue(SelectAllNonPrivateVisibleProperty, value);
+ }
+
public CoinListView()
{
InitializeComponent();
+
+ SelectAllNonPrivateVisible = true;
+
+ this.WhenAnyValue(x => x.DataContext)
+ .Subscribe(dataContext =>
+ {
+ if (dataContext is CoinListViewModel viewmodel)
+ {
+ viewmodel.SelectAllNonPrivateVisible = SelectAllNonPrivateVisible;
+ }
+ });
}
private void InitializeComponent()

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -41,6 +41,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private Money _selectedAmount;
private bool _isAnyCoinSelected;
private bool _labelExposeCommonOwnershipWarning;
+ private bool _selectAllNonPrivateVisible;
+
public Global Global { get; }
public CoinListContainerType CoinListContainerType { get; }
public ReactiveCommand<Unit, Unit> EnqueueCoin { get; }
@@ -170,6 +172,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _coinJoinStatusWidth, value);
}
+ public bool SelectAllNonPrivateVisible
+ {
+ get => _selectAllNonPrivateVisible;
+ set => this.RaiseAndSetIfChanged(ref _selectAllNonPrivateVisible, value);
+ }
+
private bool? GetCheckBoxesSelectedState(Func<CoinViewModel, bool> coinFilterPredicate)
{
var coins = Coins.Where(coinFilterPredicate).ToArray();

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml
<TextBlock Text="{Binding SuccessMessage}" Classes="validationMessage" Foreground="Green" />
<Grid ColumnDefinitions="60,100,100,600,100,Auto"></Grid>
</StackPanel>
- <local:CoinListView DataContext="{Binding CoinList}" />
+ <local:CoinListView SelectAllNonPrivateVisible="False" DataContext="{Binding CoinList}" />
</DockPanel>
</Grid>
</DockPanel>

DELETE
WalletWasabi.Gui/Converters/SelectNonPrivateCheckBoxVisibilityConverter.cs
-using Avalonia.Data.Converters;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Text;
-using WalletWasabi.Gui.Models;
-
-namespace WalletWasabi.Gui.Converters
-{
- public class SelectNonPrivateCheckBoxVisibilityConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is CoinListContainerType.CoinJoinTabViewModel)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
-}

Use AvaloniaProperty instead of Typecheck.