Example #1
0
        /* 皮肤选择
         * private void biSkinChoose_EditValueChanged(object sender, RoutedEventArgs e)
         * {
         *  if (biSkinChoose.EditValue == null)
         *  {
         *      return;
         *  }
         *  ThemeManager.ApplicationThemeName = biSkinChoose.EditValue.ToString();// biSkinChoose.EditValue.ToString();
         *  this.UpdateLayout();
         * }
         */

        private void TabGroup_TabHiding(object sender, TabControlTabHidingEventArgs e)
        {
            ZLGEntity _conn = (ZLGEntity)TabGroup.SelectedItem;

            _conn.StopDevice();
            tabSource.Remove(_conn);

            //回收垃圾
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
        private void OnTabPageClosing(object sender, TabControlTabHidingEventArgs e)
        {
            if (!e.Cancel)
            {
                var parent = GetParent();

                if (parent != null)
                {
                    var tabControl = parent.GetControl <DXTabControl>();

                    if (tabControl != null && Equals(tabControl.Items[e.TabIndex], Control))
                    {
                        Close();

                        e.Cancel = true;
                    }
                }
            }
        }