Northwoods.GoWPF 1.3.5 Assembly
CenterRect Method
See Also  Send Feedback
Northwoods.GoXam Namespace > DiagramPanel Class : CenterRect Method

bounds
a Rect in model coordinates
afterwards
an Action to be performed after the animation is finished; may be null
Center a particular area of the diagram within this viewport.

Syntax

Visual Basic (Declaration) 
Public Sub CenterRect( _
   ByVal bounds As Rect, _
   ByVal afterwards As Action _
) 
C# 
public void CenterRect( 
   Rect bounds,
   Action afterwards
)

Parameters

bounds
a Rect in model coordinates
afterwards
an Action to be performed after the animation is finished; may be null

Remarks

The HorizontalContentAlignment and VerticalContentAlignment properties need to be "Stretch" if the DiagramPanel.DiagramBounds are smaller than the viewport. But in any case, the bounds might not be centered if the panel cannot be scrolled far enough.

If you want to try to center the selection in the viewport, call:

            myDiagram.Panel.CenterRect(myDiagram.Panel.ComputeBounds(myDiagram.SelectedParts), null);
            

Requirements

See Also

© 2012 All Rights Reserved.