AtomLayer uses VisualLayerManager as second choice for host

This commit is contained in:
zeroone 2024-10-11 09:43:09 +08:00
parent 86491701d0
commit bc2039b3d1
3 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=primitives_005Catomlayer/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -2,6 +2,6 @@ namespace AtomUI.Controls;
public enum DrawerOpenMode
{
Overlay,
Push,
Overlay = 0,
Push = 1,
}

View File

@ -1,6 +1,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Layout;
using Avalonia.VisualTree;
@ -25,6 +26,8 @@ public static class AtomLayerExtension
}
}
host ??= target.FindAncestorOfType<VisualLayerManager>();
host ??= TopLevel.GetTopLevel(target);
if (host == null)