Calibrn's Parameter

Topics: Actions & Coroutines
Aug 9, 2011 at 6:50 AM
 <i:Interaction.Triggers>
           <i:EventTrigger EventName="Click">
                   <cal:ActionMessage MethodName="New">
                                <cal:Parameter Value="{Binding ElementName=dataGrid}"/>
                   </cal:ActionMessage>
        </i:EventTrigger>
  </i:Interaction.Triggers>
the method is right.but i want to write like this.
cal:Message.Attach="New(dataGrid)"
what i should Choose dataGrid's Property.when binding DataGrid.
Aug 9, 2011 at 8:43 AM
Edited Aug 9, 2011 at 8:43 AM

Thanks for moving the discussion here :-)

It should just be: <cal:Parameter Value="dataGrid"/>
This will pass the whole Grid as a parameter of the New(...) action. Is this what you intended to do?

As a side note, I would avoid (if possible) passing the control itself to the ViewModel, which shouldn't be poisoned with UI concerns.
If you want to give some more information about the exact context, I could perhaps suggest a cleaner approach.

Aug 10, 2011 at 3:16 PM

This will pass the whole Grid as a parameter of the New(...) action

yes you are right.is there anything with simple write. like cal:Message.Attach="";

Aug 10, 2011 at 9:21 PM

Sorry, I can't understand your exact need.
Are you asking for the short syntax? It's just: <Button cal:Message.Attach="New(dataGrid)" />