How to show/hide the toolbar items in built-in toolbar

Good day, 

I am trying to hide certain toolbar items on the PdfViewer toolbar using a MVVM pattern, but am unable to see how this can be done through the View? 

I would ideally like to enable and disable certain toolbar items in the xaml on the actual control, but it seems as though only the bookmark can be set, with the rest having to be done in the View Model?

Please advise if there is any way around this.

Thanks

3 Replies 1 reply marked as answer

AV Ashokkumar Viswanathan Syncfusion Team July 7, 2020 09:58 AM UTC

Hi Daniel, 
 
Thank you for contacting Syncfusion support, 
 
Currently, we do not have support to disable and enable certain toolbar items in Xaml, which can be performed only in code behind. Could you please explain your requirement elaborately. So that it will be useful for us to investigate further on this and assist you with a better solution at the earliest.    
 
Please find the UG documentation below, where we can hide/show the toolbar items in code behind, 
 
Regards, 
Ashok Kumar Viswanathan. 



DA Daniel July 8, 2020 02:15 PM UTC

Hi Ashokkumar, 

I am trying to disable the print and possibly the save button in the toolbar, but there is no way it can be explicitly done in the xaml. The bookmark button is supported, but that is the only one (the property is a bool called "BookmarkNavigationEnabled"). I am following a MVVM pattern, which means that this is problematic for me if I want to have any form of a unique toolbar on my PDF viewer. 

Thanks for your assistance.


AV Ashokkumar Viswanathan Syncfusion Team July 9, 2020 11:39 AM UTC

Hi Daniel,   
   
As mentioned before, we do not have support to disable and enable particular toolbar items in Xaml, which can be performed only in code behind. However, you can achieve your requirement of using the MVVM pattern by using a custom toolbar instead of an in-built toolbar.     
   
Please find the sample in the below link, which used the custom toolbar with all the functionality of In-built toolbar,   
    
Please try the above sample and let us know whether the provided sample resolved your issue.  
 
Regards, 
Ashok Kumar Viswanathan. 


Marked as answer
Loader.
Up arrow icon