|
//Get the instance of the toolbar using its template name
DocumentToolbar toolbar = pdfViewerControl.Template.FindName("PART_Toolbar", pdfViewerControl) as DocumentToolbar;
//Get the instance of the open file button using its template name
Button openButton = (Button)toolbar.Template.FindName("PART_ButtonOpen", toolbar);
//Set false to disable the button.
openButton.IsEnabled = false;
//Get the instance of the left pane using its template name
OutlinePane outlinePane = pdfViewerControl.Template.FindName("PART_OutlinePane", pdfViewerControl) as OutlinePane;
//Get the instance of the thumbnail button using its template name
ToggleButton thumbnailButton = (ToggleButton) outlinePane.Template.FindName("PART_ThumbnailButton", outlinePane);
thumbnailButton.IsEnabled = false;
|
|
Query |
Details |
|
seems that your example doesn't work anymore (in version 18.4.0.34), probably the template has been changed resulting in openButton being null and rest of the code is failing. And also provided help link has old info in there. |
Sorry for the inconvenience caused,
In our recent release 2020 Volume 4 release (18.4 version), we have added “Save As” support in our control. Based on user convenience, we have grouped the File Menu items (Open, Save, Save As and Print) into a Single Toggle Button. The Button controls Open, Save and Print are now changed to Menu item. We will update the UG contents with the above-mentioned information.
|
|
Can you please provide an updated example? What I need is to hide Open and Save (as) buttons and move print button to the main toolbar - I don't want to have it in popup. |
Based on your requirement we have created a sample, in which we have removed the File menu items from the toolbar wrap panel and added a button for Print. Sample can be downloaded from the below link, https://www.syncfusion.com/downloads/support/forum/155391/ze/PdfViewerWPF1294043857.
Please let us know whether the provided sample is helpful to achieve your requirement or if you need any further assistance on this.
|