Use a behaviour to bind window size.
ADD
WalletWasabi.Gui/Behaviors/BindWindowSizeBehavior.cs
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Xaml.Interactivity;
+using System;
+using System.Linq;
+using System.Reactive.Linq;
+
+namespace WalletWasabi.Gui.Behaviors
+{
+ public class BindWindowSizeBehavior : Behavior<Window>
+ {
+ private Size _maxSize;
+
+ /// <summary>
+ /// Defines the <see cref="Width"/> property.
+ /// </summary>
+ public static readonly StyledProperty<double> WidthProperty =
+ AvaloniaProperty.Register<BindWindowSizeBehavior, double>(nameof(Width), double.NaN);
+
+ /// <summary>
+ /// Defines the <see cref="Height"/> property.
+ /// </summary>
+ public static readonly StyledProperty<double> HeightProperty =
+ AvaloniaProperty.Register<BindWindowSizeBehavior, double>(nameof(Height), double.NaN);
+
+ /// <summary>
+ /// Gets or sets the width of the element.
+ /// </summary>
+ public double Width
+ {
+ get { return GetValue(WidthProperty); }
+ set { SetValue(WidthProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets or sets the height of the element.
+ /// </summary>
+ public double Height
+ {
+ get { return GetValue(HeightProperty); }
+ set { SetValue(HeightProperty, value); }
+ }
+
+ protected override void OnAttached()
+ {
+ base.OnAttached();
+
+ var screen = AssociatedObject.Screens.ScreenFromPoint(AssociatedObject.Position);
+
+ _maxSize = screen.WorkingArea.Size.ToSize(screen.PixelDensity) * 0.95;
+
+ this.GetObservable(HeightProperty)
+ .Where(x => !double.IsNaN(x))
+ .Subscribe(x =>
+ {
+ if (x >= _maxSize.Height)
+ {
+ AssociatedObject.Height = _maxSize.Height;
+ }
+ });
+
+ this.GetObservable(WidthProperty)
+ .Where(x => !double.IsNaN(x))
+ .Subscribe(x =>
+ {
+ if (x >= _maxSize.Width)
+ {
+ AssociatedObject.Width = _maxSize.Width;
+ }
+ });
+ }
+ }
+}

MODIFY
WalletWasabi.Gui/MainWindow.xaml
WalletWasabi.Gui/MainWindow.xaml
xmlns:ia="clr-namespace:Avalonia.Xaml.Interactions.Core;assembly=Avalonia.Xaml.Interactions"
xmlns:id="clr-namespace:Dock.Avalonia;assembly=Dock.Avalonia"
xmlns:idc="clr-namespace:Dock.Avalonia.Controls;assembly=Dock.Avalonia"
- xmlns:beh="clr-namespace:AvalonStudio.Utils.Behaviors;assembly=AvalonStudio.Utils"
+ xmlns:beh="clr-namespace:WalletWasabi.Gui.Behaviors"
x:Class="WalletWasabi.Gui.MainWindow"
Icon="avares://WalletWasabi.Gui/Assets/WasabiLogo256.png"
Title="{Binding Title}"
MinWidth="1100" MinHeight="530"
FontFamily="{DynamicResource UiFont}" FontSize="14"
Foreground="{DynamicResource ThemeForegroundBrush}"
- Width="{Binding Width}" Height="{Binding Height}"
WindowState="{Binding WindowState}"
UseLayoutRounding="True"
WindowStartupLocation="CenterScreen"
RenderOptions.BitmapInterpolationMode="HighQuality">
+ <i:Interaction.Behaviors>
+ <beh:BindWindowSizeBehavior Width="{Binding Width}" Height="{Binding Height}" />
+ </i:Interaction.Behaviors>
<cont:MetroWindow.TitleBarContent>
<StackPanel Orientation="Horizontal" IsVisible="{Binding MenuVisible}">
<menu:MainMenuView DataContext="{Binding Shell.MainMenu}" Margin="4 0 0 0" Foreground="{DynamicResource ThemeForegroundBrush}" VerticalAlignment="Stretch" FontSize="13" />

MODIFY
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
@@ -46,6 +46,7 @@ namespace WalletWasabi.Gui.ViewModels
Width = uiConfig.Width;
Height = uiConfig.Height;
+
WindowState = uiConfig.WindowState;
InitializeLockScreen(global.UiConfig);

Use a behaviour to bind window size.