I have a view in a MonoTouch app using MvvmCross framework that I would like displayed Modal (NavigationController.PresentModalViewController).
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
MvvmCross starts from the premise that all ViewModels are just “normal pages” – so in iOS/MonoTouch that means UIViewControllers presented using a UINavigationController.
To move away from this premise – towards tabbed displays, modal displays, split controllers, popups, etc – then you can adjust the Presenter logic within your MonoTouch app.
The presenter’s job is to implement:
The presenter used for your app is selected in AppDelegate construction – e.g. see how the TwitterSearch builds different presenters for iPhone and iPad.
Fortunately, for simple Modal support, one of the standard presenters available is MvxModalSupportTouchViewPresenter.cs
This presenter looks to see if the view being presented has the
IMvxModalTouchViewmarker interface – it testsview is IMvxModalTouchView. If this interface is present, then it uses modal presentation for the view instead of “normal navigation”.To use this, change your AppDelegate code to something:
Then add the marker interface to your modal View(s):