Behavior Generic Class

將狀態資訊及零或多個 ICommands 封裝到可附加的物件中。

命名空間: System.Windows.Interactivity
組件: System.Windows.Interactivity (在 system.windows.interactivity.dll 中)

語法

'宣告
Public MustInherit Class Behavior(Of T As DependencyObject)
    Inherits Behavior
'用途
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

備註

Behavior 是將可附加的狀態及命令提供給物件的基底類別。Behavior 可以附加到的類型可由泛型參數來控制。覆寫 OnAttached() 和 OnDetaching() 方法,以便從 AssociatedObject 連接及取消連接任何必要的處理常式。

繼承階層

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

執行緒安全性

此型別的所有公用靜態 (Visual Basic 中為 Shared ) 成員均為安全執行緒。任何例項成員則不保證為安全執行緒。

另請參閱

參照

Behavior 成員
System.Windows.Interactivity 命名空間