예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DragManager"/> class.
        /// </summary>
        /// <param name="dockControl">The <see cref="DockControl"/>.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="dockControl"/> is <see langword="null"/>.
        /// </exception>
        internal DragManager(DockControl dockControl)
        {
            if (dockControl == null)
            {
                throw new ArgumentNullException(nameof(dockControl));
            }

            _dockControl = dockControl;

            Reset();

            // Register event handlers.
            ((INotifyCollectionChanged)_dockControl.DockTabPanes).CollectionChanged += OnDockTabPanesChanged;
        }
예제 #2
0
        /// <summary>
        /// Gets the primary DockWidth/DockHeight value for the given element.
        /// </summary>
        private static GridLength GetPrimaryDockSize(DependencyObject element, Orientation orientation)
        {
            if (element == null)
            {
                return(GridLength.Auto);
            }

            return((orientation == Orientation.Vertical) ? DockControl.GetDockHeight(element) : DockControl.GetDockWidth(element));
        }
예제 #3
0
 internal static IDockControl GetViewModel(this DockControl view)
 {
     return(GetViewModel <IDockControl>(view));
 }