private void Button_Click(object sender, RoutedEventArgs e) { ISPVIewModel model = DataContext as ISPVIewModel; //Bad because no logic should be made in a view. Not even a clone // If you uncomment it's not gonna compile it is missing something. //model.AllServices.Add(model.ActualService.Clone()); model.CloneTheActualIntoAll(); }
public MainWindow(ISPVIewModel model) : this() { DataContext = null; DataContext = model; }