/// <summary> /// Opens the editing screen for the current item. /// </summary> private void OnEdit() { //Put the edit view window on IRegion region = regionManager.Regions["MainDetailsRegion"]; ClothesEditView newView = new ClothesEditView(editViewModelFactory.GenerateViewModel(CurrentItem)); region.Add(newView); region.Activate(newView); }
private void OnNewPieceClick() { IRegion region = regionManager.Regions["MainDetailsRegion"]; ClothesEditView newView = new ClothesEditView(editViewModelFactory.GenerateViewModel()); try { region.Add(newView, "NewPieceOfClothingView"); } catch (InvalidOperationException) { ClothesEditView view = (ClothesEditView)region.Views.First <object>(x => x.GetType() == typeof(ClothesEditView)); { newView = view; } } region.Activate(newView); }