borepin/Borepin/Borepin.macOS/AppDelegate.cs

39 lines
1.1 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
{
2022-01-03 21:13:03 +00:00
readonly NSWindow _Window;
2020-09-10 16:14:15 +02:00
public AppDelegate()
{
2022-01-03 21:13:03 +00:00
NSWindowStyle style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
2020-09-10 16:14:15 +02:00
2022-01-03 21:13:03 +00:00
CoreGraphics.CGRect rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);
_Window = new NSWindow(rect, style, NSBackingStore.Buffered, false)
2021-03-30 20:54:53 +02:00
{
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
{
2022-01-03 21:13:03 +00:00
get
{
return _Window;
}
2020-09-10 16:14:15 +02:00
}
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);
}
}
}