simplified navbar seperated into sections.
MODIFY
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
@@ -13,15 +13,24 @@ namespace WalletWasabi.Fluent.ViewModels
public class NavBarViewModel : ViewModelBase
{
private ObservableCollection<NavBarItemViewModel> _items;
+ private ObservableCollection<NavBarItemViewModel> _topItems;
+ private ObservableCollection<NavBarItemViewModel> _bottomItems;
private NavBarItemViewModel _selectedItem;
private Dictionary<Wallet, WalletViewModelBase> _walletDictionary;
private bool _anyWalletStarted;
public NavBarViewModel(WalletManager walletManager, UiConfig uiConfig)
{
+ _topItems = new ObservableCollection<NavBarItemViewModel>();
_items = new ObservableCollection<NavBarItemViewModel>();
+ _bottomItems = new ObservableCollection<NavBarItemViewModel>();
+
_walletDictionary = new Dictionary<Wallet, WalletViewModelBase>();
+ _topItems.Add(new HomePageViewModel());
+ _bottomItems.Add(new AddWalletPageViewModel());
+ _bottomItems.Add(new SettingsPageViewModel());
+
Observable
.FromEventPattern<WalletState>(walletManager, nameof(WalletManager.WalletStateChanged))
.ObserveOn(RxApp.MainThreadScheduler)
@@ -70,16 +79,36 @@ namespace WalletWasabi.Fluent.ViewModels
set => this.RaiseAndSetIfChanged(ref _anyWalletStarted, value);
}
+ public ObservableCollection<NavBarItemViewModel> TopItems
+ {
+ get { return _topItems; }
+ set { this.RaiseAndSetIfChanged(ref _topItems, value); }
+ }
+
+
public ObservableCollection<NavBarItemViewModel> Items
{
get { return _items; }
set { this.RaiseAndSetIfChanged(ref _items, value); }
}
+ public ObservableCollection<NavBarItemViewModel> BottomItems
+ {
+ get { return _bottomItems; }
+ set { this.RaiseAndSetIfChanged(ref _bottomItems, value); }
+ }
+
public NavBarItemViewModel SelectedItem
{
get { return _selectedItem; }
- set { this.RaiseAndSetIfChanged(ref _selectedItem, value); }
+ set
+ {
+ _selectedItem = null;
+
+ this.RaisePropertyChanged();
+
+ this.RaiseAndSetIfChanged(ref _selectedItem, value);
+ }
}
private void LoadWallets(WalletManager walletManager)

MODIFY
WalletWasabi.Fluent/Views/NavBar.axaml
WalletWasabi.Fluent/Views/NavBar.axaml
<Setter Property="Margin" Value="{DynamicResource MenuFlyoutSeparatorThemePadding}" />
<Setter Property="Height" Value="{DynamicResource MenuFlyoutSeparatorThemeHeight}" />
</Style>
+ <Style Selector="ListBox">
+ <Setter Property="Margin" Value="0" />
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Padding" Value="0" />
+ </Style>
</UserControl.Styles>
- <DockPanel Margin="1">
- <StackPanel DockPanel.Dock="Top" Margin="0 20 0 0">
- <TextBlock Text="Wasabi Wallet" Foreground="White" FontSize="16" Margin="15 10 0 10" />
+ <UserControl.DataTemplates>
+ <DataTemplate DataType="vm:HomePageViewModel">
<c:NavBarItem>
<StackPanel Orientation="Horizontal" Spacing="20">
<PathIcon Data="{StaticResource home_regular}" />
<TextBlock Text="Home" />
</StackPanel>
</c:NavBarItem>
- <Separator />
- </StackPanel>
-
- <StackPanel DockPanel.Dock="Bottom">
- <Separator />
+ </DataTemplate>
+ <DataTemplate DataType="vm:SettingsPageViewModel">
<c:NavBarItem>
<StackPanel Orientation="Horizontal" Spacing="20">
<PathIcon Data="{StaticResource settings_regular}" />
<TextBlock Text="Settings" />
</StackPanel>
</c:NavBarItem>
- </StackPanel>
-
- <DockPanel>
- <c:NavBarItem DockPanel.Dock="Top">
+ </DataTemplate>
+ <DataTemplate DataType="vm:AddWalletPageViewModel">
+ <c:NavBarItem>
<StackPanel Orientation="Horizontal" Spacing="20">
<PathIcon Data="{StaticResource add_circle_regular}" />
<TextBlock Text="Add Wallet" />
</StackPanel>
</c:NavBarItem>
- <ListBox Items="{Binding Items}" Background="Transparent" Margin="0" Padding="0">
- <ListBox.Styles>
- <Style Selector="ListBoxItem">
- <Setter Property="Padding" Value="0" />
- </Style>
- <Style Selector="ListBoxItem:pressed /template/ Rectangle#PressedBackground, ListBoxItem:selected /template/ Rectangle#PressedBackground, ListBoxItem:pointerover /template/ Rectangle#PressedBackground">
- <Setter Property="Fill" Value="Transparent"/>
- </Style>
- </ListBox.Styles>
- <ListBox.DataTemplates>
+ </DataTemplate>
<DataTemplate DataType="vm:ClosedWalletViewModel">
+ <StackPanel>
<c:NavBarItem>
<StackPanel Orientation="Horizontal" Spacing="20">
<PathIcon Data="{StaticResource web_asset_regular}" />
<TextBlock Text="{Binding Title}" />
</StackPanel>
</c:NavBarItem>
- </DataTemplate>
- </ListBox.DataTemplates>
+ <ListBox>
+ <ListBoxItem>
+ <c:NavBarItem>
+ <StackPanel Orientation="Horizontal" Spacing="20">
+ <PathIcon Data="{StaticResource add_circle_regular}" />
+ <TextBlock Text="Send" />
+ </StackPanel>
+ </c:NavBarItem>
+ </ListBoxItem>
+ <ListBoxItem>
+ <c:NavBarItem>
+ <StackPanel Orientation="Horizontal" Spacing="20">
+ <PathIcon Data="{StaticResource add_circle_regular}" />
+ <TextBlock Text="Receive" />
+ </StackPanel>
+ </c:NavBarItem>
+ </ListBoxItem>
</ListBox>
- </DockPanel>
+ </StackPanel>
+ </DataTemplate>
+ </UserControl.DataTemplates>
+ <DockPanel Margin="1">
+ <StackPanel DockPanel.Dock="Top" Margin="0 20 0 0">
+ <TextBlock Text="Wasabi Wallet" Foreground="White" FontSize="16" Margin="15 10 0 10" />
+
+ <ListBox Items="{Binding TopItems}" SelectedItem="{Binding SelectedItem}" />
+
+ <Separator />
+ </StackPanel>
+
+ <StackPanel DockPanel.Dock="Bottom">
+ <Separator />
+ <ListBox Items="{Binding BottomItems}" SelectedItem="{Binding SelectedItem}" />
+ </StackPanel>
+
+ <ListBox Items="{Binding Items}" SelectedItem="{Binding SelectedItem}" />
</DockPanel>
</UserControl>

simplified navbar seperated into sections.