ResizingTool
The ResizingTool is used to interactively change the size of an element.
Erbt von: DiagramTool
Eigenschaften
AdornedElement : FrameworkElement
Gets or sets the current FrameworkElement that is being resized.
AdornedNode : Node
Gets the current Node that the AdornedElement is in.
CellSize : Size
Gets or sets the cell size of the selected element, so that resizing is limited to multiples of the cell size.
Handle : FrameworkElement
Gets or sets the current resize handle that is being dragged.
OriginalBounds : Rect
Gets or sets the bounds, in model coordinates, of the AdornedElement when the user started resizing.
OriginalLocation : Point
Gets or sets the location, in model coordinates, of the AdornedNode when the user started resizing.
Methoden
ComputeCellSize() : Size
The size should be a multiple of the value returned by this method.
Rückgabe: The CellSize, unless one or both of its width and height are Double.NaN or zero. If that is the case, it uses the width and/or height from the node's ResizeCellSize. But if one or both of the width and height are still Double.NaN or zero, it searches for a grid snapping node behind the AdornedNode, one that is DragOverSnapEnabled, and uses its DragOverSnapCellSize. If it cannot find such a grid snapping node, or one or both of the width and height are NaN, it uses the diagram's GridSnapCellSize if the diagram is GridSnapEnabled. Finally, it defaults to 1x1.
ComputeMaxSize() : Size
The effective maximum resizing size is the minimum of MaxSize and the FrameworkElement's MaxWidth and MaxHeight.
Rückgabe: the desired maximum Size during resizing
ComputeMinSize() : Size
The effective minimum resizing size is the maximum of MinSize and the FrameworkElement's MinWidth and MinHeight.
Rückgabe: the desired minimum Size during resizing
ComputeResize(Point, Spot, Size, Size, bool) : Rect
Given a Spot in the OriginalBounds and a new Point, compute the new Rect.
- newPoint
- a Point in model coordinates
- spot
- The Spot in the rectangular bounds for which the Handle is being dragged
- min
- the computed rectangle must be at least as large as these dimensions
- max
- the computed rectangle must be no larger than these dimensions
- reshape
- whether the aspect ratio of the rectangle may change
DoActivate()
Start resizing.
DoCancel()
Restore the OriginalBounds of the AdornedElement and stop this tool.
DoDeactivate()
This stops the current edit (StopTransaction).
DoMouseMove()
Call Rect) with a new bounds determined by the mouse point.
DoMouseUp()
Call Rect) with a rectangle based on the most recent mouse point, and raise an "object resized" event before stopping the tool.
DoResize(Rect)
Change the AdornedElement's Width and/or Height, and perhaps the AdornedNode's Location, given a new rectangular bounds for the adorned element.
- newr
DoStart()
Capture the mouse when starting this tool.
DoStop()
Release the mouse capture when stopping this tool.
UpdateAdornments(Part)
Show an Adornment with resize handles at points along the edge of bounds of the AdornedElement, if the node is selected and visible and if CanResize is true.
- part
Felder
CellSizeProperty : DependencyProperty
Identifies the CellSize dependency property.
MaxSizeProperty : DependencyProperty
Identifies the MaxSize dependency property.
MinSizeProperty : DependencyProperty
Identifies the MinSize dependency property.