Example #1
0
 private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     YellowstonePathology.Business.Interface.IPersistPageChanges page = (YellowstonePathology.Business.Interface.IPersistPageChanges) this.MainFrame.NavigationService.Content;
     if (page != null)
     {
         page.UpdateBindingSources();
         page.Save();
     }
 }
Example #2
0
 private void MainFrame_Navigating(object sender, NavigatingCancelEventArgs e)
 {
     if (this.MainFrame.Content != null)
     {
         YellowstonePathology.Business.Interface.IPersistPageChanges navigatingToPage   = (YellowstonePathology.Business.Interface.IPersistPageChanges)e.Content;
         YellowstonePathology.Business.Interface.IPersistPageChanges navigatingFromPage = (YellowstonePathology.Business.Interface.IPersistPageChanges) this.MainFrame.Content;
         navigatingFromPage.UpdateBindingSources();
         if (navigatingFromPage.OkToSaveOnNavigation(navigatingToPage.GetType()) == true)
         {
             navigatingFromPage.Save();
         }
     }
 }