예제 #1
0
 private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (frameMain.Content != null)
     {
         pages.editSoa page = GetCurrentPageInstance();
         if (page != null)
         {
             page.SaveIfEdited();
         }
     }
     if (util.canceled == true)
     {
         e.Cancel = true;
     }
 }
예제 #2
0
        private void NewCommand_Executed(object sender, ExecutedRoutedEventArgs e) /*Edit command uses this method also*/
        {
            util.editSelected = (bool)e.Parameter;

            pages.editSoa page = GetCurrentPageInstance();
            if (page != null)
            {
                page.SaveIfEdited();
            }
            if (util.canceled != true)
            {
                frameMain.Content = null;
                pages.cmcEditor newPg = new pages.cmcEditor();
                frameMain.Content = newPg;
            }
            UncheckMenuToggleButtons();
            util.editSelected = false;
        }