Condividi tramite


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: T

    The instance whose property change will be handled.

  • property
    Type: DependencyProperty

    The property whose change will be handled.

  • handler
    Type: EventHandler

    The handler.

  • targetType
    Type: Type

    The 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

See Also

Reference

ExtensionMethods Class

AddPropertyChangeHandler Overload

Microsoft.VisualStudio.PlatformUI Namespace