void TabHost_TabItemClosing(object sender, TabItemCancelEventArgs e)
 {
     if (e.TabItem.Content is IDisposable)
     {
         ((IDisposable)e.TabItem.Content).Dispose();
     }
 }
예제 #2
0
        private void tabControl_TabItemClosing(object sender, TabItemCancelEventArgs e)
        {
            if (e.TabItem.Content is IDisposable)
            {
                (e.TabItem.Content as IDisposable).Dispose();
            }

            e.TabItem.Content = null; // set no parent
        }
예제 #3
0
        private void DocumentsTabControl_TabItemClosing(object sender, TabItemCancelEventArgs e)
        {
            try
            {
                var DocumentsTabControl = __HostContanier as DocumentsTabControl;
                var currentTab          = Helper.FindParentLogicalControl <TabItem>(this);
                if (DocumentsTabControl != null && Equals(currentTab, sender))
                {
                    DocumentsTabControl.TabItemClosing -= new EventHandler <TabItemCancelEventArgs>(DocumentsTabControl_TabItemClosing);

                    __HostContanier = null;
                    __phoneIsUnload = true;

                    Disonnect();
                }
            }
            catch (Exception ex)
            {
                RosApplication.App.AddLog(ex);
            }
        }
예제 #4
0
 private void QueryTabPage_TabItemClosing(object sender, TabItemCancelEventArgs e)
 {
     e.Cancel = !this.ViewModel.CloseQueryTab(e.TabItem);
 }