diff --git a/src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs b/src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs index 18cad0aebfc..c78945d4a0a 100644 --- a/src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs +++ b/src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs @@ -191,11 +191,6 @@ public SystemBarTheme? SystemBarTheme { _statusBarTheme = value; - if (!_topLevel.View.IsShown) - { - return; - } - var compat = new WindowInsetsControllerCompat(Window, _topLevel.View); if (_isDefaultSystemBarLightTheme == null) @@ -229,11 +224,6 @@ public bool? IsSystemBarVisible { _systemUiVisibility = value; - if (!_topLevel.View.IsShown) - { - return; - } - var compat = WindowCompat.GetInsetsController(Window, _topLevel.View); if (value == null || value.Value) diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs index b9b0c29523b..e6957ddda46 100644 --- a/src/Avalonia.Controls/TopLevel.cs +++ b/src/Avalonia.Controls/TopLevel.cs @@ -232,6 +232,11 @@ public TopLevel(ITopLevelImpl impl, IAvaloniaDependencyResolver? dependencyResol impl.TransparencyLevelChanged = HandleTransparencyLevelChanged; CreatePlatformImplBinding(TransparencyLevelHintProperty, hint => PlatformImpl.SetTransparencyLevelHint(hint ?? Array.Empty())); + CreatePlatformImplBinding(ActualThemeVariantProperty, variant => + { + variant ??= ThemeVariant.Default; + PlatformImpl?.SetFrameThemeVariant((PlatformThemeVariant?)variant ?? PlatformThemeVariant.Light); + }); _keyboardNavigationHandler?.SetOwner(this); _accessKeyHandler?.SetOwner(this); diff --git a/src/Avalonia.Controls/WindowBase.cs b/src/Avalonia.Controls/WindowBase.cs index 6715c8e4bc3..fa4db1b6b9e 100644 --- a/src/Avalonia.Controls/WindowBase.cs +++ b/src/Avalonia.Controls/WindowBase.cs @@ -48,11 +48,6 @@ static WindowBase() public WindowBase(IWindowBaseImpl impl) : this(impl, AvaloniaLocator.Current) { CreatePlatformImplBinding(TopmostProperty, topmost => PlatformImpl!.SetTopmost(topmost)); - CreatePlatformImplBinding(ActualThemeVariantProperty, variant => - { - variant ??= ThemeVariant.Default; - PlatformImpl?.SetFrameThemeVariant((PlatformThemeVariant?)variant ?? PlatformThemeVariant.Light); - }); FrameSize = impl.FrameSize; }