Invoking a command from code is pretty straight-forward, you just need to access the respective command through RadRichTextBox's Commands property and call its Execute() method:
If you want to trigger additional actions prior or after a specific command is executed, you can subscribe to the CommandExecuting and CommandExecuted events of the control respectively. For example, the following snippet warns the user that they are about to create a new document and allows them to save their changes:
sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
MessageBoxButton btnMessageBox = MessageBoxButton.YesNoCancel;
MessageBoxImage icnMessageBox = MessageBoxImage.Warning;
MessageBoxResult rsltMessageBox = MessageBox.Show(
"Save your changes before creating a new document?"
, btnMessageBox, icnMessageBox);
I hope you find this useful.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.