How to declare ActionMessage in CS file

Topics: Actions & Coroutines
Aug 4, 2011 at 1:26 PM

Hi ,

In my sample ,i have added the controls dynamically from the CS file instead of xaml file.

Now ,in my ViewModel, i have Method GoToDashBoard() .

Now, when i Click on one of my control ,i need to navigate & internally call the Method GoToDashBoard in ViewModel.

If i do it in xaml it will look something like this :

Interaction.Triggers will be added in the control code.


    <i:EventTrigger EventName="Click">                 

  <cal:ActionMessage MethodName="GoToDashBoard ">                     

  <cal:Parameter Value="{Binding ElementName=dgphone, Path=Name}" />                       

</cal:ActionMessage>                </i:EventTrigger>            </i:Interaction.Triggers>

Now, If i need to do the same binding in my CS file how should i do it ?