Back to Devexpress

DiagramItemBoundsChangedEventArgs.NewParent Property

wpf-devexpress-dot-xpf-dot-diagram-dot-diagramitemboundschangedeventargs-c2fab261.md

latest2.6 KB
Original Source

DiagramItemBoundsChangedEventArgs.NewParent Property

Returns the item’s new parent.

Namespace : DevExpress.Xpf.Diagram

Assembly : DevExpress.Xpf.Diagram.v25.2.dll

NuGet Package : DevExpress.Wpf.Diagram

Declaration

csharp
public DiagramItem NewParent { get; }
vb
Public ReadOnly Property NewParent As DiagramItem

Property Value

TypeDescription
DiagramItem

A DiagramItem object.

|

Remarks

If the item is contained in a container, the NewParent property returns the DiagramContainer object representing this container. Otherwise, it returns the DevExpress.Xpf.Diagram.DiagramRoot object.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the NewParent property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-generate-diagram-with-grouped-items/VB/DiagramNestedItemsExample/StackLayoutDiagramContainerBehavior.vb#L82

vb
Private Sub OnDiagramItemBoundsChanged(ByVal sender As Object, ByVal e As DiagramItemBoundsChangedEventArgs)
    If Equals(e.NewParent, AssociatedObject) AndAlso (Not Equals(e.OldParent, AssociatedObject)) Then
        AddChild(e.Item, e.NewIndex = 0)

See Also

OldParent

DiagramItemBoundsChangedEventArgs Class

DiagramItemBoundsChangedEventArgs Members

DevExpress.Xpf.Diagram Namespace