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)");
    }
}