Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For this particular case, where you don't actually want to do any data-binding so you can just use a custom presenter - e.g. see @Blounty's answer, or see this project demo - <a href="https://github.com/fcaico/MvxSlidingPanels.Touch" rel="nofollow noreferrer">https://github.com/fcaico/MvxSlidingPanels.Touch</a></p> <hr> <p>If you ever do need to convert third party <code>ViewController</code> base classes so that they support data-binding, then the easiest way is exactly what you guessed:</p> <ul> <li>inherit from them to provide an <code>EventSource</code>-ViewController</li> <li>inherit from the <code>EventSource</code>-ViewController to add the Mvx BindingContext</li> </ul> <p>This technique is exactly how <code>MvvmCross</code> itself extends each of <code>UIViewController</code>, <code>UITableViewController</code>, <code>UITabBarController</code>, etc in order to provide data-binding.</p> <p>For example, see:</p> <ul> <li>extending UIViewController to provide an eventsource - <a href="https://github.com/slodge/MvvmCross/blob/v3/CrossCore/Cirrious.CrossCore.Touch/Views/MvxEventSourceViewController.cs" rel="nofollow noreferrer">MvxEventSourceViewController.cs</a></li> <li>extending the event source ViewController to provide a binding context - <a href="https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Touch/Views/MvxViewController.cs" rel="nofollow noreferrer">MvxViewController.cs</a></li> </ul> <p>Note that because C# doesn't have any Multiple-Inhertiance or any true Mixin support, this adaption of ViewControllers does involve a little cut-and-paste, but we have tried to minimise this through the use of event hooks and extension methods.</p> <p>If it helps, this iOS technique for a previous MvvmCross version was discussed in <a href="https://stackoverflow.com/questions/14518876/integrating-google-mobile-analytics-with-mvvmcross">Integrating Google Mobile Analytics with MVVMCross</a> (obviously this is out of date now - but the general principles kind of remain the same - we adapt an existing viewcontroller via inheritance)</p> <p>In Android, a similar process is also followed for Activity base classes - see <a href="https://stackoverflow.com/questions/16801728/actionbarsherlock-with-latest-mvvmcross/16807994#16807994">ActionBarSherlock with latest MVVMCross</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload