By default I look all toolbar items and custom tool bar items that are available to potentially use on a page. As the page is load I want to hide toolbar and custom toolbar items based on what the user is allowed to do. This page worked just fine till I wanted a custom button, now I am not able to hide buttons.; The page will get a error on page load.
This code her loads with now problem
<SfPdfViewer2 @ref="Viewer" DocumentPath="@DocumentPath" Height="100vh" Width="100%">
<PdfViewerToolbarSettings ToolbarItems="@ToolbarItems" CustomToolbarItems="@CustomToolbarItems" />
<PdfViewerEvents DocumentLoaded="@DocumentLoaded" ></PdfViewerEvents>
</SfPdfViewer2>
This code errors on load
<SfPdfViewer2 @ref="PDFViewer" DocumentPath="@DocumentPath" ToolbarSettings="@ToolbarSettings" Height="100vh" Width="100%">
<PdfViewerToolbarSettings ToolbarItems="@ToolbarItems" CustomToolbarItems="@CustomToolbarItems" />
<PdfViewerEvents DocumentLoaded="@DocumentLoaded" ></PdfViewerEvents>
</SfPdfViewer2>
Is there is way to customize the menus when the page is initiali