Componentalize a bit more
MODIFY
WalletWasabi.Fluent/Views/Shell/MainView.axaml
WalletWasabi.Fluent/Views/Shell/MainView.axaml
x:Class="WalletWasabi.Fluent.Views.Shell.MainView"
x:DataType="viewModels:MainViewModel"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- d:DesignWidth="1400" d:DesignHeight="1000"
+ xmlns:shell="clr-namespace:WalletWasabi.Fluent.Views.Shell"
+ d:DesignWidth="1200" d:DesignHeight="1000"
x:CompileBindings="True">
- <Grid ShowGridLines="True" RowDefinitions="48, *">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="68" />
- <ColumnDefinition Width="10*" />
- <ColumnDefinition Width="35*" MinWidth="200" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="150" />
- </Grid.ColumnDefinitions>
-
- <Viewbox Height="18" Width="18" IsHitTestVisible="False">
- <Image Source="{DynamicResource wasabi_logo_dynamic}" />
- </Viewbox>
-
- <WrapPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
- <WrapPanel.Styles>
- <Style Selector="TextBlock">
- <Setter Property="Margin" Value="3 0" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
- </WrapPanel.Styles>
- <TextBlock Foreground="{DynamicResource AcrylicTrimForeground}" Classes="h8" Text="Wasabi Wallet" />
- <TextBlock Foreground="{DynamicResource AcrylicTrimForeground}" Classes="h8" Opacity="0.6" Text="TESTNET PREVIEW" />
- </WrapPanel>
-
- <navbar:NavBar Grid.Row="1" Grid.Column="0" DataContext="{Binding NavBar}" />
-
- <Border x:Name="ContentPart" Grid.Row="1" Grid.Column="1" BorderBrush="{DynamicResource TileBorderColor}" BorderThickness="1 1 0 0" Grid.ColumnSpan="3" CornerRadius="10 0 0 0" ClipToBounds="True">
+ <DockPanel>
+ <shell:TitleBarView IsHitTestVisible="False" DockPanel.Dock="Top" />
+ <DockPanel>
+ <navbar:NavBar DockPanel.Dock="Left" DataContext="{Binding NavBar}" />
+ <Border x:Name="ContentPart" BorderBrush="{DynamicResource TileBorderColor}" BorderThickness="1 1 0 0"
+ CornerRadius="10 0 0 0" ClipToBounds="True">
<Panel>
- <Border CornerRadius="10 0 0 0" Background="{DynamicResource RegionColor}" ClipToBounds="True" IsHitTestVisible="False" />
+ <Border CornerRadius="10 0 0 0" Background="{DynamicResource RegionColor}" ClipToBounds="True"
+ IsHitTestVisible="False" />
<Panel VerticalAlignment="Bottom"
Height="100">
<spectrum:SpectrumControl Opacity="0.6" IsActive="{Binding IsCoinJoinActive}"
HorizontalAlignment="Center" Height="66" />
<ContentControl ClipToBounds="False" Content="{Binding MainScreen.CurrentPage}" />
</DockPanel>
- <Border CornerRadius="10 0 0 0" BoxShadow="inset 0 0 5 0 #000000" ClipToBounds="True" IsHitTestVisible="False" Margin="0 0 -5 -5" />
+ <Border CornerRadius="10 0 0 0" BoxShadow="inset 0 0 5 0 #000000" ClipToBounds="True"
+ IsHitTestVisible="False" Margin="0 0 -5 -5" />
</Panel>
</Border>
-
- <searchBar:SearchBar DataContext="{Binding SearchBar}" VerticalAlignment="Stretch" HorizontalAlignment="Center"
- Grid.Row="0" Grid.Column="2" />
-
- <statusBar:StatusBar Grid.Column="{ext:Platform 2, Osx=3}" Margin="0 0 5 0" Foreground="{DynamicResource AcrylicTrimForeground}" DataContext="{Binding StatusBar}" HorizontalAlignment="Right" VerticalAlignment="Center" />
- </Grid>
+ </DockPanel>
+ </DockPanel>
</UserControl>

ADD
WalletWasabi.Fluent/Views/Shell/TitleBarView.axaml
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:ext="using:WalletWasabi.Fluent.Helpers"
+ xmlns:statusBar="clr-namespace:WalletWasabi.Fluent.Views.StatusBar"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:searchBar="clr-namespace:WalletWasabi.Fluent.Views.SearchBar"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ x:Class="WalletWasabi.Fluent.Views.Shell.TitleBarView">
+ <Grid>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="68" />
+ <ColumnDefinition Width="10*" MinWidth="130" />
+ <ColumnDefinition Width="35*" MinWidth="200" />
+ <ColumnDefinition Width="10*" />
+ <ColumnDefinition Width="5*" MinWidth="150" />
+ </Grid.ColumnDefinitions>
+
+ <Viewbox Height="18" Width="18" IsHitTestVisible="False">
+ <Image Source="{DynamicResource wasabi_logo_dynamic}" />
+ </Viewbox>
+
+ <WrapPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
+ <WrapPanel.Styles>
+ <Style Selector="TextBlock">
+ <Setter Property="Margin" Value="3 0" />
+ <Setter Property="VerticalAlignment" Value="Center" />
+ </Style>
+ </WrapPanel.Styles>
+ <TextBlock Foreground="{DynamicResource AcrylicTrimForeground}" Classes="h8" Text="Wasabi Wallet" />
+ <TextBlock Foreground="{DynamicResource AcrylicTrimForeground}" Classes="h8" Opacity="0.6" Text="TESTNET PREVIEW" />
+ </WrapPanel>
+
+ <searchBar:SearchBar DataContext="{Binding SearchBar}" VerticalAlignment="Stretch" HorizontalAlignment="Center"
+ Grid.Row="0" Grid.Column="2" />
+
+ <statusBar:StatusBar Grid.Column="{ext:Platform 3, Osx=4}" Margin="0 0 5 0"
+ Foreground="{DynamicResource AcrylicTrimForeground}" DataContext="{Binding StatusBar}"
+ HorizontalAlignment="Right" VerticalAlignment="Center" />
+ </Grid>
+</UserControl>
\ No newline at end of file

ADD
WalletWasabi.Fluent/Views/Shell/TitleBarView.axaml.cs
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace WalletWasabi.Fluent.Views.Shell;
+public partial class TitleBarView : UserControl
+{
+ public TitleBarView()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}

Componentalize a bit more