Intersoft ClientUI Documentation
ContextMenuNameProperty Field
See Also  Send Feedback
Intersoft.Client.UI.Aqua Namespace > ContextMenuService Class : ContextMenuNameProperty Field






Identifies the ContextMenuName dependency property.

Syntax

Visual Basic (Declaration) 
Public Shared ReadOnly ContextMenuNameProperty As DependencyProperty
Visual Basic (Usage)Copy Code
Dim value As DependencyProperty
 
value = ContextMenuService.ContextMenuNameProperty
C# 
public static readonly DependencyProperty ContextMenuNameProperty
Delphi 
public field ContextMenuNameProperty: DependencyProperty; static; readonly 
JScript 
public static var ContextMenuNameProperty : DependencyProperty;
Managed Extensions for C++ 
public: static readonly DependencyProperty* ContextMenuNameProperty
C++/CLI 
public:
static readonly DependencyProperty^ ContextMenuNameProperty

Remarks

To use UXContextMenu, you create a UXContextMenu anywhere in your page along with some items such as shown in the following code example.

XAML Copy Code
<Intersoft:UXContextMenu x:Name="ContextMenu1" HorizontalAlignment="Left" VerticalAlignment="Top">
    <Intersoft:UXMenuItem Header="UXMenuItem1"/>
    <Intersoft:UXMenuItem Header="UXMenuItem2"/>
    <Intersoft:UXMenuItem Header="UXMenuItem3"/>
    <Intersoft:UXSeparator/>
    <Intersoft:UXMenuItem Header="About MyApplication v1.0"/>
</Intersoft:UXContextMenu>

To attach the UXContextMenu to an element or control, you attach the ContextMenuService.ContextMenu or ContextMenuService.ContextMenuName property to the desired element, and specify the instance or name of the target context menu.

The following code example shows how to attach the context menu to your root element.

XAML Copy Code
<Grid x:Name="LayoutRoot" Background="White" Intersoft:ContextMenuService.ContextMenu="{Binding ElementName=ContextMenu1}">
    <Intersoft:UXContextMenu x:Name="ContextMenu1" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Intersoft:UXMenuItem Header="UXMenuItem1"/>
        <Intersoft:UXMenuItem Header="UXMenuItem2"/>
        <Intersoft:UXMenuItem Header="UXMenuItem3"/>
        <Intersoft:UXSeparator/>
        <Intersoft:UXMenuItem Header="About MyApplication v1.0"/>
    </Intersoft:UXContextMenu>
</Grid>

Beside attaching to an element, you can also attach the context menu to Silverlight or WPF controls such as a Button, which is shown in the following example.

XAML Copy Code
<Grid x:Name="LayoutRoot" Background="White">
    <Intersoft:UXContextMenu x:Name="ContextMenu1" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Intersoft:UXMenuItem Header="UXMenuItem1"/>
        <Intersoft:UXMenuItem Header="UXMenuItem2"/>
        <Intersoft:UXMenuItem Header="UXMenuItem3"/>
        <Intersoft:UXSeparator/>
        <Intersoft:UXMenuItem Header="About MyApplication v1.0"/>
    </Intersoft:UXContextMenu>

    <Button Content="Right Click on this Button" HorizontalAlignment="Center" VerticalAlignment="Center" Intersoft:ContextMenuService.ContextMenu="{Binding ElementName=ContextMenu1}"/>
</Grid>

Try right clicking at the button and compare it with the previous example.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.