Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
how to pass the RecordUpdatingEventArgs to the View Model in MVVM?
posted

Hello,

I'm using the XamDataGrid and adding a new row. what I want to do is when I click on the new row cell and start typing, I will capture the RecordUpdatingEvent in the View Model.

this is my code (I"m using Caliburn Micro, so cal: is actually referring to it):

<ig:XamDataGrid x:Name="MyInfoDataGrid" DataSource="{Binding SpecificDataList, Mode=TwoWay}" 

<i:Interaction.Triggers>
<i:EventTrigger EventName="RecordUpdating" >
<cal:ActionMessage MethodName="MyRecordUpdating">
<cal:Parameter Value="{Binding ElementName=MyInfoDataGrid}" />
<cal:Parameter Value="RecordUpdatingEventArgs" />
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>

.....

and in my ViewModel:

public void BinsRecordUpdating(object sender, RecordUpdatingEventArgs e)
{
     DataRecord temp = e.Record;
}

I can get the sender object, but I can't get the RecordUpdatingEventArgs. it shows up as null.

i'm wondering how do pass the evetArgs as the parameter for anything similar to this event? or i'm using a totally wrong method to do it?

thanks a lot,

Francis