GoXam for WPF v3
CenterRect Method
Northwoods.GoXam Namespace > DiagramPanel Class : CenterRect Method
a Rect in model coordinates
an Action to be performed after the animation is finished; may be null
Center a particular area of the diagram within this viewport.
Syntax
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 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);

See Also

Reference

DiagramPanel Class
DiagramPanel Members