Setup IsExpanded props.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletAdvancedViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletAdvancedViewModel.cs
using ReactiveUI;
using System.Collections.ObjectModel;
+using System.Reactive;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -7,9 +8,20 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
private ObservableCollection<WalletActionViewModel> _items;
+ private bool _isExpanded;
+
+ public ReactiveCommand<Unit, Unit> ExpandItCommand { get; }
+
+ public bool IsExpanded
+ {
+ get => _isExpanded;
+ set => this.RaiseAndSetIfChanged(ref _isExpanded, value);
+ }
+
public WalletAdvancedViewModel(WalletViewModel walletViewModel) : base(walletViewModel.Name, walletViewModel)
{
Items = new ObservableCollection<WalletActionViewModel>();
+ ExpandItCommand = ReactiveCommand.Create(() => { IsExpanded = !IsExpanded; });
}
public ObservableCollection<WalletActionViewModel> Items

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
<TreeView BorderThickness="0" Items="{Binding Wallets}" SelectedItem="{Binding SelectedItem}">
<TreeView.Styles>
<Style Selector="TreeViewItem">
- <Setter Property="IsExpanded" Value="True" />
+ <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
</Style>
</TreeView.Styles>
<TreeView.DataTemplates>
</TreeDataTemplate>
<TreeDataTemplate DataType="ViewModels:WalletAdvancedViewModel" ItemsSource="{Binding Items}">
- <Button BorderThickness="0" Background="Transparent" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left">
+ <Button BorderThickness="0" Background="Transparent" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" Command="{Binding ExpandItCommand}">
<StackPanel Orientation="Horizontal" Spacing="6">
<DrawingPresenter Width="20" Height="20">
<DrawingPresenter.Drawing>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -19,6 +19,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private ObservableCollection<WalletActionViewModel> _actions;
private string _title;
+ private bool _isExpanded;
+
+ public bool IsExpanded
+ {
+ get => _isExpanded;
+ set => this.RaiseAndSetIfChanged(ref _isExpanded, value);
+ }
public WalletViewModel(WalletService walletService, bool receiveDominant)
: base(Path.GetFileNameWithoutExtension(walletService.KeyManager.FilePath))
@@ -94,6 +101,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
SetBalance(Name);
}).DisposeWith(Disposables);
+
+ IsExpanded = true;
}
public void OnWalletClosed()

Setup IsExpanded props.