Add IsLoggedIn property
MODIFY
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
@@ -50,6 +50,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
if (!IsPasswordIncorrect)
{
wallet.Login();
+ walletViewModelBase.RaisePropertyChanged(nameof(WalletViewModelBase.IsLoggedIn));
// TODO: navigate to the wallet welcome page
Navigate().To(walletViewModelBase, NavigationMode.Clear);

MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -147,28 +147,30 @@ namespace WalletWasabi.Fluent.ViewModels
return;
}
- if (SelectedWallet is WalletViewModelBase walletViewModelPrevious && walletViewModelPrevious.Wallet.IsLoggedIn
- && item is WalletViewModelBase walletViewModel && walletViewModel.Wallet.IsLoggedIn)
+ if (SelectedWallet is { IsLoggedIn: true } walletViewModelPrevious /*&& item is WalletViewModelBase { IsLoggedIn: true }*/)
{
- if (item is WalletViewModelBase && SelectedWallet != item)
+ if (item is not WalletActionViewModel && SelectedWallet != item)
+ {
+ //if (item is WalletViewModelBase && SelectedWallet != item)
{
RemoveActions(walletViewModelPrevious);
SelectedWallet = null;
}
}
+ }
- if (item is WalletViewModelBase walletViewModelSelected && walletViewModelSelected.Wallet.IsLoggedIn)
+ if (item is WalletViewModelBase { IsLoggedIn: true} walletViewModelItem)
{
- if (!_walletActionsDictionary.TryGetValue(walletViewModelSelected, out var actions))
+ if (!_walletActionsDictionary.TryGetValue(walletViewModelItem, out var actions))
{
actions = new List<NavBarItemViewModel>();
- _walletActionsDictionary[walletViewModelSelected] = actions;
+ _walletActionsDictionary[walletViewModelItem] = actions;
}
- InsertActions(walletViewModelSelected, actions);
+ InsertActions(walletViewModelItem, actions);
- SelectedWallet = walletViewModelSelected;
+ SelectedWallet = walletViewModelItem;
}
}
@@ -210,7 +212,8 @@ namespace WalletWasabi.Fluent.ViewModels
_items.Remove(walletViewModel);
_actions.Add(walletViewModel);
#endif
- var index = _wallets.IndexOf(walletViewModel);
+ //var index = _wallets.IndexOf(walletViewModel);
+ var index = 1;
if (index >= 0)
{
var insertIndex = index;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModelBase.cs
@@ -53,6 +53,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
public string WalletName => Wallet.WalletName;
+ public bool IsLoggedIn => Wallet.IsLoggedIn;
+
public int CompareTo([AllowNull] WalletViewModelBase other)
{
if (WalletState != other!.WalletState)

MODIFY
WalletWasabi.Fluent/Views/NavBar/NavBar.axaml
WalletWasabi.Fluent/Views/NavBar/NavBar.axaml
<Binding Path="IconName" Converter="{x:Static conv:NavBarIconConverter.Instance}" />
</PathIcon.Data>
</PathIcon>
- <Ellipse DataContext="{Binding Wallet}" IsVisible="{Binding IsLoggedIn}" Width="9" Height="9" Margin="15,13,0,0" Fill="#F2994A"/>
+ <Ellipse IsVisible="{Binding IsLoggedIn, Mode=OneWay}" Width="9" Height="9" Margin="15,13,0,0" Fill="#F2994A"/>
</Panel>
<TextBlock Text="{Binding Title}" Margin="55 0 0 0" />
</Panel>
<Binding Path="IconName" Converter="{x:Static conv:NavBarIconConverter.Instance}" />
</PathIcon.Data>
</PathIcon>
- <Ellipse DataContext="{Binding Wallet}" IsVisible="{Binding IsLoggedIn}" Width="9" Height="9" Margin="15,13,0,0" Fill="#F2994A"/>
+ <Ellipse IsVisible="{Binding IsLoggedIn, Mode=OneWay}" Width="9" Height="9" Margin="15,13,0,0" Fill="#F2994A"/>
</Panel>
<TextBlock Text="{Binding Title}" Margin="55 0 0 0" />
</Panel>
<Binding Path="IconName" Converter="{x:Static conv:NavBarIconConverter.Instance}" />
</PathIcon.Data>
</PathIcon>
- <Ellipse DataContext="{Binding Wallet}" IsVisible="{Binding IsLoggedIn}" Width="9" Height="9" Margin="15,13,0,0" Fill="#F2994A"/>
+ <Ellipse IsVisible="{Binding IsLoggedIn, Mode=OneWay}" Width="9" Height="9" Margin="15,13,0,0" Fill="#F2994A"/>
</Panel>
<TextBlock Text="{Binding Title}" Margin="55 0 0 0" />
</Panel>

Add IsLoggedIn property