Move the Open wallet folder button into search
MODIFY
WalletWasabi.Fluent/ViewModels/HomePageViewModel.cs
WalletWasabi.Fluent/ViewModels/HomePageViewModel.cs
@@ -3,12 +3,9 @@ using System.Collections.ObjectModel;
using System.Reactive.Linq;
using DynamicData;
using DynamicData.Binding;
-using System.Reactive;
-using System.IO;
using System.Reactive.Disposables;
using WalletWasabi.Fluent.ViewModels.AddWallet;
using WalletWasabi.Fluent.ViewModels.NavBar;
-using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels
{
@@ -42,15 +39,10 @@ namespace WalletWasabi.Fluent.ViewModels
.ObserveOn(RxApp.MainThreadScheduler)
.Bind(out _items)
.AsObservableList();
-
- OpenWalletsFolderCommand = ReactiveCommand.Create(
- () => IoHelpers.OpenFolderInFileExplorer(walletManager.Model.WalletDirectories.WalletsDir));
}
public ReadOnlyObservableCollection<NavBarItemViewModel> Items => _items;
- public ReactiveCommand<Unit, Unit> OpenWalletsFolderCommand { get; }
-
protected override void OnNavigatedTo(bool inStack, CompositeDisposable disposable)
{
base.OnNavigatedTo(inStack, disposable);

MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -32,6 +32,7 @@ namespace WalletWasabi.Fluent.ViewModels
private readonly SearchPageViewModel _searchPage;
private readonly PrivacyModeViewModel _privacyMode;
private readonly AddWalletPageViewModel _addWalletPage;
+ private readonly WalletManagerViewModel _walletManager;
public MainViewModel(Global global)
{
@@ -59,7 +60,7 @@ namespace WalletWasabi.Fluent.ViewModels
global.Synchronizer,
global.LegalDocuments);
- var walletManager = new WalletManagerViewModel(global.WalletManager, global.UiConfig);
+ _walletManager = new WalletManagerViewModel(global.WalletManager, global.UiConfig);
_addWalletPage = new AddWalletPageViewModel(
global.LegalDocuments,
@@ -69,10 +70,10 @@ namespace WalletWasabi.Fluent.ViewModels
_settingsPage = new SettingsPageViewModel(global.Config, global.UiConfig);
_privacyMode = new PrivacyModeViewModel(global.UiConfig);
- _homePage = new HomePageViewModel(walletManager, _addWalletPage);
+ _homePage = new HomePageViewModel(_walletManager, _addWalletPage);
_searchPage = new SearchPageViewModel();
- _navBar = new NavBarViewModel(MainScreen, walletManager);
+ _navBar = new NavBarViewModel(MainScreen, _walletManager);
RegisterCategories(_searchPage);
RegisterViewModels();
@@ -91,7 +92,7 @@ namespace WalletWasabi.Fluent.ViewModels
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x => IsDialogScreenEnabled = !x);
- walletManager.WhenAnyValue(x => x.Items.Count)
+ _walletManager.WhenAnyValue(x => x.Items.Count)
.Subscribe(x => _navBar.IsHidden = x == 0);
}
@@ -194,6 +195,12 @@ namespace WalletWasabi.Fluent.ViewModels
return legalDocs;
});
+
+ OpenWalletsFolderViewModel.RegisterLazy(() =>
+ {
+ IoHelpers.OpenFolderInFileExplorer(_walletManager.Model.WalletDirectories.WalletsDir);
+ return null;
+ });
}
private static void RegisterCategories(SearchPageViewModel searchPage)
@@ -201,6 +208,5 @@ namespace WalletWasabi.Fluent.ViewModels
searchPage.RegisterCategory("General", 0);
searchPage.RegisterCategory("Settings", 1);
}
-
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/HomePageView.axaml
WalletWasabi.Fluent/Views/HomePageView.axaml
x:DataType="vm:HomePageViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.HomePageView">
- <c:ContentArea Title="Home">
- <c:ContentArea.Caption>
- <DockPanel>
- <Button VerticalAlignment="Top" Padding="0" Classes="plain" DockPanel.Dock="Right" Command="{Binding OpenWalletsFolderCommand}" Margin="40 0 0 0">
- <StackPanel Orientation="Horizontal" Spacing="20">
- <PathIcon Data="{StaticResource open_regular}" />
- <TextBlock Text="Open Wallets folder" />
- </StackPanel>
- </Button>
- <TextBlock Text="Select a wallet below to continue or create a new one:" />
- </DockPanel>
- </c:ContentArea.Caption>
+ <c:ContentArea Title="Home"
+ Caption="Select a wallet below to continue or create a new one:">
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
<ItemsControl HorizontalAlignment="Left" Items="{Binding Items}">
<ItemsControl.ItemsPanel>

Move the Open wallet folder button into search