Fix formatting & some refactoring
MODIFY
WalletWasabi.Fluent/Behaviors/SplitViewAutoBehavior.cs
WalletWasabi.Fluent/Behaviors/SplitViewAutoBehavior.cs
@@ -44,11 +44,12 @@ namespace WalletWasabi.Fluent.Behaviors
protected override void OnAttached()
{
- Disposables = new CompositeDisposable();
-
- Disposables.Add(AssociatedObject.WhenAnyValue(x => x.Bounds)
+ Disposables = new CompositeDisposable
+ {
+ AssociatedObject.WhenAnyValue(x => x.Bounds)
.DistinctUntilChanged()
- .Subscribe(SplitViewBoundsChanged));
+ .Subscribe(SplitViewBoundsChanged)
+ };
ToggleAction = OnToggleAction;
CollapseOnClickAction = OnCollapseOnClickAction;
@@ -65,25 +66,13 @@ namespace WalletWasabi.Fluent.Behaviors
}
private void OnToggleAction()
- {
- if (AssociatedObject.IsPaneOpen)
{
if (AssociatedObject.Bounds.Width > CollapseThreshold)
{
- _sidebarWasForceClosed = true;
+ _sidebarWasForceClosed = AssociatedObject.IsPaneOpen;
}
- AssociatedObject.IsPaneOpen = false;
- }
- else
- {
- if (AssociatedObject.Bounds.Width > CollapseThreshold)
- {
- _sidebarWasForceClosed = false;
- }
-
- AssociatedObject.IsPaneOpen = true;
- }
+ AssociatedObject.IsPaneOpen = !AssociatedObject.IsPaneOpen;
}
private void SplitViewBoundsChanged(Rect x)

MODIFY
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
@@ -117,15 +117,7 @@ namespace WalletWasabi.Fluent.ViewModels
this.WhenAnyValue(x => x.IsOpen)
.Subscribe(x => SelectedItem.IsExpanded = x);
- Dispatcher.UIThread.Post(() =>
- {
- LoadWallets(walletManager);
- });
- }
-
- public void DoToggleAction()
- {
- ToggleAction?.Invoke();
+ Dispatcher.UIThread.Post(() => LoadWallets(walletManager));
}
public ReactiveCommand<Unit, IRoutableViewModel> GoNext { get; }
@@ -224,6 +216,11 @@ namespace WalletWasabi.Fluent.ViewModels
public RoutingState Router { get; }
+ public void DoToggleAction()
+ {
+ ToggleAction?.Invoke();
+ }
+
private void LoadWallets(WalletManager walletManager)
{
foreach (var wallet in walletManager.GetWallets())

MODIFY
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
@@ -9,10 +9,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
Title = "Settings";
- NextCommand = ReactiveCommand.Create(() =>
- {
- screen.Router.Navigate.Execute(new HomePageViewModel(screen));
- });
+ NextCommand = ReactiveCommand.Create(() => screen.Router.Navigate.Execute(new HomePageViewModel(screen)));
}
public ICommand NextCommand { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletViewModel.cs
@@ -64,6 +64,8 @@ namespace WalletWasabi.Fluent.ViewModels
set => this.RaiseAndSetIfChanged(ref _actions, value);
}
+ public override string IconName => "web_asset_regular";
+
public static WalletViewModel Create(IScreen screen, UiConfig uiConfig, Wallet wallet)
{
return wallet.KeyManager.IsHardwareWallet
@@ -77,7 +79,5 @@ namespace WalletWasabi.Fluent.ViewModels
{
// TODO: Implement.
}
-
- public override string IconName => "web_asset_regular";
}
}

MODIFY
WalletWasabi.Fluent/Views/NavBar.axaml.cs
WalletWasabi.Fluent/Views/NavBar.axaml.cs
@@ -11,7 +11,7 @@ namespace WalletWasabi.Fluent.Views
{
public NavBar()
{
- this.InitializeComponent();
+ InitializeComponent();
}
private void InitializeComponent()

MODIFY
WalletWasabi.Fluent/Views/SettingsPageView.axaml.cs
WalletWasabi.Fluent/Views/SettingsPageView.axaml.cs
@@ -10,7 +10,7 @@ namespace WalletWasabi.Fluent.Views
{
public SettingsPageView()
{
- this.InitializeComponent();
+ InitializeComponent();
}
private void InitializeComponent()

Fix formatting & some refactoring