예제 #1
0
        /// <summary>
        /// 关闭当前窗口事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TCloseButton_Click(object sender, RoutedEventArgs e)
        {
            //System.Windows.Application.Current.Host.Content.IsFullScreen = System.Windows.Application.Current.Host.Content.IsFullScreen ? false : true;
            ICleanup content = PanelContent as ICleanup;

            if (content != null)
            {
                content.Cleanup();
                PanelContent = null;
            }
            if (Back != null)
            {
                Back.Invoke(sender, e);
            }
        }
예제 #2
0
 public void Clear()
 {
     Root.Children.Clear();
     if (radtileview != null)
     {
         foreach (var item in radtileview.Children)
         {
             var radItem = item as DragDockPanel;
             if (radItem != null)
             {
                 ICleanup clearup = radItem.Content as ICleanup;
                 if (clearup != null)
                 {
                     clearup.Cleanup();
                 }
             }
         }
         radtileview = null;
     }
 }
예제 #3
0
 public void Clear()
 {
     Root.Children.Clear();
     if (radtileview != null)
     {
         foreach (var item in radtileview.Items)
         {
             var radItem = item as RadTileViewItem;
             if (radItem != null)
             {
                 ICleanup clearup = radItem.Content as ICleanup;
                 if (clearup != null)
                 {
                     clearup.Cleanup();
                 }
             }
         }
         radtileview = null;
     }
 }
예제 #4
0
        private static void OnPanelContentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            try
            {
                ParentPanel item     = d as ParentPanel;
                ICleanup    oldValue = e.OldValue as ICleanup;

                if (oldValue != null)
                {
                    oldValue.Cleanup();
                    oldValue = null;
                }
                if (e.NewValue != null)
                {
                    item.ParentContent.Content = null;

                    item.ParentContent.Content = e.NewValue;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }