Updated to Preview 14
This commit is contained in:
Родитель
cbc87b682f
Коммит
52ae3cd09e
|
@ -7,10 +7,10 @@ namespace DrasticOverlay
|
|||
{
|
||||
internal static AView? GetNative(this IElement view, bool returnWrappedIfPresent)
|
||||
{
|
||||
if (view.Handler is INativeViewHandler nativeHandler && nativeHandler.NativeView != null)
|
||||
return nativeHandler.NativeView;
|
||||
if (view.Handler is IPlatformViewHandler nativeHandler && nativeHandler.PlatformView != null)
|
||||
return nativeHandler.PlatformView;
|
||||
|
||||
return (view.Handler?.NativeView as AView);
|
||||
return (view.Handler?.PlatformView as AView);
|
||||
}
|
||||
|
||||
public static NavigationRootManager GetNavigationRootManager(this IMauiContext mauiContext) =>
|
||||
|
|
|
@ -7,10 +7,10 @@ namespace DrasticOverlay
|
|||
{
|
||||
internal static FrameworkElement? GetNative(this IElement view, bool returnWrappedIfPresent)
|
||||
{
|
||||
if (view.Handler is INativeViewHandler nativeHandler && nativeHandler.NativeView != null)
|
||||
return nativeHandler.NativeView;
|
||||
if (view.Handler is IPlatformViewHandler nativeHandler && nativeHandler.PlatformView != null)
|
||||
return nativeHandler.PlatformView;
|
||||
|
||||
return (view.Handler?.NativeView as FrameworkElement);
|
||||
return (view.Handler?.PlatformView as FrameworkElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ namespace DrasticOverlay
|
|||
{
|
||||
internal static UIView? GetNative(this IElement view, bool returnWrappedIfPresent)
|
||||
{
|
||||
if (view.Handler is INativeViewHandler nativeHandler && nativeHandler.NativeView != null)
|
||||
return nativeHandler.NativeView;
|
||||
if (view.Handler is IPlatformViewHandler nativeHandler && nativeHandler.PlatformView != null)
|
||||
return nativeHandler.PlatformView;
|
||||
|
||||
return (view.Handler?.NativeView as UIView);
|
||||
return (view.Handler?.PlatformView as UIView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace DrasticOverlay.Overlays
|
|||
return false;
|
||||
|
||||
var handler = Window.Handler as WindowHandler;
|
||||
if (handler?.NativeView is not Microsoft.UI.Xaml.Window _window)
|
||||
if (handler?.PlatformView is not Microsoft.UI.Xaml.Window _window)
|
||||
return false;
|
||||
|
||||
var panel = _window.Content as Microsoft.UI.Xaml.Controls.Panel;
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace DrasticOverlay.Overlays
|
|||
return false;
|
||||
|
||||
|
||||
if (handler.NativeView is not Activity activity)
|
||||
if (handler.PlatformView is not Activity activity)
|
||||
return false;
|
||||
|
||||
_nativeActivity = activity;
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace DrasticOverlay.Overlays
|
|||
if (_nativeElement == null)
|
||||
return false;
|
||||
var handler = Window.Handler as WindowHandler;
|
||||
if (handler?.NativeView is not Microsoft.UI.Xaml.Window _window)
|
||||
if (handler?.PlatformView is not Microsoft.UI.Xaml.Window _window)
|
||||
return false;
|
||||
|
||||
_panel = _window.Content as Panel;
|
||||
|
|
|
@ -31,6 +31,8 @@ namespace DrasticOverlay.Overlays
|
|||
|
||||
public bool IsNativeViewInitialized { get; private set; }
|
||||
|
||||
public bool IsPlatformViewInitialized { get; set; }
|
||||
|
||||
public event EventHandler<WindowOverlayTappedEventArgs> Tapped;
|
||||
|
||||
public bool AddWindowElement(IWindowOverlayElement element)
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace DrasticOverlay.Overlays
|
|||
return false;
|
||||
|
||||
var handler = Window.Handler as Microsoft.Maui.Handlers.WindowHandler;
|
||||
if (handler?.NativeView is not Microsoft.UI.Xaml.Window _window)
|
||||
if (handler?.PlatformView is not Microsoft.UI.Xaml.Window _window)
|
||||
return false;
|
||||
|
||||
this.panel = _window.Content as Microsoft.UI.Xaml.Controls.Panel;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace DrasticOverlay.Overlays
|
|||
|
||||
var handler = Window.Handler as Microsoft.Maui.Handlers.WindowHandler;
|
||||
|
||||
if (handler?.NativeView is not Microsoft.UI.Xaml.Window _window)
|
||||
if (handler?.PlatformView is not Microsoft.UI.Xaml.Window _window)
|
||||
return false;
|
||||
|
||||
if (handler.MauiContext == null)
|
||||
|
@ -50,7 +50,7 @@ namespace DrasticOverlay.Overlays
|
|||
|
||||
this.page = page;
|
||||
var pageHandler = page.ToHandler(this.mauiContext);
|
||||
element = pageHandler.NativeView;
|
||||
element = pageHandler.PlatformView;
|
||||
if (element != null)
|
||||
panel.Children.Add(element);
|
||||
pageSet = true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче