共用方式為


BehaviorCollection Class

Represents a collection of IBehaviors with a shared AssociatedObject.

Inheritance Hierarchy

DependencyObjectCollection
  Microsoft.Xaml.Interactivity.BehaviorCollection

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

Syntax

'Declaration
Public NotInheritable Class BehaviorCollection _
    Inherits DependencyObjectCollection
public sealed class BehaviorCollection : DependencyObjectCollection
public ref class BehaviorCollection sealed : public DependencyObjectCollection
[<Sealed>]
type BehaviorCollection =  
    class 
        inherit DependencyObjectCollection 
    end
public final class BehaviorCollection extends DependencyObjectCollection

The BehaviorCollection type exposes the following members.

Constructors

  Name Description
Public method BehaviorCollection Initializes a new instance of the BehaviorCollection class.

Top

Properties

  Name Description
Public property AssociatedObject Gets the DependencyObject to which the BehaviorCollection is attached.

Top

Methods

  Name Description
Public method Attach Attaches the collection of behaviors to the specified DependencyObject.
Public method Detach Detaches the collection of behaviors from the AssociatedObject.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Xaml.Interactivity Namespace