I am sitting with a problem and hope that you can help me.I'm implementing in WPF MVVM. I'm going to explain as good as I can. So i have one view. In which i have one big property Examination. In this view i have to be able to change the settings of the property Examination. This goes fine. But, I want to have a button, and a dialog appears. There I can change some specific (other) settings or properties of Examination. I don't want to do this all in one window so I work with a dialog. I do this in my viewmodel:
private void AlgemeneGegevensClick(object sender, RoutedEventArgs e)
{
ToetsBeheerViewModel vm = (ToetsBeheerViewModel)this.DataContext;
EditAlgemeneGegevens window = new EditAlgemeneGegevens(vm);
window.Show();
}
So a window dissapears with some textboxes where i can fill in some specifications of a test. But now my problem is, how do i return this changes (of the examination-object) to the viewmodel? Because I do this in my apart window:
public partial class EditAlgemeneGegevens : Window
{
private ToetsBeheerViewModel toetsb;
public EditAlgemeneGegevens(ToetsBeheerViewModel vm)
{
InitializeComponent();
toetsb = vm;
}
private void button1_Click(object sender, RoutedEventArgs e)
{
toetsb.Examination.Course = "blablabla";
}
}
So i want to change the Course property of examination in blablabla. But my viewmodel will not know that this property is changed? Hope you get it.. And can help me please :)?
Thanks..