Example of Context menu in WPF

Context Menu Introduction:
Context menu means a window appear when we click on right button of mouse on selected Text. Today, we will design context menu with the help of WPF. Here, we will take a Input control with context menu also context menu contain MenuItem.

        <RichTextBox >
                    <MenuItem Command="Cut">
                            <Image Source="apple.png"/>
                    <MenuItem Command="Copy">
                            <Image Source="grapes.png"/>

Suppose, your richTextBox is disabled and you want to show context menu on disabled item then use this code:

<RichTextBox IsEnabled="False" ContextMenuService.ShowOnDisabled="True">

Example of Context menu in WPF Example of Context menu in WPF Reviewed by Jacob Lefore on December 16, 2015 Rating: 5

No comments