Exemple #1
0
 private ItemsControl GetItemsControlContainingPanel(PanelControl panel)
 {
     if (this.IsPanelInItemsControl(panel, this.LeftPanelContainer))
     {
         return this.LeftPanelContainer;
     }
     else if (this.IsPanelInItemsControl(panel, this.RightPanelContainer))
     {
         return this.RightPanelContainer;
     }
     else
     {
         return null;
     }
 }
Exemple #2
0
        private void OnDragPanel(object o, RoutedEventArgs args)
        {
            panel = o as PanelControl;
            knownParent = this.GetItemsControlContainingPanel(panel);
            if (knownParent != null)
            {
                knownParent.Items.Remove(panel);
                this.DocumentRoot.Children.Add(panel);

                panel.Width = panel.RenderSize.Width;
                panel.IsHitTestVisible = false;
                panel.HorizontalAlignment = HorizontalAlignment.Left;
                panel.VerticalAlignment = VerticalAlignment.Top;
                Grid.SetColumnSpan(panel, this.DocumentRoot.ColumnDefinitions.Count);
            }
        }
Exemple #3
0
        private bool IsPanelInItemsControl(PanelControl panel, ItemsControl itemsControl)
        {
            foreach (PanelControl item in itemsControl.Items)
            {
                if (item == panel)
                {
                    return true;
                }
            }

            return false;
        }