AppDelegate.cs 964 B

12345678910111213141516171819202122232425262728293031323334
  1. using AppKit;
  2. using Foundation;
  3. using Xamarin.Forms;
  4. using Xamarin.Forms.Platform.MacOS;
  5. namespace macOSForms
  6. {
  7. [Register("AppDelegate")]
  8. public class AppDelegate : FormsApplicationDelegate
  9. {
  10. NSWindow _window;
  11. public AppDelegate()
  12. {
  13. var style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
  14. var rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);
  15. _window = new NSWindow(rect, style, NSBackingStore.Buffered, false);
  16. _window.Title = "TipCalc";
  17. _window.TitleVisibility = NSWindowTitleVisibility.Hidden;
  18. }
  19. public override NSWindow MainWindow
  20. {
  21. get { return _window; }
  22. }
  23. public override void DidFinishLaunching(NSNotification notification)
  24. {
  25. Forms.Init();
  26. LoadApplication(new App());
  27. base.DidFinishLaunching(notification);
  28. }
  29. }
  30. }