This is a migrated thread and some comments may be shown as answers.

How to bind command to user defined function

1 Answer 118 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
york
Top achievements
Rank 1
york asked on 18 Dec 2011, 08:32 AM
Hi,
I created a radrichtextbox with word processor. On the QuickAccessToolBar, the save button is defined as,
                        <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/save.png" Text="Save" />

The event handler for this button is defined by "{Binding Path=SaveCommand}". Where is SaveCommand (I assume it be a function)?

If I want to redefine the event handler for this button, how to specify it?  Thanks.

York

1 Answer, 1 is accepted

Sort by
0
Accepted
Iva Toteva
Telerik team
answered on 20 Dec 2011, 05:14 PM
Hello York Zhang,

The SaveCommand that this command is bound to is defined in the Commands property of RadRichTextBox. You can notice how the DataContext of RadRichTextBoxRibbonUI is bound to the commands property of the RadRichTextBox instance, e.g.

<telerik:RadRichTextBoxRibbonUI DataContext="{Binding Path=Commands, ElementName=richTextBox}" ... >

You can refer to this forum thread for more information and a demo on creating custom commands and wiring RadRichTextBoxRibbonUI to work with them.

Best wishes,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
york
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or