Added NavigationTarget
MODIFY
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
@@ -9,7 +9,7 @@ namespace WalletWasabi.Fluent.ViewModels
private string _walletName = "";
private bool _optionsEnabled;
- public AddWalletPageViewModel(NavigationStateViewModel navigationState) : base(navigationState)
+ public AddWalletPageViewModel(NavigationStateViewModel navigationState) : base(navigationState, NavigationTarget.Dialog)
{
Title = "Add Wallet";

MODIFY
WalletWasabi.Fluent/ViewModels/HomePageViewModel.cs
WalletWasabi.Fluent/ViewModels/HomePageViewModel.cs
@@ -12,7 +12,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
private readonly ReadOnlyObservableCollection<NavBarItemViewModel> _items;
- public HomePageViewModel(NavigationStateViewModel navigationState, WalletManagerViewModel walletManager, AddWalletPageViewModel addWalletPage) : base(navigationState)
+ public HomePageViewModel(NavigationStateViewModel navigationState, WalletManagerViewModel walletManager, AddWalletPageViewModel addWalletPage) : base(navigationState, NavigationTarget.Home)
{
Title = "Home";

MODIFY
WalletWasabi.Fluent/ViewModels/NavBarItemViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarItemViewModel.cs
@@ -12,13 +12,22 @@ namespace WalletWasabi.Fluent.ViewModels
private bool _isExpanded;
private string _title;
- public NavBarItemViewModel(NavigationStateViewModel navigationState)
+ public NavBarItemViewModel(NavigationStateViewModel navigationState, NavigationTarget navigationTarget)
{
_navigationState = navigationState;
OpenCommand = ReactiveCommand.Create(() =>
{
+ switch (navigationTarget)
+ {
+ case NavigationTarget.Default:
+ case NavigationTarget.Home:
_navigationState.HomeScreen().Router.Navigate.Execute(this);
+ break;
+ case NavigationTarget.Dialog:
+ _navigationState.DialogScreen().Router.Navigate.Execute(this);
+ break;
+ }
});
}

MODIFY
WalletWasabi.Fluent/ViewModels/NavigationStateViewModel.cs
WalletWasabi.Fluent/ViewModels/NavigationStateViewModel.cs
@@ -4,6 +4,13 @@ using WalletWasabi.Fluent.ViewModels.Dialogs;
namespace WalletWasabi.Fluent.ViewModels
{
+ public enum NavigationTarget
+ {
+ Default = 0,
+ Home = 1,
+ Dialog = 2
+ }
+
public class NavigationStateViewModel
{
public Func<IScreen> HomeScreen { get; set; }

MODIFY
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
@@ -15,7 +15,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
private string _randomString;
- public SettingsPageViewModel(NavigationStateViewModel navigationState) : base(navigationState)
+ public SettingsPageViewModel(NavigationStateViewModel navigationState) : base(navigationState, NavigationTarget.Dialog)
{
Title = "Settings";

MODIFY
WalletWasabi.Fluent/ViewModels/WalletViewModelBase.cs
WalletWasabi.Fluent/ViewModels/WalletViewModelBase.cs
@@ -15,7 +15,7 @@ namespace WalletWasabi.Fluent.ViewModels
private CompositeDisposable _disposables;
private bool _disposedValue;
- public WalletViewModelBase(NavigationStateViewModel navigationState, Wallet wallet) : base(navigationState)
+ public WalletViewModelBase(NavigationStateViewModel navigationState, Wallet wallet) : base(navigationState, NavigationTarget.Home)
{
Wallet = Guard.NotNull(nameof(wallet), wallet);

Added NavigationTarget