All day I was receiving this very clear (not the sarcasm) error message "Value cannot be null. Parameter name: type" I was hitting my head against the wall slowly decomposing my code until I could figure out the exact cause of the problem. After much tedious deconstruction I discovered that I had an error in my GestureRecognizers
section. The problem was that I accidentally typed Command to try to pass a parameter instead of CommandParameter
.
My original code generating the error looked like this.
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="Value_Tapped" Command="language" />
</Label.GestureRecognizers>
The corrected code is this:
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="Value_Tapped" CommandParameter="language" />
</Label.GestureRecognizers>
I hope this helps someone else in the future.
I managed to fix the issue after following every steps from this post:
bin
and obj
directories from each project in the solution (YourProject
, YourProject.Android
, YourProject.iOS
)It appears if you try to set the Command property to something Xamarin Forms does not know you will get this error. If you get the error I suggest double checking all the non-intelisense correct parameters in your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With