Share via


MenuActionEventArgs Class

Provides data for MenuAction events.

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

Syntax

'Declaration
Public Class MenuActionEventArgs _
    Inherits EventArgs
'Usage
Dim instance As MenuActionEventArgs
public class MenuActionEventArgs : EventArgs
public ref class MenuActionEventArgs : public EventArgs
public class MenuActionEventArgs extends EventArgs

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 MenuAction.

' 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(Control.BackgroundProperty).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[Control.BackgroundProperty].ClearValue();
}

Inheritance Hierarchy

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

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

MenuActionEventArgs Members

Microsoft.Windows.Design.Interaction Namespace

PrimarySelectionContextMenuProvider

MenuAction

MenuGroup

ModelItem

Other Resources

Walkthrough: Creating a MenuAction