EventBindingService Class

Defines methods to create, remove, display and query the contents of the event handling class for the current editing context.

Inheritance Hierarchy

System.Object
  Microsoft.Windows.Design.Services.EventBindingService

Namespace:  Microsoft.Windows.Design.Services
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

'Declaration
Public MustInherit Class EventBindingService
public abstract class EventBindingService
public ref class EventBindingService abstract
[<AbstractClass>]
type EventBindingService =  class end
public abstract class EventBindingService

The EventBindingService type exposes the following members.

Constructors

  Name Description
Protected method EventBindingService When overridden in a derived class, initializes a new instance of the EventBindingService class.

Top

Methods

  Name Description
Public method AddEventHandler When overridden in a derived class, requests that a specified method be declared as handling a specified event.
Public method AllowClassNameForMethodName When overridden in a derived class, determines whether a class name can be used in creating a unique method name in a language.
Public method AppendStatements Appends the specified collection of CodeStatement objects to the specified event handler.
Public method CreateMethod When overridden in a derived class, creates a method that handles an event.
Public method CreateUniqueMethodName When overridden in a derived class, returns a unique method name for an event handler.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetCompatibleMethods When overridden in a derived class, returns the names of methods that are compatible with a specified event.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetMethodHandlers When overridden in a derived class, returns a list of methods that handle a specified event.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IsExistingMethodName When overridden in a derived class, determines whether a method name that handles a specified event already exists.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnEventHandlerGenerated Raises the EventHandlerGenerated event.
Public method RemoveHandle When overridden in a derived class, requests that a specific method stop handling a specific event by removing it from a Handles clause.
Public method RemoveHandlesForName Removes the event handlers for the specified element.
Public method RemoveMethod When overridden in a derived class, requests that a specific method stop handling a specific event by removing it from an event handling class.
Public method SetClassName When overridden in a derived class, identifies the methods that the binding service is referring to as belonging to the specified class.
Public method ShowMethod When overridden in a derived class, attempts to display the specified method to the user.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method ValidateMethodName When overridden in a derived class, determines whether a method name is a valid method name and raises an exception if it is not.

Top

Events

  Name Description
Public event EventHandlerGenerated Occurs when a method is associated with a ModelEvent as a result of a call to the AddEventHandler method.

Top

Remarks

There are two ways to associate events with event handlers in Visual Studio. The first is by using the Handles keyword, and the second is by using the AddHandler and RemoveHandler methods. In C#, using += and -= with an EventHandler corresponds to AddHandler and RemoveHandler. Both ways can be used in Visual Basic. Only the second way can be used in C#. For more information, see the following topics:

Events (Visual Basic)

Events (C# Programming Guide)

Creating Event Handlers in Windows Forms

Events (WPF)

You can use the EventBindingService class to extend this behavior.

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.Windows.Design.Services Namespace

ModelEditingScope

ModelEvent

ModelEventCollection

Other Resources

WPF Designer Extensibility Architecture