Is it possible to set element data context in MvvmCross? Suppose I have:
<RelativeLayout>
<TextView/> <TextView/>
</RelativeLayout>
and I'd like to set RelativeLayout data context to viewmodel property.
XAML equivalent of:
<Grid DataContext="{Binding someProperty}">
<TextBlock/> <TextBlock/>
</Grid>
You can't currently do this directly in a single axml file in MvvmCross at present.
However:
You can use MvxFrameControl
to load a sub-axml file (a bit like an include
) and then set the DataContext
for everything inside that sub-view
MvvmCross is open source - so you can extend and adapt it...