public override void ViewDidLoad() { base.ViewDidLoad (); var webHybrid = new WebHybrid (this.webView, new SimplyMobile.Text.ServiceStack.JsonSerializer()); string homePageUrl = NSBundle.MainBundle.BundlePath + "/Content/ButtonClicks.html"; this.webView.LoadRequest (new NSUrlRequest (new NSUrl (homePageUrl, false))); this.model = new NavigationViewModel ( Resolver.GetService<INavigationController> (), webHybrid); // webHybrid.RegisterCallback ("openNativeView", idString => // { // int id; // if (int.TryParse(idString, out id)) // { // var newViewController = new NewViewController(id); // this.NavigationController.PushViewController(newViewController, true); // } // else // { // // notify something here // } // }); }
// Constructor public MainPage() { InitializeComponent(); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); this.webHybrid = new WebHybrid(this.webView, new SimplyMobile.Text.JsonNet.JsonSerializer()); this.webView.Navigate(new Uri("HTML/ButtonClicks.html", UriKind.Relative)); this.model = new NavigationViewModel(Resolver.GetService<INavigationController>(), this.webHybrid); //this.model = new NavigationViewModel( // new NavigationDelegate<NewItemViewModel>( model => // { // }), // this.webHybrid); }