Share via


MenuActionEventArgs Class

Provides data for MenuAction events.

Inheritance Hierarchy

System.Object
  System.EventArgs
    Microsoft.Windows.Design.Interaction.MenuActionEventArgs

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

Syntax

'Declaration
Public Class MenuActionEventArgs _
    Inherits EventArgs
public class MenuActionEventArgs : EventArgs
public ref class MenuActionEventArgs : public EventArgs
type MenuActionEventArgs =  
    class
        inherit EventArgs
    end
public class MenuActionEventArgs extends EventArgs

The MenuActionEventArgs type exposes the following members.

Constructors

  Name Description
Public method MenuActionEventArgs Initializes a new instance of the MenuActionEventArgs class.

Top

Properties

  Name Description
Public property Context Gets the currently active editing context.
Public property Selection Gets the current selection on the design surface.

Top

Methods

  Name Description
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 GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

MenuActionEventArgs is used by the UpdateItemStatus and Execute events.

Examples

The following code example shows how to handle the Execute event. It sets the selected control's Background property to its default value. For more information, see Walkthrough: Creating a Menu Provider.

' The following method handles the Execute event. 
' It sets the Background property to its default value.
Sub ClearBackground_Execute( _
    ByVal sender As Object, _
    ByVal e As MenuActionEventArgs)

    Dim selectedControl As ModelItem = e.Selection.PrimarySelection
    selectedControl.Properties("Background").ClearValue()

End Sub
// The following method handles the Execute event. 
// It sets the Background property to its default value.
void ClearBackground_Execute(
    object sender, 
    MenuActionEventArgs e)
{
    ModelItem selectedControl = e.Selection.PrimarySelection;
    selectedControl.Properties["Background"].ClearValue();
}

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.Interaction Namespace

PrimarySelectionContextMenuProvider

MenuAction

MenuGroup

ModelItem

Other Resources

Walkthrough: Creating a Menu Provider