Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

iOS custom UIViewControllers

$
0
0

Background: We have a cross platform MVVM framework (similar to MvvMCross), which contains it's own navigation.
For the windows and android platforms, XF works just fine, because we can define our own Page/Activity with navigation mappings which get instantiated by the navigation framework. We then just call SetContent / SetPage on the Page /Activity and all is well.
So in essence our views for both windows and android are empty containers which are filled with the XF content defined on the XF Page.

So I figured in iOS I could define a UIViewController, and in the ViewDidLoad override somehow set the content to that coming from the XF Page, but have had no luck so far - because it seems the method in iOS is to create it's own UIViewController.

Is there a way to load the UI content from a XF Page into your own UIViewController?

here's an example of what we're doing in android, in the OnCreate() override of our own Activity:

      Forms.Init(this, savedInstanceState);
      XFormPage.BindingContext = ViewModel;
      SetPage(XFormPage);

Is it possible to do something similar in our own UIViewController?


Viewing all articles
Browse latest Browse all 58056

Trending Articles