Customizing existing tools in our viewer toolbar

It’s possible to customize the following properties of built-in main toolbar items (IMainToolbarItem):

  • MediaQueries

  • StyleClass

Additionally, all main toolbar buttons (IMainToolbarButton) can be customized with the following properties:

  • IsDisabled

  • Icon

  • Tooltip

All main toolbar toggle buttons (IMainToolbarToggleButton) can be customized with the following properties:

  • IsDisabled

  • IsSelected

  • Icon

  • Tooltip

Refer to the API reference to learn more about each individual property.

The following example modifies the current toolbar items to ensure that the PagerToggleButton is shown in all viewport widths by setting the MediaQueries property to ["(min-width: 1000px)"]:

// Change the `MediaQueries` for the pager item so that it's only shown if the width of `PDFView` is greater than 1000px.
foreach (var item in PSPDFKitController.MainToolbar.ToolbarItems)
{
    if (item is PagerToggleButton)
    {
        item.MediaQueries.Add("(min-width: 1000px)");
    }
}