Share via


ParentAdapter.RedirectParent Method

Redirect a reference from one parent to another. .

Namespace:  Microsoft.Windows.Design.Interaction
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

'Declaration
Public Overridable Function RedirectParent ( _
    parent As ModelItem, _
    childType As Type _
) As ModelItem
public virtual ModelItem RedirectParent(
    ModelItem parent,
    Type childType
)
public:
virtual ModelItem^ RedirectParent(
    ModelItem^ parent, 
    Type^ childType
)
abstract RedirectParent : 
        parent:ModelItem * 
        childType:Type -> ModelItem 
override RedirectParent : 
        parent:ModelItem * 
        childType:Type -> ModelItem 
public function RedirectParent(
    parent : ModelItem, 
    childType : Type
) : ModelItem

Parameters

Return Value

Type: Microsoft.Windows.Design.Model.ModelItem
A redirected parent. The default implementation returns parent.

Exceptions

Exception Condition
ArgumentNullException

parent or childType is nulla null reference (Nothing in Visual Basic).

Remarks

Locating a parent generally flows from the selected object upward until an appropriate parent is found. For some scenarios, an element may want to redirect this location process to another element. For example, a ContentControl can be the parent of only a single element. If the ContentControl already contains a Panel and the user adds a new object, the user's intent is most likely to add new objects to the Panel. This method allows that form of redirection.

.NET Framework Security

See Also

Reference

ParentAdapter Class

Microsoft.Windows.Design.Interaction Namespace

ModelParent

ModelItem

Other Resources

WPF Designer Extensibility