Exemplo n.º 1
0
 public void RemoveCharter(CharterControl charter)
 {
     Dispatcher.BeginInvoke(new Action(() => {
         var pane = FindChartPaneByName(charter.Name);
         if (pane != null)
         {
             pane.RemoveFromParent();
             pane.IsHidden = true;
             RadDocking.SetSerializationTag(pane, "");
             pane.Content = null;
         }
     }));
 }
Exemplo n.º 2
0
        public void AddCharter(CharterControl charter)
        {
            var pane       = FindChartPaneByName(charter.Name);
            var createPane = pane == null;

            if (pane == null)
            {
                pane = new RadPane();
                RadDocking.SetSerializationTag(pane, charter.Name);
            }
            pane.IsHidden = false;
            pane.Content  = charter;
            var b = new Binding()
            {
                Path = new PropertyPath("IsHidden"), Source = pane, Mode = BindingMode.TwoWay
            };

            charter.SetBinding(CharterControl.IsParentHiddenProperty, b);
            SetCharterPaneBindings(pane);
            var ht = FindResource("CharterHeaderTemplate") as DataTemplate;

            pane.HeaderTemplate = ht;
            pane.TitleTemplate  = ht;
            createPane          = pane.GetParent <RadSplitContainer>() == null;
            if (createPane)
            {
                var chartsSplitter = FindChartsSplitter();
                var paneGroup      = chartsSplitter.ChildrenOfType <RadPaneGroup>().LastOrDefault();
                if (paneGroup == null)
                {
                    paneGroup = new RadPaneGroup();
                    chartsSplitter.Items.Add(paneGroup);
                }
                paneGroup.AddItem(pane, Telerik.Windows.Controls.Docking.DockPosition.Right);
            }
            AddCharterToHidden(pane);
        }