Skip to content

DevExpress-Examples/wpf-richedit-replace-standard-command-with-custom-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rich Text Editor for WPF - Replace Standard Command with Custom Command

This example illustrates the technique used to modify the functionality of existing DXRichEdit commands.

Implementation Details

The RichEditControl exposes the IRichEditCommandFactoryService interface that enables you to substitute the default command with a custom command.

  1. Create a command class, inherited from the command that you've decided to replace. Override its methods. The main functionality and command specifics is located in the Execute or the ExecuteCore method (the latter does not check for the command availability).

  2. Create a class that implements the IRichEditCommandFactoryService. Override the CreateCommand method to create an instance of a custom command class if an identifier of a certain command is passed as a parameter.

  3. Use this class to substitute the default RichEditControl's service.

Files to Review

Documentation

About

Implement the IRichEditCommandFactoryService interface to substitute default command with your own custom command.

Topics

Resources

License

Stars

Watchers

Forks