Version

Managing the Context Menu (xamRichTextEditor)

Topic Overview

Purpose

This topic explains how to manage the context menu of the xamRichTextEditor ™.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic provides an overview of the features supported by the xamRichTextEditor control.

This topic explains the document’s content logical structure you can use to edit the contents in the xamRichTextEditor programmatically.

This topic provides detailed instructions to help you get up and running as quickly as possible with the xamRichTextEditor .

In this topic

This topic contains the following sections:

Introduction

Context menu summary

The xamRichTextEditor control supports a context menu allowing users to perform clipboard operations and create tables. You can customize the content of the context menu or even hide it, which is discussed later in this topic.

The following screen shot shows an opened xamRichTextEditor’s context menu:

xamRichTextEditor CMenu01.png

Customizing the Context menu

Overview

The xamRichTexEditor exposes a cancelable event called ContextMenuOpening used to prevent the context menu from showing or to customize the content of the context menu. In either case, you must hook an event handler to the ContextMenuOpening event and obtain the ContextMenuOpeningEventArgs argument provided to the event handler. You can also attach an event handler to the ContextMenuClosing event to be notified when the context menu closes.

Property settings

The following table maps the desired behavior to its respective property settings.

In order to: Use this property/collection: And:

Prevent the context menu from showing

Set it to true

Change the content of the context menu

Edit the Items collection (add/remove/edit XamMenuItems)

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains how to configure several useful content editing features of the xamRichTextEditor control.

This topic describes how you can add or remove xamMenuItems.