diff --git a/src/ST.Client.Desktop.Avalonia.App/Views/MainWindow.axaml b/src/ST.Client.Desktop.Avalonia.App/Views/MainWindow.axaml
index ad42833f9..f4ae79561 100644
--- a/src/ST.Client.Desktop.Avalonia.App/Views/MainWindow.axaml
+++ b/src/ST.Client.Desktop.Avalonia.App/Views/MainWindow.axaml
@@ -8,6 +8,7 @@
xmlns:local="clr-namespace:System.Application.UI.Views;assembly=System.Application.SteamTools.Client.Desktop.Avalonia"
xmlns:vm="clr-namespace:System.Application.UI.ViewModels;assembly=System.Application.SteamTools.Client.Desktop"
xmlns:controls="clr-namespace:System.Application.UI.Views.Controls;assembly=System.Application.SteamTools.Client.Desktop.Avalonia"
+ xmlns:ms="clr-namespace:System.Application.Models.Settings;assembly=System.Application.SteamTools.Client.Desktop"
x:Class="System.Application.UI.Views.MainWindow"
x:Name="MainWindow"
WindowStartupLocation="CenterScreen"
@@ -23,11 +24,12 @@
-
-
-
+
+ -->
diff --git a/src/ST.Client.Desktop.Avalonia.App/Views/MainWindow.axaml.cs b/src/ST.Client.Desktop.Avalonia.App/Views/MainWindow.axaml.cs
index 125866d61..c78c114b7 100644
--- a/src/ST.Client.Desktop.Avalonia.App/Views/MainWindow.axaml.cs
+++ b/src/ST.Client.Desktop.Avalonia.App/Views/MainWindow.axaml.cs
@@ -20,10 +20,10 @@ namespace System.Application.UI.Views
//var background = this.FindControl("DesktopBackground");
//_backHandle = background.Handle;
- if (OperatingSystem2.IsWindows && !OperatingSystem2.IsWindows11AtLeast)
- {
- TransparencyLevelHint = WindowTransparencyLevel.Transparent;
- }
+ //if (OperatingSystem2.IsWindows && !OperatingSystem2.IsWindows11AtLeast)
+ //{
+ // TransparencyLevelHint = WindowTransparencyLevel.Transparent;
+ //}
#if DEBUG
this.AttachDevTools();
#endif
diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Controls/EmptyControl.cs b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Controls/EmptyControl.cs
index b2276cf5b..a87bfb01c 100644
--- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Controls/EmptyControl.cs
+++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Controls/EmptyControl.cs
@@ -16,27 +16,49 @@ namespace System.Application.UI.Views.Controls
public EmptyControl()
{
//this.InitializeComponent();
- if (OperatingSystem2.IsWindows && UISettings.EnableDesktopBackground.Value)
- {
- this.LayoutUpdated += EmptyControl_LayoutUpdated;
- this.AttachedToVisualTree += EmptyControl_AttachedToVisualTree;
- this.DetachedFromVisualTree += EmptyControl_DetachedFromVisualTree;
- window = new Window
+
+ this.GetObservable(IsVisibleProperty)
+ .Subscribe(x =>
{
- Width = this.Bounds.Width,
- Height = this.Bounds.Height,
- Background = Avalonia.Media.Brushes.Transparent,
- WindowStartupLocation = WindowStartupLocation.Manual,
- WindowState = WindowState.Normal,
- ExtendClientAreaToDecorationsHint = true,
- ExtendClientAreaChromeHints = Avalonia.Platform.ExtendClientAreaChromeHints.PreferSystemChrome,
- SystemDecorations = SystemDecorations.Full,
- CanResize = false,
- TransparencyLevelHint = WindowTransparencyLevel.Transparent,
- ShowInTaskbar = false,
- Focusable = false
- };
- }
+ if (x)
+ {
+ if (window == null)
+ {
+ this.LayoutUpdated += EmptyControl_LayoutUpdated;
+ this.AttachedToVisualTree += EmptyControl_AttachedToVisualTree;
+ this.DetachedFromVisualTree += EmptyControl_DetachedFromVisualTree;
+ window = new Window
+ {
+ Width = this.Bounds.Width,
+ Height = this.Bounds.Height,
+ Background = Avalonia.Media.Brushes.Transparent,
+ WindowStartupLocation = WindowStartupLocation.Manual,
+ WindowState = WindowState.Normal,
+ ExtendClientAreaToDecorationsHint = true,
+ ExtendClientAreaChromeHints = Avalonia.Platform.ExtendClientAreaChromeHints.PreferSystemChrome,
+ SystemDecorations = SystemDecorations.Full,
+ CanResize = false,
+ TransparencyLevelHint = WindowTransparencyLevel.Transparent,
+ ShowInTaskbar = false,
+ Focusable = false
+ };
+ if (Parent != null && VisualRoot != null)
+ EmptyControl_AttachedToVisualTree(null, new VisualTreeAttachmentEventArgs(Parent, VisualRoot));
+ }
+ }
+ else
+ {
+ if (window != null)
+ {
+ if (Parent != null && VisualRoot != null)
+ EmptyControl_DetachedFromVisualTree(null, new VisualTreeAttachmentEventArgs(Parent, VisualRoot));
+ this.LayoutUpdated -= EmptyControl_LayoutUpdated;
+ this.AttachedToVisualTree -= EmptyControl_AttachedToVisualTree;
+ this.DetachedFromVisualTree -= EmptyControl_DetachedFromVisualTree;
+ window = null;
+ }
+ }
+ });
}
private void EmptyControl_DetachedFromVisualTree(object? sender, VisualTreeAttachmentEventArgs e)
diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/Settings/Settings_UI.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/Settings/Settings_UI.axaml
index bacd4a750..8a2f3ae73 100644
--- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/Settings/Settings_UI.axaml
+++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/Settings/Settings_UI.axaml
@@ -106,12 +106,12 @@
-
+