Share via


Behavior Generic Class

Encapsulates state information and zero or more ICommands into an attachable object.

Namespace: System.Windows.Interactivity
Assembly: System.Windows.Interactivity (in system.windows.interactivity.dll)

Syntax

'Declaration
Public MustInherit Class Behavior(Of T As DependencyObject)
    Inherits Behavior
'Usage
Dim instance As Behavior(Of T)
public abstract class Behavior<T> : Behavior where T : DependencyObject
generic<typename T> where T : DependencyObject
public ref class Behavior abstract : public Behavior

Remarks

Behavior is the base class for providing attachable state and commands to an object. The types the Behavior can be attached to can be controlled by the generic parameter. Override OnAttached() and OnDetaching() methods to hook and unhook any necessary handlers from the AssociatedObject.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Freezable
         System.Windows.Media.Animation.Animatable
           System.Windows.Interactivity.Behavior
            System.Windows.Interactivity.Behavior
               Microsoft.Expression.Interactivity.Core.ConditionBehavior
               Microsoft.Expression.Interactivity.Core.DataStateBehavior
               Microsoft.Expression.Interactivity.Input.TranslateZoomRotateBehavior
               Microsoft.Expression.Interactivity.Layout.FluidMoveBehaviorBase
               Microsoft.Expression.Interactivity.Layout.MouseDragElementBehavior

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

Behavior Members
System.Windows.Interactivity Namespace