Exemplo n.º 1
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();
         }
     }
 }
Exemplo n.º 2
0
        public void Navigate(UserControl page)
        {
            YellowstonePathology.YpiConnect.Client.NavigatingEventArgs eventArgs = new NavigatingEventArgs(this.m_CurrentPage, page);

            YellowstonePathology.Business.Interface.IPersistPageChanges navigatingFromPage = (YellowstonePathology.Business.Interface.IPersistPageChanges) this.m_CurrentPage;
            YellowstonePathology.Business.Interface.IPersistPageChanges navigatingToPage   = (YellowstonePathology.Business.Interface.IPersistPageChanges)page;

            if (navigatingFromPage != null)
            {
                if (navigatingFromPage.OkToSaveOnNavigation(navigatingToPage.GetType()) == true)
                {
                    navigatingFromPage.Save();
                }
            }

            this.m_CurrentPage            = page;
            this.m_ContentControl.Content = page;
        }