2
Vote

CommandParameter fail !

description

Hello,
I use EventToCommandBehavior describe on this page
http://dotnetbyexample.blogspot.fr/2012_07_01_archive.html .
I try to use the CommandParameter but the value is always null.
I have recently updated dll with nuget .
I think that the last change break something because when i use the commit 18699 ,all is ok.
Sorry for my English .
bye.

comments

killedthedream wrote Apr 15, 2013 at 12:15 PM

Do you bind CommandParameter to a property of an element on the page? When I set CommandParameter to a constant value:
<MyBehavior CommandParameter="Hello"/>
or bind it to a property of my View Model:
<MyBehavior CommandProperty="{Binding ViewModelProperty}"/>
it works fine and CommandProperty is not null, but when I bind CommandProperty to an element on the page like this:
<MyBehavior CommandProperty="{Binding ElementName=SomeTextBox, Path=Text}"/>
then CommandProperty is always null.