Closed mufid closed 8 years ago
Can you try adding this to the Setup.cs file on Droid:
protected override void FillTargetFactories(IMvxTargetBindingFactoryRegistry registry)
{
MvxAppCompatSetupHelper.FillTargetFactories(registry);
base.FillTargetFactories(registry);
}
Is there something missing / i should add? It says that "no suitable method to override"
Edit: i should use MvvmCross.Binding.Bindings.Target.Construction;
namespace. I didn't know why Intellisense does not automatically use that for me. Now working on it.
Thanks! Now it is working perfectly. We can close this issue, but i wonder what FillTargetFactories
does?
Thing here is that the MvxSpinner in this case is actually a MvxAppCompatSpinner and not an MvxSpinner directly. The original binding targets are made for non-AppCompat widgets and view. A new set of binding targets were made for AppCompat specific views. However, they are not applied automatically. This is also missing from the example you are using, so adding that specific line registers those new view types to their respective bindings.
I got error when attaching MvxSpinner inside a MvxFragment. However, it works fine inside an MvxActivity
Steps to reproduce
From the attached example repo:
Also, i get this error message:
05-09 13:03:31.125 2360 2360 I MvxBind : 21.60 Failed to create target binding for binding SelectedItem for FruitSelected
Example code of the issue available below.
Expected behavior
The SelectedItem should be changed
Actual behavior
It does nothing
Configuration
Version: 4.0.0 (I also test in latest 4.1 version, but the results are the same). Platform: Android
Code
Only important details attached here. Complete git repository exists here: https://github.com/mufid/MvxSpinner-Bug
fragment_spinner.axml
SpinnerViewModel.cs