xamarin.ios - Integrating third party controller with MVVMCross on MonoTouch -
i want use third party view controller inherits uiviewcontroller (https://bitbucket.org/thedillonb/monotouch.slideoutnavigation/src/f4e51488598b/monotouch.slideoutnavigation?at=master), how integrate mvvmcross?
i take source , change inherit mvxviewcontroller, guessing run other libraries.
do need implement interfaces mvxviewcontroller does? imvxtouchview? imvxeventsourceviewcontroller?
for particular case, don't want data-binding can use custom presenter - e.g. see @blounty's answer, or see project demo - https://github.com/fcaico/mvxslidingpanels.touch
if ever need convert third party viewcontroller
base classes support data-binding, easiest way guessed:
- inherit them provide
eventsource
-viewcontroller - inherit
eventsource
-viewcontroller add mvx bindingcontext
this technique how mvvmcross
extends each of uiviewcontroller
, uitableviewcontroller
, uitabbarcontroller
, etc in order provide data-binding.
for example, see:
- extending uiviewcontroller provide eventsource - mvxeventsourceviewcontroller.cs
- extending event source viewcontroller provide binding context - mvxviewcontroller.cs
note because c# doesn't have multiple-inhertiance or true mixin support, adaption of viewcontrollers involve little cut-and-paste, have tried minimise through use of event hooks , extension methods.
if helps, ios technique previous mvvmcross version discussed in integrating google mobile analytics mvvmcross (obviously out of date - general principles kind of remain same - adapt existing viewcontroller via inheritance)
in android, similar process followed activity base classes - see actionbarsherlock latest mvvmcross
Comments
Post a Comment