Casting in MVVM Light CommandParameterValue

Posted by user275561 on Stack Overflow See other posts from Stack Overflow or by user275561
Published on 2010-03-30T04:11:31Z Indexed on 2010/03/30 4:43 UTC
Read the original article Hit count: 621

Filed under:
|

here is my Problem, I want to pass the integer 1 when this canvas is pressed. Every time I click the canvas, I get a An unhandled exception of type 'System.InvalidCastException' occurred in GalaSoft.MvvmLight.dll. Now I could make my life easier and just do the RelayCommand to accept a String instead of int but for the sake of learning. How would i go about doing it this way,

    <i:Interaction.Triggers>
   <i:EventTrigger EventName="MouseLeftButtonDown">
         <cmd:EventToCommand Command="{Binding ButtonPress}"
                 CommandParameterValue="1"
              </i:EventTrigger>
    </i:Interaction.Triggers>

© Stack Overflow or respective owner

Related posts about mvvm

Related posts about Silverlight