Xamarin.Android Features
Presented below is the list of features which MugenMvvm provides to Xamarin.Android:
- Work with
Activity
is supported. There are exists MugenMvvm implementation for each of standard AndroidActivity
(name convention is 'Mvvm'+<activity's name>). In order to successfully work with MugenMvvm you must inherit appropriateMvvm
implementation ofActivity
. For instance, if you would match aActivity
with a ViewModel, so after you callShowAsync
navigation onActivity
of this type will be made. - Work with
Fragment
is supported. There are exists MugenMvvm implementation for each of standard AndroidFragment
(name convention is 'Mvvm'+<fragment's name>). In order to successfully work with MugenMvvm you must inherit appropriateMvvm
implementation ofFragment
. For instance, if you would match aMvvmDialogFragment
with a ViewModel, so after you callShowAsync
method instance will be shown. - State control for
Activity
andFragment
is supported. States of anyActivity
orFragment
are tracked "behind the scene", therefore you haven't manually invoke methods for save/restore the state of ViewModel. - Back stack navigation is supported.
- Markup binding is supported. In order to use binding on Android one must add the next namepace in
xml
file:
xmlns:pkg="http://schemas.android.com/apk/res-auto
After that Bind
attribute is available to use in xml layout.
- Bindings for
ActionBar
,Toolbar
,PopupMenu
andOptionsMenu
are supported. - There is implemented a conception of
DataTemplateSelector
, so one can select view template dynamically in runtime. ThisDataTemplateSelector
is analogue of conception ofDataTemplateSelector
for Xaml platform (WPF, WinRT, etc). - Validation with usage of standard
TextView.Error
property is supported.
Updated less than a minute ago