We're implementing our own cross platform framework using the binding capabilities of MvvmCross Core. My question is how can custom bindings be registered within Mvx without the setup. Custom binding used is an imeActionBinding similar to: https://gist.github.com/slodge/8270923 attempted registration using:
Mvx.CallbackWhenRegistered<IMvxTargetBindingFactoryRegistry>(RegisterCustomBindings);
protected virtual void RegisterCustomBindings(IMvxTargetBindingFactoryRegistry registry)
{
EditTextImeActionBinding.Register(registry);
}
Tried the same thing with project ChimpLight in the LightSetup:
Mvx.RegisterSingleton<IMvxTargetBindingFactoryRegistry>(new MvxTargetBindingFactoryRegistry());
var customBindingRegistry = Mvx.Resolve<IMvxTargetBindingFactoryRegistry>();
EditTextImeActionBinding.Register(customBindingRegistry);
xaml:
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Search"
android:inputType="text"
android:imeOptions="actionSearch"
local:MvxBind="Text LastName;ImeAction ResetCommand" />
no exceptions - but it seems the custom binding never gets loaded :|
what am I missing?
Thanks to Stuart for the simple answer: use the existing binding. Using the N-30 Chimplight example code, the only added code to LightSetup class is:
Mvx.CallbackWhenRegistered<IMvxTargetBindingFactoryRegistry>(registry =>
{
EditTextImeActionBinding.Register(registry);
});