Hide or show sidebar navigation in our viewer

Nutrient MAUI SDK includes contextual sidebars for page thumbnails, document outlines, bookmarks, and annotations. Each sidebar is accessible by pressing its corresponding toolbar button in a dropdownGroup called sidebar, which is, by default, located at the far left of the main toolbar.

These are the corresponding built-in toolbar button types for each sidebar button:

SidebarThumbnailsToggleButton
SidebarDocumentOutlineToggleButton
SidebarAnnotationToggleButton
SidebarBookmarksToggleButton
SidebarSignatureToggleButton

You can read more about built-in items and how to customize the toolbar in the customize existing tools guide.

The sidebar can also be controlled programmatically by setting PDFView.SidebarMode. For a list of all available modes, refer to PSPDFKit.Api.Enums.SidebarMode.

Using this API you can, for example, activate the annotations sidebar:

<!--View-->
<pspdfkit:PDFView x:Name="PDFView" SidebarMode="{Binding SelectedSidebarMode}" />
// ViewModel
public SidebarMode? SelectedSidebarMode
{
	get => _selectedSidebarMode;
    set => SetField(ref _selectedSidebarMode, value);
}

public void OpenDocumentOutlineSidebar() {
	SelectedSidebarMode = SidebarMode.DocumentOutline;
}

Setting sidebarMode to null will hide the sidebar:

// ViewModel
public void HideSidebar() {
	SelectedSidebarMode = null;
}