some more autonotify.
MODIFY
WalletWasabi.Fluent/ViewModels/NavBar/NavBarItemViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBar/NavBarItemViewModel.cs
+using System;
using ReactiveUI;
using System.Windows.Input;
using WalletWasabi.Fluent.ViewModels.Navigation;
@@ -14,8 +15,8 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
public abstract partial class NavBarItemViewModel : RoutableViewModel
{
private bool _isSelected;
- private bool _isExpanded;
+ [AutoNotify] private bool _isExpanded;
[AutoNotify] private string _title;
protected NavBarItemViewModel()
@@ -27,6 +28,15 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
{
Navigate().To(this, NavigationMode.Clear);
});
+
+ this.WhenAnyValue(x => x.IsExpanded)
+ .Subscribe(x =>
+ {
+ if (Parent != null)
+ {
+ Parent.IsExpanded = x;
+ }
+ });
}
public NavBarItemViewModel? Parent { get; set; }
@@ -35,20 +45,6 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
public NavBarItemSelectionMode SelectionMode { get; protected set; }
- public bool IsExpanded
- {
- get => _isExpanded;
- set
- {
- this.RaiseAndSetIfChanged(ref _isExpanded, value);
-
- if (Parent != null)
- {
- Parent.IsExpanded = value;
- }
- }
- }
-
public bool IsSelected
{
get => _isSelected;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModelBase.cs
@@ -12,7 +12,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
public abstract partial class WalletViewModelBase : NavBarItemViewModel, IComparable<WalletViewModelBase>, IDisposable
{
[AutoNotify] private string _titleTip;
- private WalletState _walletState;
+ [AutoNotify(SetterModifier = AccessModifier.Private)] private WalletState _walletState;
private CompositeDisposable? _disposables;
private bool _disposedValue;
@@ -35,12 +35,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
.DisposeWith(_disposables);
}
- public WalletState WalletState
- {
- get => _walletState;
- private set => this.RaiseAndSetIfChanged(ref _walletState, value);
- }
-
public Wallet Wallet { get; }
public string WalletName => Wallet.WalletName;

some more autonotify.