Exemple #1
0
        /// <summary>
        /// Draw the rotation handle and the outline of
        /// the element.
        /// </summary>
        /// <param name="finalSize">The final area within the
        /// parent that this element should use to arrange
        /// itself and its children.</param>
        /// <returns>The actual size used. </returns>
        protected override Size ArrangeOverride(Size finalSize)
        {
            if (rectangleEdit.IsEmpty || rectangleDelete.IsEmpty)
            {
                return(finalSize);
            }

            // Draws the rectangle
            editButton.Arrange(rectangleEdit);
            editButton.RenderTransform = rotationEdit;
            deleteButton.Arrange(rectangleDelete);
            deleteButton.RenderTransform = rotationDelete;

            return(finalSize);
        }
        protected override Size ArrangeOverride(Size finalSize)
        {
            if (strokeBounds.IsEmpty)
            {
                return(finalSize);
            }

            resizePreview.Arrange(new Rect(new Size(canvas.ActualWidth, canvas.ActualHeight)));
            outerBoundPath.Arrange(new Rect(new Size(canvas.ActualWidth, canvas.ActualHeight)));

            moveThumb.Arrange(strokeBounds);

            deleteButton.Arrange(rectangleDelete);
            leftAlignButton.Arrange(rectangleLeftAlign);
            centerAlignButton.Arrange(rectangleCenter);

            foreach (Path path in shapeBorders)
            {
                path.Arrange(new Rect(new Size(canvas.ActualWidth, canvas.ActualHeight)));
            }

            return(finalSize);
        }