您好我是MVVM的新手。
我的XAML如下
<Window.DataContext>
<HelloViewModel:EmpDetailsWindowViewModel/>
</Window.DataContext>
<Grid>
<igDP:XamDataGrid Name="dgEmployee" DataSource="{Binding EmployeeDataTable, Mode=TwoWay}" ScrollingMode="DeferredWithScrollTips"
RecordContainerGenerationMode="Virtualize" ScrollBehaviorOnListChange="PreserveRecordsInView" FieldLayoutInitialized="dgEmployee_FieldLayoutInitialized">
<igDP:XamDataGrid.ViewSettings>
<igDP:GridViewSettings />
</igDP:XamDataGrid.ViewSettings>
<igDP:XamDataGrid.FieldLayoutSettings >
<igDP:FieldLayoutSettings AutoGenerateFields="True" />
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout/>
</igDP:XamDataGrid.FieldLayouts>
<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings AllowRecordFiltering="True" AllowSummaries="True" AllowEdit="True" AutoSizeScope="ViewableRecords" />
</igDP:XamDataGrid.FieldSettings>
</igDP:XamDataGrid>
<Button x:Name="btnSubmit" Content="Submit" Command="{Binding SubmitCommand}" CommandParameter="submit command" HorizontalAlignment="Left" Margin="212,215,0,0" VerticalAlignment="Top" Width="75"/>
</Grid>
我想在SubmitCommand的Execute方法中访问viewmodel“EmployeeDataTable”的属性
public void Execute(object parameter)
{
//here
MessageBox.Show("you are safe !!1");
}
我该怎么做?