wpf - passing argument with InvokeCommandAction MVVM -


i want disable cell/column based on business logic. using showingeditor event , showingeditoreventargs cancel it. passing showingeditoreventargs excellent.i able pass full grid argument. using below code. want pass showingeditoreventargs of selected cell.may relative resource binding me out here.

<dxg:gridcontrol x:name="grid" >                 <dxg:gridcontrol.view>                     <dxg:tableview name="view"  showingeditor="view_showingeditor">                     <i:interaction.triggers>                          <i:eventtrigger eventname="showingeditor">                             <i:invokecommandaction command="{binding showingeditorcommand}" commandparameter="{binding relativesource={relativesource ancestortype={x:type dxg:gridcontrol}}}" /> 

... note:

  1. i can't use mvvm light(galasoft).
  2. interactions not giving me callmethodaction.

    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" <ei:callmethodaction 
  3. i don't want pass binded property of viewmodel(e.g. selecteditem)

  4. using devexpress gridcontrol

consider using devexpress mvvm framework, can pass event args view model parameter:

<dxmvvm:interaction.behaviors>     <dxmvvm:eventtocommand eventname="showingeditor" command="{binding showingeditorcommand}" passeventargstocommand="true" /> </dxmvvm:interaction.behaviors> 

or convert eventargs object before passing command using converter specified eventargsconverter property.

take @ eventtocommand article learn more.

p.s. if cannot use devexpress mvvm framework reason, this post describes how implement custom triggeraction passing event args command manually.


Comments