Hello,
I recently started using the Syncfusion PdfViewer control in a WPF application. It's a simple app that allows you to open a pdf file and using a custom toolbar (as can be seen below) allows the user to insert free text annotations with a pre-set text/size/color.
This new "annotation tool" can be toggled on/off with the "@" button. This way the user can continue clicking on the pdf to insert text boxes. However, I would like to disable the tool when the user selects another annotation tool (pen/eraser/shape/etc.) from the pdfViewer toolbar.
Can an event be added to the control that is being raised when a button on the pdfViewer toolbar is clicked, like ToolbarSelectionChangedEvent?
|
DocumentToolbar toolbar = pdfViewer.Template.FindName("PART_Toolbar", pdfViewer) as DocumentToolbar;
System.Windows.Controls.Primitives.ToggleButton stickyButton = (System.Windows.Controls.Primitives.ToggleButton)toolbar.Template.FindName("PART_StickyNote", toolbar);
stickyButton.Checked += Button_Checked;
private void Button_Checked(object sender, RoutedEventArgs e)
{
//The toggle button that you use to add free text.
Button.IsChecked= false;
} |
Hello Vikas,
Thanks for the suggested solution, I've implemented this and it does exactly what I need. Thanks!