Binding a decimal to a UITextField does not let you put a "." in, as you type "1.", the push to source strips it out. I get why it happens, MakeSafeValue converts it to a decimal, which gets read back out without the ".", overwriting the Text entered. This seems like a keyup vs onblur issue, which a lot of binding frameworks let you override.
I know I could bind a string on the view model instead, but handling the EditingDidEnd instead of EditingChanged seems better. That way I could intercept ShouldEndEditing to check validity.
Where would I register my binding to override the MvvmCross implementation? I tried adding in my Setup.FillTargetFactories, but it is called before MVXTouchBindingBuilder.FillTargetFactories where the MvvmCross one is.
I tried a different property name, in FillTargetFactories I have:
registry.RegisterPropertyInfoBindingFactory(typeof (UITextFieldTextDidEndTargetBinding), typeof (UITextField), "DidEndText");
but it does not work when I bind.
set.Bind(textField).For("DidEndText").To(vm => vm.GMoney);
looks like MvxPropertyInfoTargetBindingFactory.CreateBinding does not work if the target does not have that property = makes sense. Does this leave me with starting at MvxTargetBinding and creating a custom binding? I hate to recreate most of the code in MvxPropertyInfoTargetBinding.
So, I guess the question(s) are...
- what is the syntax/location to override the default UITextField binding with mine?
- how can I specify a different binding for Text with the Bind Syntax?
Thanks in advance.