ExtensionMethods.AddPropertyChangeHandler<T> Method (T, DependencyProperty, EventHandler, Type)
Adds a handler that is called when property changes on instance.
Namespace: Microsoft.VisualStudio.PlatformUI
Assembly: Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Sub AddPropertyChangeHandler(Of T As DependencyObject) ( _
instance As T, _
property As DependencyProperty, _
handler As EventHandler, _
targetType As Type _
)
public static void AddPropertyChangeHandler<T>(
this T instance,
DependencyProperty property,
EventHandler handler,
Type targetType
)
where T : DependencyObject
[ExtensionAttribute]
public:
generic<typename T>
where T : DependencyObject
static void AddPropertyChangeHandler(
T instance,
DependencyProperty^ property,
EventHandler^ handler,
Type^ targetType
)
static member AddPropertyChangeHandler :
instance:'T *
property:DependencyProperty *
handler:EventHandler *
targetType:Type -> unit when 'T : DependencyObject
JScript does not support generic types or methods.
Type Parameters
- T
The type of object being bound.
Parameters
instance
Type: TThe instance whose property change will be handled.
property
Type: DependencyPropertyThe property whose change will be handled.
handler
Type: EventHandlerThe handler.
targetType
Type: TypeThe type of the object on which property is set.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type T. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.