Share via


BehaviorCollection.Attach Method

Attaches the collection of behaviors to the specified DependencyObject.

Namespace:  Microsoft.Xaml.Interactivity
Assembly:  Microsoft.Xaml.Interactivity (in Microsoft.Xaml.Interactivity.dll)

Syntax

'Declaration
Public Sub Attach ( _
    associatedObject As DependencyObject _
)
public void Attach(
    DependencyObject associatedObject
)
public:
void Attach(
    DependencyObject^ associatedObject
)
member Attach : 
        associatedObject:DependencyObject -> unit
public function Attach(
    associatedObject : DependencyObject
)

Parameters

  • associatedObject
    Type: DependencyObject

    The DependencyObject to which to attach.

Exceptions

Exception Condition
InvalidOperationException

The BehaviorCollection is already attached to a different DependencyObject.

.NET Framework Security

See Also

Reference

BehaviorCollection Class

Microsoft.Xaml.Interactivity Namespace