Binding a decimal to a UITextField does not allow you to put a ".". in, when you type "1.", clicking on the source blocks it. I understand why this happens, MakeSafeValue converts it to decimal, which is read without ".", Overwriting the entered text. This seems like a problem with keyup vs onblur, with which many binding mechanisms allow you to override.
I know that I could bind a string to a view model, but processing EditingDidEnd instead of EditingChanged looks better. That way I could intercept ShouldEndEditing to validate.
Where would I register my binding to override the implementation of MvvmCross? I tried adding to my Setup.FillTargetFactories, but it is called before MVXTouchBinding.FillTargetFactories, where is MvvmCross.
I tried a different property name, in FillTargetFactories I have:
registry.RegisterPropertyInfoBindingFactory(typeof (UITextFieldTextDidEndTargetBinding), typeof (UITextField), "DidEndText");
but it does not work when I contact.
set.Bind(textField).For("DidEndText").To(vm => vm.GMoney);
looks like MvxPropertyInfoTargetBindingFactory.CreateBinding does not work if the target does not have this property = makes sense. Does this mean that I start with MvxTargetBinding and create a custom binding? I don't like to recreate most of the code in MvxPropertyInfoTargetBinding.
So, I think the question (s) ...
- What is the syntax / location to override the default UITextField binding with mine?
- How can I specify a different binding for text with binding syntax?
Thanks in advance.