예제 #1
0
        /// <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);
        }
예제 #2
0
        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);
        }