Monday 15 April 2013

mvvm - Using MvxCommand With CommandParameter binding -


I am trying to fire, but facing the following problem: MyView.axml contains: < / P>

  & lt; LinearLayout Android: Orientation = "Horizontal" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" & gt; & Lt; Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: text = "button 1" local: MvxBind = "click on micomand, commandpamator = ef" /> & Lt; Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: text = "button 2" local: MvxBind = "click on micomand, commandpameter = bar" /> & Lt; / LinearLayout & gt;   

MyViewModel.cs: Public class MyViewModel: MvxViewModel {public ICommand MyCommand {get; Private set; } Public MyViewModel () {// The ultimate tap is MyCommand = new MvxCommand & lt; String & gt; (Param => {if (param == "foo") {// do something} and if (param == "bar") {// do something else}}); }}

But when I check param variable null

What am I doing wrong?

Your code is working for me on the head of my source tree.

But this functionality is only two weeks old. My guess is that this feature has not been released either on which you are working or there is a bug with it.

> Can you check your debug trace for this binding? Is there any information?

  • If you find that commandpalmter is an unknown symbol, then my guess is that you have to either create the latest source - or
  • If the trace gives some more suggestions, then you may be able to patch the problem during setup.

    One thing I know is that we had a value converter issue, where Cirrious.MvvmCross.Binding.dll based ValueConverter ValueConverter required for this commandpalmator was not being used by override Setup.ValueConverterAssemblies Register

No comments:

Post a Comment