Hi
This solution proposed by Synfusion has stopped working with the latest version. Can you provide a new solution
//Get the instance of the toolbar using its template name
Thanks,
Hi,
Thanks for your answer but the problem is not the name change of button control, the problem is that it gives an exception
Thanks in advance
Before 2020 Volume 4 release (18.4 version) release |
After 2020 Volume 4 release (18.4 version) release |
|
|
// Get the instance of the toolbar using its template name
DocumentToolbar toolbar = pdfViewer.Template.FindName("PART_Toolbar", pdfViewer) as DocumentToolbar;
// Get the instance of the file menu button using its template name.
ToggleButton FileButton = (ToggleButton)toolbar.Template.FindName("PART_FileToggleButton", toolbar);
//Get the instance of the file menu button context menu and the item collection.
ContextMenu FileContextMenu = FileButton.ContextMenu;
foreach (MenuItem FileMenuItem in FileContextMenu.Items)
{
//Get the instance of the open menu item using its template name and disable its visibility.
if (FileMenuItem.Name == "PART_OpenMenuItem")
{
FileMenuItem.Visibility = Visibility.Collapsed;
}
}
|
Thanks for your help, problem solved.
Regards,