Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Whenever I bind Command to a Button, the button is always inactive, what could I be doing wrong?

$
0
0

Situation: Every time I bind Command<T> to a button in my project the button is always inactive.

Steps I followed:
1. WORKED: Downloaded the source code for the Xamarin DataBinding examples (https://developer.xamarin.com/samples/xamarin-forms/DataBindingDemos/) and ran the project without any changes and everything worked as expected, paying particular attention to DecimalKeypad which is the simplest example I found of a Command<T> binding.
2. DID NOT WORK: Added the three required files for the DecimalKeypad example from the DataBindingDemos example into my project and made NO changes to the files. Page displays but the Command<T> buttons are inactive...

It seems like I'm missing something fundamental to how Command<T> is supposed to work. See below the fold for examples of other things I've tried.

Any suggestions?

Other things I've tried (adding below the fold to simplify the question)
3. DID NOT WORK: Followed the example from https://devblogs.microsoft.com/xamarin/simplifying-events-with-commanding/ and as soon as I tried the Command<T> example, the button became disabled...
4. DID NOT WORK: Followed the code from https://forums.xamarin.com/discussion/90049/button-disabled-with-viewmodel and updated it to be a Command<T> button, since the example was only for Command, and it stopped working as soon as I implemented Command<T>.

Thank you so much for any help you can offer!
Tim


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>