void TabHost_TabItemClosing(object sender, TabItemCancelEventArgs e)
 {
     if (e.TabItem.Content is IDisposable)
     {
         ((IDisposable)e.TabItem.Content).Dispose();
     }
 }
Exemplo n.º 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
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 4
0
 private void QueryTabPage_TabItemClosing(object sender, TabItemCancelEventArgs e)
 {
     e.Cancel = !this.ViewModel.CloseQueryTab(e.TabItem);
 }