|
|
@ -19,14 +19,13 @@ namespace Avalonia.MonoMac |
|
|
public WindowBaseImpl() |
|
|
public WindowBaseImpl() |
|
|
{ |
|
|
{ |
|
|
_managedDrag = new ManagedWindowResizeDragHelper(this, _ => { }, ResizeForManagedDrag); |
|
|
_managedDrag = new ManagedWindowResizeDragHelper(this, _ => { }, ResizeForManagedDrag); |
|
|
Window = new CustomWindow(this) |
|
|
// ReSharper disable once VirtualMemberCallInConstructor
|
|
|
{ |
|
|
Window = CreateCustomWindow(); |
|
|
StyleMask = NSWindowStyle.Titled, |
|
|
Window.StyleMask = NSWindowStyle.Titled; |
|
|
BackingType = NSBackingStore.Buffered, |
|
|
Window.BackingType = NSBackingStore.Buffered; |
|
|
ContentView = View, |
|
|
Window.ContentView = View; |
|
|
// ReSharper disable once VirtualMemberCallInConstructor
|
|
|
// ReSharper disable once VirtualMemberCallInConstructor
|
|
|
Delegate = CreateWindowDelegate() |
|
|
Window.Delegate = CreateWindowDelegate(); |
|
|
}; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public class CustomWindow : NSWindow |
|
|
public class CustomWindow : NSWindow |
|
|
@ -57,6 +56,7 @@ namespace Avalonia.MonoMac |
|
|
public void SetCanBecomeKeyAndMain() => _canBecomeKeyAndMain = true; |
|
|
public void SetCanBecomeKeyAndMain() => _canBecomeKeyAndMain = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected virtual CustomWindow CreateCustomWindow() => new CustomWindow(this); |
|
|
protected virtual NSWindowDelegate CreateWindowDelegate() => new WindowBaseDelegate(this); |
|
|
protected virtual NSWindowDelegate CreateWindowDelegate() => new WindowBaseDelegate(this); |
|
|
|
|
|
|
|
|
public class WindowBaseDelegate : NSWindowDelegate |
|
|
public class WindowBaseDelegate : NSWindowDelegate |
|
|
|