public Point ConstrainLocation(DockItemsControl requestor, Size measureBounds, Point itemCurrentLocation, Size itemCurrentSize, Point itemDesiredLocation, Size itemDesiredSize) { var fixedItems = requestor.FixedItemCount; var lowerBound = fixedItems == 0 ? -1d : GetLocationInfo(requestor.DockItems() .Take(fixedItems) .Last()).End + _itemOffset - 1; return(new Point( _orientation == Orientation.Vertical ? 0 : Math.Min(Math.Max(lowerBound, itemDesiredLocation.X), (measureBounds.Width) + 1), _orientation == Orientation.Horizontal ? 0 : Math.Min(Math.Max(lowerBound, itemDesiredLocation.Y), (measureBounds.Height) + 1) )); }
private bool IsMyItem(DockItem item) { return(_dockItemsControl != null && _dockItemsControl.DockItems().Contains(item)); }