Skip to content

Commit

Permalink
move platformbinding for theme variant from WindowBase up to TopLevel.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmauss committed Jun 28, 2024
1 parent 6b0f09a commit e58784a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/Avalonia.Controls/TopLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ public TopLevel(ITopLevelImpl impl, IAvaloniaDependencyResolver? dependencyResol
impl.TransparencyLevelChanged = HandleTransparencyLevelChanged;

CreatePlatformImplBinding(TransparencyLevelHintProperty, hint => PlatformImpl.SetTransparencyLevelHint(hint ?? Array.Empty<WindowTransparencyLevel>()));
CreatePlatformImplBinding(ActualThemeVariantProperty, variant =>
{
variant ??= ThemeVariant.Default;
PlatformImpl?.SetFrameThemeVariant((PlatformThemeVariant?)variant ?? PlatformThemeVariant.Light);
});

_keyboardNavigationHandler?.SetOwner(this);
_accessKeyHandler?.SetOwner(this);
Expand Down
5 changes: 0 additions & 5 deletions src/Avalonia.Controls/WindowBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e58784a

Please sign in to comment.