DiagramPanel
The DiagramPanel is the central class of a Diagram, holding all of the Layers of Parts, responsible for translation (scrolling) and scaling (zooming) and alignment, keeping track of the diagram's bounds, and having various hit-testing methods used to search the diagram for particular elements.
Inherits: Panel
Implements: IScrollInfo
Constructors
Properties
public NodeLayer AdornmentLayer { get; }
value = diagramPanel.AdornmentLayer
Gets the standard layer used to hold Adornments, which is normally in front of all of the other layers.
public int AutoScrollDelay { get; set; }
value = diagramPanel.AutoScrollDelay
diagramPanel.AutoScrollDelay = value
Gets or sets how long to wait before autoscrolling.
public Thickness AutoScrollRegion { get; set; }
value = diagramPanel.AutoScrollRegion
diagramPanel.AutoScrollRegion = value
Gets or sets the margin in the panel where a mouse drag will automatically cause the view to scroll.
public int AutoScrollTime { get; set; }
value = diagramPanel.AutoScrollTime
diagramPanel.AutoScrollTime = value
Gets or sets how quickly to change the Position when the mouse is in the AutoScrollRegion.
public bool CanHorizontallyScroll { get; set; }
value = diagramPanel.CanHorizontallyScroll
diagramPanel.CanHorizontallyScroll = value
Gets or sets whether the user can scroll horizontally. (Implements IScrollInfo.)
public bool CanVerticallyScroll { get; set; }
value = diagramPanel.CanVerticallyScroll
diagramPanel.CanVerticallyScroll = value
Gets or sets whether the user can scroll vertically. (Implements IScrollInfo.)
public Diagram Diagram { get; internal set; }
value = diagramPanel.Diagram
diagramPanel.Diagram = value
Gets the Diagram that this panel is in.
public Rect DiagramBounds { get; set; }
value = diagramPanel.DiagramBounds
diagramPanel.DiagramBounds = value
Gets or sets the model-coordinate bounds of the diagram.
public double ExtentHeight { get; }
value = diagramPanel.ExtentHeight
Get the vertical size of the scrollable part of this diagram, in control (device independent pixel) units. (Implements IScrollInfo.)
public double ExtentWidth { get; }
value = diagramPanel.ExtentWidth
Get the horizontal size of the scrollable part of this diagram, in control (device independent pixel) units. (Implements IScrollInfo.)
public Rect FixedBounds { get; set; }
value = diagramPanel.FixedBounds
diagramPanel.FixedBounds = value
Gets or sets a fixed bounding rectangle to be returned by ComputeDiagramBounds.
public HorizontalAlignment HorizontalContentAlignment { get; set; }
value = diagramPanel.HorizontalContentAlignment
diagramPanel.HorizontalContentAlignment = value
Gets or sets how the parts are positioned in the panel when the DiagramBounds width is smaller than the ViewportWidth.
public double HorizontalOffset { get; }
value = diagramPanel.HorizontalOffset
Gets the horizontal offset of the diagram's parts. (Implements IScrollInfo.)
public double MaximumScale { get; set; }
value = diagramPanel.MaximumScale
diagramPanel.MaximumScale = value
Gets or sets the largest value that Scale may take.
public double MinimumScale { get; set; }
value = diagramPanel.MinimumScale
diagramPanel.MinimumScale = value
Gets or sets the smallest value greater than zero that Scale may take.
public Thickness Padding { get; set; }
value = diagramPanel.Padding
diagramPanel.Padding = value
Gets or sets the amount of extra "empty" space is reserved around the DiagramBounds.
public Point Position { get; set; }
value = diagramPanel.Position
diagramPanel.Position = value
Gets or sets the point, in model coordinates, shown at the top-left corner of this panel.
public double Scale { get; set; }
value = diagramPanel.Scale
diagramPanel.Scale = value
Gets or sets the scale factor at which everything is rendered.
public double ScrollHorizontalLineChange { get; set; }
value = diagramPanel.ScrollHorizontalLineChange
diagramPanel.ScrollHorizontalLineChange = value
Gets or sets the size of a "line" when scrolling horizontally.
public ScrollViewer ScrollOwner { get; set; }
value = diagramPanel.ScrollOwner
diagramPanel.ScrollOwner = value
Gets or sets the ScrollViewer that lets the user scroll this panel. (Implements IScrollInfo.)
public double ScrollVerticalLineChange { get; set; }
value = diagramPanel.ScrollVerticalLineChange
diagramPanel.ScrollVerticalLineChange = value
Gets or sets the size of a "line" when scrolling vertically.
public StretchPolicy Stretch { get; set; }
value = diagramPanel.Stretch
diagramPanel.Stretch = value
Gets or sets how the panel's Scale property is set, depending on the size of the DiagramBounds.
public VerticalAlignment VerticalContentAlignment { get; set; }
value = diagramPanel.VerticalContentAlignment
diagramPanel.VerticalContentAlignment = value
Gets or sets how the parts are positioned in the panel when the DiagramBounds width is smaller than the ViewportWidth.
public double VerticalOffset { get; }
value = diagramPanel.VerticalOffset
Gets the vertical offset of the diagram's parts. (Implements IScrollInfo.)
public Rect ViewportBounds { get; }
value = diagramPanel.ViewportBounds
Gets the visible part of this panel, in model coordinates.
public double ViewportHeight { get; }
value = diagramPanel.ViewportHeight
Get the vertical size of the visible part of this panel, in control (device independent pixel) units. (Implements IScrollInfo.)
public double ViewportWidth { get; }
value = diagramPanel.ViewportWidth
Get the horizontal size of the visible part of this panel, in control (device independent pixel) units. (Implements IScrollInfo.)
public Point ZoomPoint { get; set; }
value = diagramPanel.ZoomPoint
diagramPanel.ZoomPoint = value
Gets or sets the apparent focus point used when zooming in or out.
public int ZoomTime { get; set; }
value = diagramPanel.ZoomTime
diagramPanel.ZoomTime = value
Gets or sets how quickly to change the Scale and/or Position properties when adapting to DiagramBounds changes or panel size changes causing content re-alignment, or in calls to Rect) or Action).
Methods
protected override Size ArrangeOverride(Size finalSize)
result = diagramPanel.ArrangeOverride(finalSize)
Arrange each of the Layers in this panel.
- finalSize
public void CenterPart(Part part)
diagramPanel.CenterPart(part)
Center a Part's bounds within this viewport.
- part
public void CenterPart(Part part, Action afterwards)
diagramPanel.CenterPart(part, afterwards)
Center a Part's bounds within this viewport.
- part
- afterwards
- an Action to be performed after the animation is finished; may be null
public void CenterRect(Rect bounds, Action afterwards)
diagramPanel.CenterRect(bounds, afterwards)
Center a particular area of the diagram within this viewport.
- bounds
- a Rect in model coordinates
- afterwards
- an Action to be performed after the animation is finished; may be null
protected virtual Point ComputeAutoScrollPosition(Point viewPnt)
result = diagramPanel.ComputeAutoScrollPosition(viewPnt)
This method is called to determine the next position in the document for this view, given a point at which the user is dragging the mouse.
- viewPnt
- The mouse point, in control coordinates.
public virtual Rect ComputeBounds(IEnumerable<Part> parts)
result = diagramPanel.ComputeBounds(parts)
Compute the bounding rectangle that surrounds a given collection of parts.
- parts
Returns: the union of the Bounds of all of the parts in , or Rect.Empty if there are no parts
protected virtual Rect ComputeDiagramBounds()
result = diagramPanel.ComputeDiagramBounds()
This is called by UpdateDiagramBounds to determine a new value for DiagramBounds.
Returns: a Rect in model coordinates
protected virtual GridPattern CreateBackgroundGridPattern()
result = diagramPanel.CreateBackgroundGridPattern()
Create the GridPattern for the whole diagram, using the GridPatternTemplate data template.
Returns: the unbound Node holding the GridPattern
public void DoAutoScroll(Point modelPnt)
diagramPanel.DoAutoScroll(modelPnt)
Start or continue automatically scrolling the view during a mouse drag.
- modelPnt
- the current mouse point, in model coordinates
protected virtual Rect DoMakeVisible(UIElement elt, Rect rectangle)
result = diagramPanel.DoMakeVisible(elt, rectangle)
This overridable method changes the Position so that the given element becomes visible in the viewport.
- elt
- a UIElement that is in the visual tree of this panel
- rectangle
- The region of the element to bring into view; if this is empty, this defaults to the element's parent Part's Bounds.
public T FindElementAt<T>(Point p, Func<Visual, T> navig, Predicate<T> pred, SearchLayers layers)
result = diagramPanel.FindElementAt(p, navig, pred, layers)
Search all parts that are at a given point that meet a given predicate, and return the first element that matches.
- p
- a Point in model coordinates
- navig
- This is a function that is given an element at the given point and returns an element of type to be considered by the predicate . Typically the function will find the ancestor Part or Node.
- pred
- This is a predicate that is given an element of type ; If the predicate returns true, this method returns that element; if it returns false, the search continues for elements at the given point. If this predicate argument is null, no filtering of elements is done -- the first one found is returned.
- layers
- The kinds of Layers to search in. For example, if you are looking for a Node, using the value Nodes, this will speed up the search by ignore layers containing Links.
Returns: an element of type , or null if none is found
public IEnumerable<T> FindElementsAt<T>(Point p, Func<Visual, T> navig, Predicate<T> pred, SearchLayers layers)
result = diagramPanel.FindElementsAt(p, navig, pred, layers)
Search all parts that are at a given point that meet a given predicate, and return a collection of elements that match.
- p
- a Point in model coordinates
- navig
- This is a function that is given an element at the given point and returns an element of type to be considered by the predicate . Typically the function will find the ancestor Part or Node.
- pred
- This is a predicate that is given an element of type ; if the predicate returns true, this method includes that element in its results. If this predicate argument is null, no filtering of elements is done -- all are included.
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
Returns: a perhaps empty collection of elements of type
public IEnumerable<T> FindElementsIn<T>(Rect rect, Func<Visual, T> navig, Predicate<T> pred, SearchLayers layers)
result = diagramPanel.FindElementsIn(rect, navig, pred, layers)
Find elements that are within a rectangle.
- rect
- a Rect in model coordinates
- navig
- This is a function that is given an element at the given point and returns an element of type to be considered by the predicate . Typically the function will find the ancestor Part or Node.
- pred
- This is a predicate that is given an element of type ; if the predicate returns true, this method includes that element in its results.
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
Returns: a perhaps empty collection of elements of type
public IEnumerable<T> FindElementsNear<T>(Point p, double dist, Func<Visual, T> navig, Predicate<T> pred, SearchLayers layers)
result = diagramPanel.FindElementsNear(p, dist, navig, pred, layers)
Find elements that are within a distance of a point.
- p
- a Point in model coordinates
- dist
- the distance, in model coordinates
- navig
- This is a function that is given an element at the given point and returns an element of type to be considered by the predicate . Typically the function will find the ancestor Part or Node.
- pred
- This is a predicate that is given an element of type ; if the predicate returns true, this method includes that element in its results.
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
Returns: an element of type , or null if none is found
internal IEnumerable<T> FindElementsWithin<T>(Geometry geo, Func<Visual, T> navig, Predicate<T> pred, SearchLayers layers)
result = diagramPanel.FindElementsWithin(geo, navig, pred, layers)
Search all parts that are at inside a given geometry that meet a given predicate, and return a collection of elements that match.
- geo
- a Geometry in model coordinates
- navig
- This is a function that is given an element at the given point and returns an element of type to be considered by the predicate . Typically the function will find the ancestor Part or Node.
- pred
- This is a predicate that is given an element of type ; if the predicate returns true, this method includes that element in its results.
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
Returns: a perhaps empty collection of elements of type
public T FindLayer<T>(string name)
result = diagramPanel.FindLayer(name)
Find a Layer of the given type with exactly the same Id as the given .
- name
public T FindPartAt<T>(Point p, Predicate<T> pred, SearchLayers layers)
result = diagramPanel.FindPartAt(p, pred, layers)
Return the front-most Part that is at a given point.
- p
- a Point in model coordinates
- pred
- This is a predicate that is given an part of type ; if the predicate returns true, this method returns that part. If this argument is null, this returns the first part it finds at the point.
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
Returns: null if no such part is found
public IEnumerable<T> FindPartsAt<T>(Point p, SearchLayers layers)
result = diagramPanel.FindPartsAt(p, layers)
Return all of the Parts that are at a given point.
- p
- a Point in model coordinates
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
Returns: All of the Parts of the given type that are at the Point and that are in the kinds of layers indicated by . This returns an empty list if no qualifying parts are found.
public IEnumerable<T> FindPartsIn<T>(Rect rect, SearchFlags srch, SearchInclusion overlap, SearchLayers layers)
result = diagramPanel.FindPartsIn(rect, srch, overlap, layers)
Find parts that are within a rectangle.
- rect
- a Rect in model coordinates
- srch
- Which kinds of parts to include; a typical value might be SelectableParts.
- overlap
- The required geometric relationship with the part; the typical value is Inside.
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
public IEnumerable<T> FindPartsNear<T>(Point p, double dist, SearchFlags srch, SearchInclusion overlap, SearchLayers layers)
result = diagramPanel.FindPartsNear(p, dist, srch, overlap, layers)
Find parts that are near a point.
- p
- a Point in model coordinates
- dist
- the distance, in model coordinates
- srch
- Which kinds of parts to include; a typical value might be SelectableParts.
- overlap
- The required geometric relationship with the part; the typical value is Inside.
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
internal IEnumerable<T> FindPartsWithin<T>(Geometry geo, SearchFlags srch, SearchInclusion overlap, SearchLayers layers)
result = diagramPanel.FindPartsWithin(geo, srch, overlap, layers)
Search all parts that are at inside a given geometry that meet certain criteria and return a collection of those that match.
- geo
- a Geometry in model coordinates
- srch
- Which kinds of parts to include; a typical value might be SelectableParts.
- overlap
- The required geometric relationship with the geometry; the typical value is Inside.
- layers
- The kinds of Layers to search in. For example, if you are looking for Nodes, using the value Nodes, this will speed up the search by ignoring layers containing Links.
Returns: a perhaps empty collection of elements of type
public T GetLayer<T>(string name)
result = diagramPanel.GetLayer(name)
Find a Layer of the given type with exactly the same Id as the given , or return a default layer of the given type.
- name
protected virtual void InitializeLayers()
diagramPanel.InitializeLayers()
If there are no Layers in this panel's collection of Children, create the standard set of layers.
public static bool IsDoubleClick(MouseButtonEventArgs e)
result = DiagramPanel.IsDoubleClick(e)
This predicate is true if the mouse button event represents a double-click.
- e
internal bool IsUnoccupied(Rect r, Predicate<Part> skip)
result = diagramPanel.IsUnoccupied(r, skip)
Returns true if there are any nodes within or intersecting the given rectangular region.
- r
- a Rect in model coordinates
- skip
- a predicate that should return true for nodes to be ignored when checking for collisions, usually the node in the document that you are considering moving; may be null to consider all non-temporary nodes
public void LineDown()
diagramPanel.LineDown()
Increases the VerticalOffset by ScrollVerticalLineChange. (Implements IScrollInfo.)
public void LineLeft()
diagramPanel.LineLeft()
Decreases the HorizontalOffset by ScrollHorizontalLineChange. (Implements IScrollInfo.)
public void LineRight()
diagramPanel.LineRight()
Increases the HorizontalOffset by ScrollHorizontalLineChange. (Implements IScrollInfo.)
public void LineUp()
diagramPanel.LineUp()
Decreases the VerticalOffset by ScrollVerticalLineChange. (Implements IScrollInfo.)
public BitmapSource MakeBitmap(Size bmpsize, double dpi, Point viewpos, double scale)
result = diagramPanel.MakeBitmap(bmpsize, dpi, viewpos, scale)
Return a bitmap showing the parts in a particular area, drawn at a given scale.
- bmpsize
- the size of the resulting bitmap
- dpi
- bitmap resolution
- viewpos
- a Point in model coordinates
- scale
- a value of 1.0 is normal; the value must be a positive number. Smaller values produce smaller-looking parts.
Returns: a BitmapSource
public BitmapSource MakeBitmap()
result = diagramPanel.MakeBitmap()
Generates a bitmap displaying the parts currently visible in the diagram.
Returns: a BitmapSource
public BitmapSource MakeBitmap(Size bmpsize, double dpi, Point viewpos, double scale, Action<BitmapSource> act)
result = diagramPanel.MakeBitmap(bmpsize, dpi, viewpos, scale, act)
Return a bitmap showing the parts in a particular area, drawn at a given scale.
- bmpsize
- the size of the resulting bitmap, rounded up to the nearest integer
- dpi
- bitmap resolution
- viewpos
- a Point in model coordinates for the top-left corner of the area to be rendered
- scale
- a value of 1.0 is normal; the value must be a positive number. Smaller values produce smaller-looking parts.
- act
- an Action taking the BitmapSource to be performed later; this may be null
Returns: a BitmapSource
public Rect MakeVisible(Visual visual, Rect rectangle)
result = diagramPanel.MakeVisible(visual, rectangle)
Scroll the diagram so that a given element () is in the viewport. (Implements IScrollInfo.)
- visual
- rectangle
- The region of the element to bring into view. This value is normally Rect.Empty, meaning as much of the whole visual element as will fit into the viewport.
Returns: the result of calling Rect)
protected override Size MeasureOverride(Size availableSize)
result = diagramPanel.MeasureOverride(availableSize)
Measure each of the Layers in this panel.
- availableSize
public void MouseWheelDown()
diagramPanel.MouseWheelDown()
Increases the VerticalOffset by ScrollVerticalLineChange times the number of lines to scroll for mouse wheel rotation. (Implements IScrollInfo.)
public void MouseWheelLeft()
diagramPanel.MouseWheelLeft()
Decreases the HorizontalOffset by ScrollHorizontalLineChange times the number of lines to scroll for mouse wheel rotation. (Implements IScrollInfo.)
public void MouseWheelRight()
diagramPanel.MouseWheelRight()
Increases the HorizontalOffset by ScrollHorizontalLineChange times the number of lines to scroll for mouse wheel rotation. (Implements IScrollInfo.)
public void MouseWheelUp()
diagramPanel.MouseWheelUp()
Decreases the VerticalOffset by ScrollVerticalLineChange times the number of lines to scroll for mouse wheel rotation. (Implements IScrollInfo.)
protected virtual void OnBoundsAlignmentChanged()
diagramPanel.OnBoundsAlignmentChanged()
This overridable method is called when the DiagramBounds or HorizontalContentAlignment or VerticalContentAlignment or Stretch properties change.
protected virtual void OnDiagramBoundsChanged(RoutedPropertyChangedEventArgs<Rect> e)
diagramPanel.OnDiagramBoundsChanged(e)
Raise the DiagramBoundsChanged event.
- e
protected override void OnDragEnter(DragEventArgs e)
diagramPanel.OnDragEnter(e)
Handle a DragEnter event.
- e
protected override void OnDragLeave(DragEventArgs e)
diagramPanel.OnDragLeave(e)
Handle a DragLeave event.
- e
protected override void OnDragOver(DragEventArgs e)
diagramPanel.OnDragOver(e)
Handle a DragOver event.
- e
protected override void OnDrop(DragEventArgs e)
diagramPanel.OnDrop(e)
Handle a Drop event.
- e
protected override void OnGiveFeedback(GiveFeedbackEventArgs e)
diagramPanel.OnGiveFeedback(e)
Handle a GiveFeedback event.
- e
protected virtual void OnInitialLayoutCompleted()
diagramPanel.OnInitialLayoutCompleted()
This overridable method is called after the first layout has been performed and the DiagramBounds has been computed.
protected virtual void OnLayoutCompleted()
diagramPanel.OnLayoutCompleted()
This overridable method is called after each layout has been performed and the DiagramBounds has been computed.
protected override void OnLostMouseCapture(MouseEventArgs e)
diagramPanel.OnLostMouseCapture(e)
Handle the event when mouse capture is lost.
- e
protected override void OnMouseDown(MouseButtonEventArgs e)
diagramPanel.OnMouseDown(e)
Handle a mouse down event.
- e
protected override void OnMouseEnter(MouseEventArgs e)
diagramPanel.OnMouseEnter(e)
Handle a mouse enter event.
- e
protected override void OnMouseMove(MouseEventArgs e)
diagramPanel.OnMouseMove(e)
Handle a mouse move event.
- e
protected override void OnMouseUp(MouseButtonEventArgs e)
diagramPanel.OnMouseUp(e)
Handle a mouse up event.
- e
protected override void OnMouseWheel(MouseWheelEventArgs e)
diagramPanel.OnMouseWheel(e)
Handle a mouse wheel event.
- e
protected virtual void OnPositionChanged(Point oldpos, Point newpos)
diagramPanel.OnPositionChanged(oldpos, newpos)
This overridable method is called when the Position changes.
- oldpos
- a Point in model coordinates
- newpos
- a Point in model coordinates
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e)
diagramPanel.OnQueryContinueDrag(e)
Handle a QueryContinueDrag event.
- e
protected virtual void OnScaleChanged(double oldscale, double newscale)
diagramPanel.OnScaleChanged(oldscale, newscale)
This overridable method is called when the Scale changes.
- oldscale
- a double
- newscale
- a double
protected virtual void OnSizeChanged(Size oldsize, Size newsize)
diagramPanel.OnSizeChanged(oldsize, newsize)
This overridable method is called when the panel's actual size changes.
- oldsize
- a Size in element coordinates
- newsize
- a Size in element coordinates
protected virtual void OnViewportBoundsChanged(RoutedPropertyChangedEventArgs<Rect> e)
diagramPanel.OnViewportBoundsChanged(e)
Raise the ViewportBoundsChanged event.
- e
protected override void OnVisualParentChanged(DependencyObject oldParent)
diagramPanel.OnVisualParentChanged(oldParent)
Every DiagramPanel should be in the visual tree of a Diagram.
- oldParent
public void PageDown()
diagramPanel.PageDown()
Increases the VerticalOffset by ViewportHeight. (Implements IScrollInfo.)
public void PageLeft()
diagramPanel.PageLeft()
Decreases the HorizontalOffset by ViewportWidth. (Implements IScrollInfo.)
public void PageRight()
diagramPanel.PageRight()
Increases the HorizontalOffset by ViewportWidth. (Implements IScrollInfo.)
public void PageUp()
diagramPanel.PageUp()
Decreases the VerticalOffset by ViewportHeight. (Implements IScrollInfo.)
public void PerformGesture(GestureModifiers modifiers, Gesture action, Point down, Point up, Diagram other)
diagramPanel.PerformGesture(modifiers, action, down, up, other)
Simulate some mouse events.
- modifiers
- a GestureModifiers value, some combination of Control, Shift, and Alt
- action
- a Gesture value, typically MouseLeftButton; a value of None does nothing
- down
- the Point in model coordinates for the mouse down event; this value must be within the ViewportBounds
- up
- the Point in model coordinates for the mouse up event; this value must be within the ViewportBounds
- other
- The Diagram where the mouse up occurs. If this is different from this panel's Diagram, a simulated drag-and-drop will occur. (This does not use real Windows drag-and-drop in WPF.) This may be null to use this panel's diagram, thus keeping the whole gesture within this one diagram.
public void SetHorizontalOffset(double offset)
diagramPanel.SetHorizontalOffset(offset)
Change the value of HorizontalOffset by changing the value of Position. (Implements IScrollInfo.)
- offset
public void SetScaleAndPosition(double newscale, Point newpos, int animationtime, Action act)
diagramPanel.SetScaleAndPosition(newscale, newpos, animationtime, act)
Set the Scale and Position properties with animation.
- newscale
- the new positive double value for Scale
- newpos
- the new Point value for Position
- animationtime
- a time in milliseconds; if a very short time, no animation occurs and the properties are simply set
- act
- an Action to perform after the animation is finished; null to do nothing afterwards
public void SetVerticalOffset(double offset)
diagramPanel.SetVerticalOffset(offset)
Change the value of VerticalOffset by changing the value of Position. (Implements IScrollInfo.)
- offset
public void StopAutoScroll()
diagramPanel.StopAutoScroll()
Stop any ongoing auto-scroll action.
public Point TransformModelToView(Point p)
result = diagramPanel.TransformModelToView(p)
Convert a Point in model coordinates to element coordinates.
- p
public Point TransformViewToModel(Point p)
result = diagramPanel.TransformViewToModel(p)
Convert a Point in element coordinates to model coordinates.
- p
public void UpdateDiagramBounds()
diagramPanel.UpdateDiagramBounds()
Request that the DiagramBounds value be updated, with a call to ComputeDiagramBounds.
public void ZoomToFit()
diagramPanel.ZoomToFit()
Change the Scale so that everything within the DiagramBounds fits within the viewport.
public void ZoomToFit(StretchPolicy policy, Action afterwards)
diagramPanel.ZoomToFit(policy, afterwards)
Change the Scale so that everything within the DiagramBounds fits within the viewport.
- policy
- normally a value of Uniform, but may be UniformToFill
- afterwards
- an Action to be performed after the animation is finished; may be null
Events
public event RoutedPropertyChangedEventHandler<Rect> DiagramBoundsChanged
diagramPanel.DiagramBoundsChanged += handler
This event occurs when the diagram's bounds or alignment changes.
public event RoutedPropertyChangedEventHandler<Rect> ViewportBoundsChanged
diagramPanel.ViewportBoundsChanged += handler
This event occurs when the viewport changes.
Fields
public static readonly DependencyProperty AutoScrollDelayProperty
value = DiagramPanel.AutoScrollDelayProperty
Identifies the AutoScrollDelay dependency property.
public static readonly DependencyProperty AutoScrollRegionProperty
value = DiagramPanel.AutoScrollRegionProperty
Identifies the AutoScrollRegion dependency property.
public static readonly DependencyProperty AutoScrollTimeProperty
value = DiagramPanel.AutoScrollTimeProperty
Identifies the AutoScrollTime dependency property.
public static readonly DependencyProperty CanHorizontallyScrollProperty
value = DiagramPanel.CanHorizontallyScrollProperty
Identifies the CanHorizontallyScroll dependency property.
public static readonly DependencyProperty CanVerticallyScrollProperty
value = DiagramPanel.CanVerticallyScrollProperty
Identifies the CanVerticallyScroll dependency property.
public static readonly RoutedEvent DiagramBoundsChangedEvent
value = DiagramPanel.DiagramBoundsChangedEvent
Identifies the DiagramBoundsChanged routed event.
public static readonly DependencyProperty DiagramBoundsProperty
value = DiagramPanel.DiagramBoundsProperty
Identifies the DiagramBounds dependency property.
public static readonly DependencyProperty FixedBoundsProperty
value = DiagramPanel.FixedBoundsProperty
Identifies the FixedBounds dependency property.
public static readonly DependencyProperty HorizontalContentAlignmentProperty
value = DiagramPanel.HorizontalContentAlignmentProperty
Identifies the HorizontalContentAlignment dependency property.
public static readonly DependencyProperty MaximumScaleProperty
value = DiagramPanel.MaximumScaleProperty
Identifies the MaximumScale dependency property.
public static readonly DependencyProperty MinimumScaleProperty
value = DiagramPanel.MinimumScaleProperty
Identifies the MinimumScale dependency property.
public static readonly DependencyProperty PaddingProperty
value = DiagramPanel.PaddingProperty
Identifies the Padding dependency property.
public static readonly DependencyProperty PositionProperty
value = DiagramPanel.PositionProperty
Identifies the Position dependency property.
public static readonly DependencyProperty ScaleProperty
value = DiagramPanel.ScaleProperty
Identifies the Scale dependency property.
public static readonly DependencyProperty ScrollHorizontalLineChangeProperty
value = DiagramPanel.ScrollHorizontalLineChangeProperty
Identifies the ScrollHorizontalLineChange dependency property.
public static readonly DependencyProperty ScrollOwnerProperty
value = DiagramPanel.ScrollOwnerProperty
Identifies the ScrollOwner dependency property.
public static readonly DependencyProperty ScrollVerticalLineChangeProperty
value = DiagramPanel.ScrollVerticalLineChangeProperty
Identifies the ScrollVerticalLineChange dependency property.
public static readonly DependencyProperty StretchProperty
value = DiagramPanel.StretchProperty
Identifies the Stretch dependency property.
public static readonly DependencyProperty VerticalContentAlignmentProperty
value = DiagramPanel.VerticalContentAlignmentProperty
Identifies the VerticalContentAlignment dependency property.
public static readonly RoutedEvent ViewportBoundsChangedEvent
value = DiagramPanel.ViewportBoundsChangedEvent
Identifies the ViewportBoundsChanged routed event.
public static readonly DependencyProperty ZoomPointProperty
value = DiagramPanel.ZoomPointProperty
Identifies the ZoomPoint dependency property.
public static readonly DependencyProperty ZoomTimeProperty
value = DiagramPanel.ZoomTimeProperty
Identifies the ZoomTime dependency property.