MvvmCross iOS presenter IMvxTouchView.ViewModel is null -


i working on project involves mvvmcross. ios, use custom presenter inherits mvxtouchviewpresenter.

    public override void show(imvxtouchview view)     {       var viewcontroller = view uiviewcontroller;       if (viewcontroller == null)              throw new mvxexception("passed in imvxtouchview not           uiviewcontroller");      if (_masternavigationcontroller == null)              showfirstview(viewcontroller);      else              _masternavigationcontroller.pushviewcontroller(viewcontroller, true /*animated*/);       var myviewmodel = view.viewmodel;      //do staff myviewmodel       } 

my problem in cases myviewmodel null @ moment. created later on ... when viewcontroller loaded. looks timing problem... interesting fact code worked @ previous mvvmcross project.

i tried use :

     var myviewmodel = view.reflectiongetviewmodel (); 

unfortunately result same :( having idea how fix or work around problem ?

mvvmcross creates viewmodel part of base.viewdidload() within viewcontroller - if viewdidload has not been called there won't viewmodel yet.

based on this:


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -