I am developing a WPF application using the MVVM toolkit. I have a datagrid in my Mainwindow. I created another window called "openfile" and their viewmodels. The Main Window viewmodel class contains a public property of type ObservableCollection MyList that is associated with the Datagrid.Can. Can I populate this property from the openfile Viewmodel and automatically bind to the Datagrid? or can I pass varaible to MainViewmodel and make a public function call in MainViewmodel from OpenfileViewmodel?
This is how I call MyPage from the menu bar.
private void NotificationMessageReceived(NotificationMessage msg)
{
switch (msg.Notification)
{
case Messages.MainVM_Notofication_ShowNewbWindow:
new NewView().ShowDialog();
break;
case Messages.MainVM_Notofication_ShowExistingWindow:
new OpenExisitingView().ShowDialog();
break;
case Messages.MainVM_Notofication_ShowotherWindow:
newView().ShowDialog();
break;
}
}
Thanks at Advance. Roshil K
source
share