Ejemplo n.º 1
0
        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
//                }
//            });
        }
Ejemplo n.º 2
0
        // 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);
        }