Example #1
0
        private void PaneClosePreview(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
        {
            if (e == null || e.Panes == null || e.Panes.Any() == false || e.Panes.Count() > 0)
            {
                return;
            }

            (DataContext as DockingAreaViewModel).PaneCloseAttempt(e.Panes.First());
        }
Example #2
0
 void RootVisual_Close(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
 {
     e.Panes.ToList().ForEach(pane => {
         if (CanUserClose(pane) && !IsCharterPane(pane))
         {
             pane.RemoveFromParent();
         }
     });
 }
Example #3
0
 private void RadDockMain_Close(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
 {
     //foreach(var p in e.Panes)
     //{
     //	if(p is RadCodeDocumentPane)
     //	{
     //		var d = p as RadCodeDocumentPane;
     //		BindingExpression b = d.Editor.TextArea.GetBindingExpression(TextArea);
     //		docWindowsExpressions.Remove(b);
     //	}
     //}
 }
Example #4
0
        private void RadDocking_Close_1(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
        {
            ObservableCollection <RadPane> closedPanes = new ObservableCollection <RadPane>();

            if (this.RadContextMenu.ItemsSource != null)
            {
                closedPanes = this.RadContextMenu.ItemsSource as ObservableCollection <RadPane>;
            }

            foreach (RadPane Pane in e.Panes)
            {
                Pane.Header = string.Format("Show {0}", Pane.Header);
                closedPanes.Add(Pane);
            }

            this.RadContextMenu.ItemsSource = closedPanes;
        }
Example #5
0
        public void RadDocking_PreviewClose(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
        {
            if (e.Panes != null && e.Panes.Count() > 0 && e.Panes.First() is RadPane)
            {
                var r = (e.Panes.First() as RadPane);
                //var vm = (Models)(r.Content as UserControl).DataContext;

                if ((r.Content as UserControl).DataContext is Models.ViewModelPane vm)
                {
                    e.Handled = !vm.SaveChanesAsk();
                }

                if ((r.Content as UserControl).DataContext is Models.ViewModelPaneReactiveObject vm2)
                {
                    e.Handled = !vm2.SaveChanesAsk();
                }
            }
        }
Example #6
0
        private void Docking_Unpin(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
        {
            var orderredPanes = this.PaneGroup.UnpinnedPanes.OrderBy(x => x.Header);

            foreach (RadPane pane in orderredPanes)
            {
                this.PaneGroup.RemovePane(pane);
                this.PaneGroup.Items.Add(pane);
            }

            // we need to manually activate a Pane after modifying the collection
            var activePane = this.PaneGroup.EnumeratePanes().LastOrDefault(p => p.IsPinned);

            if (activePane != null)
            {
                activePane.IsActive = true;
            }
        }
Example #7
0
        private void OnRadDockingClose(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
        {
            // By default when a RadPane is closed via its 'X' close button it is not fully removed from the control rather its
            // IsHidden property is set to True. This is done in order to provide an easy way of reopening such closed instance
            // without the need of fully creating the a new 'mirrored' instance and adding it to the control.

            // The next code will permanently remove the RadPane instance from the RadDocking control. When PanesSource is set
            // the closed RadPane instance needs to be manually removed from the bound collection. This will trigger the RemovePane()
            // method of the DockingPanesFactory of the control. If no PanesSource is used again a manually remove needs to be
            // done by simply calling the RemoveFromParent() method of the RadPane instance.
            var docking = sender as RadDocking;

            foreach (var pane in e.Panes)
            {
                var dataContext = docking.DataContext as ViewModel;
                if (dataContext != null)
                {
                    dataContext.Panes.Remove(pane);
                }
            }
        }
 private void RadDocking_PreviewClose(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
 {
     (mainUC.DataContext as Models.MainUIViewModel).model.RadDocking_PreviewClose(sender, e);
 }
Example #9
0
 private void RadDocking_Close(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
 {
 }