简体   繁体   中英

RadRichTextBox ContextMenu Click Event WPF

In a scenario i need to handle the click event of a menu inside the default ContextMenu of RadRichTextBox . Is there anyway that i can get click event of the "Edit Hyperlink" in the ContextMenu?

超连结

Or do i have any alternate solution?

You could handle the RadMenuItem.Click event:

<telerik:RadRichTextBox x:Name="rtb" telerik:RadMenuItem.Click="rtb_Click" />

private void rtb_Click(object sender, RoutedEventArgs e)
{
    Telerik.Windows.Controls.RadMenuItem item = e.OriginalSource as Telerik.Windows.Controls.RadMenuItem;
    if (item != null && item.Header != null && item.Header.ToString() == "Edit Hyperlink...")
    {
        //...
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM