public BaseWindow(Rectangle frame) : base(new System.Drawing.RectangleF( (float)(frame.TopLeft.X), (float)(frame.TopLeft.Y), (float)(frame.Width), (float)(frame.Height)), NSWindowStyle.Resizable, NSBackingStore.Buffered, false) { InitializeComponent(); }
// Shared initialization code void Initialize () { //does center itself in MakeKeyAndFront to replicate iOS behaviour //Point centerOfScreen = new Rectangle(NSScreen.MainScreen.Frame).Center; var rectangle = new Rectangle (new Point (0, 0), 800, 700);//TODO: must come from config, like last position etc Window = new BridgeTry.Mac.MainWindow (rectangle); //Window.CurrentFrame.Center = centerOfScreen;//TODO:Make it work and cross platform //Window.SetFrameOrigin (new System.Drawing.PointF ((float)(centerOfScreen.X), (float)(centerOfScreen.Y))); Window.StyleMask = NSWindowStyle.Miniaturizable | NSWindowStyle.Resizable | NSWindowStyle.Titled; Window.Center (); base.Window = (NSWindow)Window; }
public override void MakeKeyAndOrderFront(NSObject sender) { ///Is not necessary //TinyIoCContainer.Current.Register<WebMarco.Backend.App.Common.BaseAppDelegate, AppDelegate>((AppDelegate)(AppDelegate.Instance)); //TinyIoCContainer.Current.Register<AppHelper.Data.Manager, Manager>(new Manager()); //AppHelper.Data.ConnectDatabase();//TODO: noo has to be done async - otherwise will kill the app on huge db load due to timeout MainView = new MainView(this); Point center = new Rectangle (NSScreen.MainScreen.Frame).Center; MainView.CurrentFrame = Rectangle.GetBaseWithRectangleF(Frame);//TODO: must come from settings, like last position and size etc ContentView = (NSView)MainView; base.MakeKeyAndOrderFront(sender); MainView.Load(); //TODO: or here /// Program entry point is here }
public MainWindow(Rectangle frame) : base(frame){ }
public MainWindow(Rectangle frame) : base(frame) { ///Initialization, can be after base.OnCreate(bundle); though BaseAppDelegate.Instance.StartServer(ProcessCallFromFrontend); //TODO: has to be some sort of check to ensure or even enforce that server was started }