public MainWindow() : base() { TinyIoCContainer.Current.Register<WebMarco.Backend.App.Common.BaseAppDelegate, AppDelegate>(AppDelegate.Instance); TinyIoCContainer.Current.Register<AppHelper.Data.Manager, Manager>(new Manager()); AppHelper.Data.ConnectDatabase(); /// Program entry point is here /// this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(730, 490); InitializeComponent(); MainView = new MainView(this); var mainWebView = (MainWebView)MainView; //browser = new ChromiumWebBrowser("http://html5test.com/"); mainWebView.Dock = DockStyle.Fill; //browser.BackColor = System.Drawing.Color.Blue; //mainWebView.DownloadHandler = new DownloadHandler(); //browser.MenuHandler = new MenuHandler(); mainWebView.NavStateChanged += OnBrowserNavStateChanged; mainWebView.ConsoleMessage += OnBrowserConsoleMessage; mainWebView.StatusMessage += OnBrowserStatusMessage; mainWebView.TitleChanged += OnBrowserTitleChanged; mainWebView.AddressChanged += OnBrowserAddressChanged; Controls.Add(mainWebView); //MainView.Load(); //TODO: here??! is it safe?..no:( }
protected override void OnCreate(Bundle bundle) { TinyIoCContainer.Current.Register<WebMarco.Backend.App.Common.BaseAppDelegate, AppDelegate>(AppDelegate.Instance); TinyIoCContainer.Current.Register<AppHelper.Data.Manager, Manager>(new Manager((Context)this)); AppHelper.Data.ConnectDatabase(); base.OnCreate(bundle); /// Program entry point is here MainView = new MainView(this); SetContentView((View)MainView); MainView.Load(); }
public override void MakeKeyAndVisible() { ///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); MainView.CurrentFrame = Rectangle.GetWithRectangleF(UIScreen.MainScreen.Bounds); //SetContentView((View)MainView); UIViewController rootViewController = new UIViewController(); rootViewController.View = (UIView)MainView; //MainView.Load(); //TODO: or here RootViewController = rootViewController; base.MakeKeyAndVisible(); MainView.Load(); //TODO: or here /// Program entry point is here }