Browse Source

add scafolding for native osx menu

pull/2978/head
Dan Walmsley 7 years ago
parent
commit
8520eb32bc
  1. 25
      src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
  2. 8
      src/Avalonia.Native/WindowImpl.cs

25
src/Avalonia.Native/AvaloniaNativeMenuExporter.cs

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
using Avalonia.Controls;
using Avalonia.Controls.Platform;
namespace Avalonia.Native
{
class AvaloniaNativeMenuExporter : ITopLevelNativeMenuExporter
{
public bool IsNativeMenuExported => throw new NotImplementedException();
public event EventHandler OnIsNativeMenuExportedChanged;
public void SetNativeMenu(NativeMenu menu)
{
throw new NotImplementedException();
}
public void SetPrependApplicationMenu(bool prepend)
{
throw new NotImplementedException();
}
}
}

8
src/Avalonia.Native/WindowImpl.cs

@ -3,13 +3,14 @@
using System;
using Avalonia.Controls;
using Avalonia.Controls.Platform;
using Avalonia.Native.Interop;
using Avalonia.Platform;
using Avalonia.Platform.Interop;
namespace Avalonia.Native
{
public class WindowImpl : WindowBaseImpl, IWindowImpl
public class WindowImpl : WindowBaseImpl, IWindowImpl, ITopLevelImplWithNativeMenuExporter
{
private readonly IAvaloniaNativeFactory _factory;
private readonly AvaloniaNativePlatformOptions _opts;
@ -22,6 +23,8 @@ namespace Avalonia.Native
{
Init(_native = factory.CreateWindow(e), factory.CreateScreens());
}
NativeMenuExporter = new AvaloniaNativeMenuExporter();
}
class WindowEvents : WindowBaseEvents, IAvnWindowEvents
@ -104,6 +107,9 @@ namespace Avalonia.Native
}
public Func<bool> Closing { get; set; }
public ITopLevelNativeMenuExporter NativeMenuExporter { get; }
public void Move(PixelPoint point) => Position = point;
public override IPopupImpl CreatePopup() =>

Loading…
Cancel
Save