How to bind command to user defined function

2 posts, 1 answers
  1. york
    york avatar
    160 posts
    Member since:
    Jul 2012

    Posted 18 Dec 2011 Link to this post

    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.

  2. Answer
    Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 20 Dec 2011 Link to this post

    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 >>

Back to Top