private void CopyInstanceExecute(object obj) { var cls = ClassesCollectionView.CurrentItem as NdfClassViewModel; if (cls == null) { return; } var inst = cls.InstancesCollectionView.CurrentItem as NdfObjectViewModel; if (inst == null) { return; } if (!inst.Object.IsTopObject) { MessageBox.Show("You can only create a copy of an top object.", "Information", MessageBoxButton.OK); return; } _copyInstanceResults = new List <NdfObject>(); CopyInstance(inst.Object); var resultViewModel = new ObjectCopyResultViewModel(_copyInstanceResults, this); DialogProvider.ProvideView(resultViewModel, this); }
private void CopyInstanceExecute(object obj) { var cls = ClassesCollectionView.CurrentItem as NdfClassViewModel; if (cls == null) return; var inst = cls.InstancesCollectionView.CurrentItem as NdfObjectViewModel; if (inst == null) return; if (!inst.Object.IsTopObject) { MessageBox.Show("You can only create a copy of an top object.", "Information", MessageBoxButton.OK); return; } _copyInstanceResults = new List<NdfObject>(); CopyInstance(inst.Object); var resultViewModel = new ObjectCopyResultViewModel(_copyInstanceResults, this); DialogProvider.ProvideView(resultViewModel, this); }