borepin/Borepin/Borepin.macOS/AppDelegate.cs

36 lines
1.0 KiB
C#
Raw Normal View History

2020-09-10 16:14:15 +02:00
using AppKit;
using Foundation;
using Xamarin.Forms;
using Xamarin.Forms.Platform.MacOS;
namespace Borepin.macOS
{
[Register("AppDelegate")]
public class AppDelegate : FormsApplicationDelegate
{
2021-03-30 20:54:53 +02:00
readonly NSWindow window;
2020-09-10 16:14:15 +02:00
public AppDelegate()
{
var style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
var rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);
2021-03-30 20:54:53 +02:00
window = new NSWindow(rect, style, NSBackingStore.Buffered, false)
{
Title = "Xamarin.Forms on Mac!", // choose your own Title here
TitleVisibility = NSWindowTitleVisibility.Hidden
};
2020-09-10 16:14:15 +02:00
}
public override NSWindow MainWindow
{
get { return window; }
}
public override void DidFinishLaunching(NSNotification notification)
{
Forms.Init();
2021-03-30 20:54:53 +02:00
LoadApplication(new App(new PlatformInitializer()));
2020-09-10 16:14:15 +02:00
base.DidFinishLaunching(notification);
}
}
}