Simplifying the above answer with C#6
public partial class NestedViewController : ViewController
{
protected PropertyCollectionSource PropertyCollectionSource => (View as ListView)?.CollectionSource as PropertyCollectionSource;
protected object MasterObject => PropertyCollectionSource?.MasterObject;
}
Also I moved it into a function
public static class HandyControllerFunctions
{
public static object GetMasterObject(View view)
{
var propertyCollectionSource = (view as ListView)?.CollectionSource as PropertyCollectionSource;
return propertyCollectionSource?.MasterObject ;
}
}
and call it for example
var myObject = HandyControllerFunctions.GetMasterObject(View) as IMyObject