login basics
MODIFY
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
@@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive.Linq;
using System.Threading.Tasks;
+using WalletWasabi.Fluent.ViewModels.Login;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Fluent.ViewModels.Wallets;
@@ -43,7 +44,17 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
this.WhenAnyValue(x => x.SelectedItem)
.OfType<NavBarItemViewModel>()
- .Subscribe(NavigateItem);
+ .Subscribe(x =>
+ {
+ if (x is WalletViewModelBase {IsLoggedIn: false} wallet)
+ {
+ x.Navigate().To(new LoginViewModel(wallet));
+ }
+ else
+ {
+ NavigateItem(x);
+ }
+ });
this.WhenAnyValue(x => x.Items.Count)
.Subscribe(x =>

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWalletViewModel.cs
@@ -5,6 +5,8 @@ using System.Reactive;
using System.Reactive.Linq;
using System.Threading.Tasks;
using WalletWasabi.Fluent.ViewModels.NavBar;
+using WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet;
+using WalletWasabi.Fluent.ViewModels.Wallets.WatchOnlyWallet;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Logging;
using WalletWasabi.Wallets;

RENAME
WalletWasabi.Fluent/ViewModels/Wallets/ClosedHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/HardwareWallet/ClosedHardwareWalletViewModel.cs
using WalletWasabi.Wallets;
-namespace WalletWasabi.Fluent.ViewModels.Wallets
+namespace WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet
{
public class ClosedHardwareWalletViewModel : ClosedWalletViewModel
{

RENAME
WalletWasabi.Fluent/ViewModels/Wallets/HardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/HardwareWallet/HardwareWalletViewModel.cs
using WalletWasabi.Gui;
using WalletWasabi.Wallets;
-namespace WalletWasabi.Fluent.ViewModels.Wallets
+namespace WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet
{
public class HardwareWalletViewModel : WalletViewModel
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -6,6 +6,8 @@ using System.Collections.ObjectModel;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet;
+using WalletWasabi.Fluent.ViewModels.Wallets.WatchOnlyWallet;
using WalletWasabi.Gui;
using WalletWasabi.Logging;
using WalletWasabi.Wallets;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModelBase.cs
@@ -35,6 +35,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
.DisposeWith(_disposables);
}
+ public bool IsLoggedIn { get; set; }
+
public Wallet Wallet { get; }
public string WalletName => Wallet.WalletName;

RENAME
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWatchOnlyWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WatchOnlyWallet/ClosedWatchOnlyWalletViewModel.cs
using WalletWasabi.Wallets;
-namespace WalletWasabi.Fluent.ViewModels.Wallets
+namespace WalletWasabi.Fluent.ViewModels.Wallets.WatchOnlyWallet
{
public class ClosedWatchOnlyWalletViewModel : ClosedWalletViewModel
{

RENAME
WalletWasabi.Fluent/ViewModels/Wallets/WatchOnlyWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WatchOnlyWallet/WatchOnlyWalletViewModel.cs
using WalletWasabi.Gui;
using WalletWasabi.Wallets;
-namespace WalletWasabi.Fluent.ViewModels.Wallets
+namespace WalletWasabi.Fluent.ViewModels.Wallets.WatchOnlyWallet
{
public class WatchOnlyWalletViewModel : WalletViewModel
{

ADD
WalletWasabi.Fluent/Views/Login/LoginView.axaml
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:i="using:Avalonia.Xaml.Interactivity"
+ xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
+ xmlns:login="clr-namespace:WalletWasabi.Fluent.ViewModels.Login"
+ xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ x:DataType="login:LoginViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Login.LoginView">
+ <controls:ContentArea Title="Login"
+ Caption="Enter your password to access your wallet"
+ ScrollViewer.VerticalScrollBarVisibility="Disabled">
+ <DockPanel>
+ <StackPanel>
+ <Viewbox MaxHeight="200">
+ <Image Source="/Assets/HardwareIcons/ledger.png" />
+ </Viewbox>
+ </StackPanel>
+
+ <Button Content="Left"
+ DockPanel.Dock="Left"
+ VerticalAlignment="Bottom"/>
+
+ <Button Content="Right"
+ DockPanel.Dock="Right"
+ VerticalAlignment="Bottom"
+ Command="{Binding NextCommand}"/>
+ </DockPanel>
+ </controls:ContentArea>
+</UserControl>

RENAME
WalletWasabi.Fluent/Views/Wallets/LoginView.axaml.cs
WalletWasabi.Fluent/Views/Login/LoginView.axaml.cs
using Avalonia.Controls;
+using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
-namespace WalletWasabi.Fluent.Views.Wallets
+namespace WalletWasabi.Fluent.Views.Login
{
public class LoginView : UserControl
{

MODIFY
WalletWasabi.Fluent/Views/Wallets/ClosedHardwareWalletView.axaml
WalletWasabi.Fluent/Views/Wallets/ClosedHardwareWalletView.axaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c="using:WalletWasabi.Fluent.Controls"
- xmlns:local="using:WalletWasabi.Fluent.Views.Wallets"
+ xmlns:login="clr-namespace:WalletWasabi.Fluent.Views.Login"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="WalletWasabi.Fluent.Views.Wallets.ClosedHardwareWalletView">
- <c:ContentArea Title="Login" Caption="Enter your password to access your wallet" ScrollViewer.VerticalScrollBarVisibility="Disabled">
- <DockPanel>
- <local:LoginView DockPanel.Dock="Bottom" />
- <Viewbox MaxHeight="200">
- <Image Source="/Assets/HardwareIcons/ledger.png" />
- </Viewbox>
- </DockPanel>
- </c:ContentArea>
+ Hello Wasabi!
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Wallets/ClosedWalletView.axaml
WalletWasabi.Fluent/Views/Wallets/ClosedWalletView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c="using:WalletWasabi.Fluent.Controls"
xmlns:local="using:WalletWasabi.Fluent.Views.Wallets"
+ xmlns:login="clr-namespace:WalletWasabi.Fluent.Views.Login"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="WalletWasabi.Fluent.Views.Wallets.ClosedWalletView">
- <c:ContentArea Title="Login" Caption="Enter your password to access your wallet" ScrollViewer.VerticalScrollBarVisibility="Disabled">
- <DockPanel>
- <local:LoginView DockPanel.Dock="Bottom" />
- <Viewbox MaxHeight="200">
- <Image Source="/Assets/HardwareIcons/normal.png" />
- </Viewbox>
- </DockPanel>
- </c:ContentArea>
+ Hello Wasabi!
</UserControl>

login basics