---
title: "Activate or deactivate tools in MAUI PDF viewer toolbar | Nutrient"
canonical_url: "https://www.nutrient.io/guides/maui/user-interface/main-toolbar/activate-or-deactivate-tools/"
md_url: "https://www.nutrient.io/guides/maui/user-interface/main-toolbar/activate-or-deactivate-tools.md"
last_updated: "2026-05-15T19:10:05.048Z"
description: "It’s possible to control the main toolbar to programmatically activate or deactivate specific items or behaviors. for Nutrient MAUI SDK."
---

# Activate or deactivate tools in our viewer toolbar

It’s possible to control the main toolbar to programmatically activate or deactivate specific items or behaviors.

Currently, our default toolbar buttons allow you to control:

- [`InteractionMode`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.Enums.InteractionMode.html), which is the current interaction mode in the viewer.

- [`SidebarMode`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.Enums.SidebarMode.html), which determines which sidebar to show.

- One-off actions that don’t need a permanent (visual) activation state.

In addition, the main toolbar is completely customizable and can host custom toolbar items. Refer to the [customize existing tools](https://www.nutrient.io/guides/maui/user-interface/main-toolbar/customize-existing-tools.md) guide for more details.

## Interaction mode

The interaction mode controls the current interaction mode of the viewer. For example, you can use it to activate or deactivate a tool, like the text annotation one:

```xml

<!-- MyPage.xaml -->...
<pspdfkit:PDFView x:Name="PDFView" Initialized="OnPDFViewInitialized"
                  InteractionMode="{Binding SelectedInteractionMode}" />...

```

```csharp

// MyPage.xaml.cs...
public void OnPDFViewInitialized(object sender, EventArgs e)
{
    _viewModel.OnPDFViewInitialized();
}...

```

```csharp

// MyViewModel.cs...
private InteractionMode? _selectedInteractionMode;

public InteractionMode? SelectedInteractionMode
{
    get => _selectedInteractionMode;
    set
    {
        if (_selectedInteractionMode == value)
        {
            return;
        }

        _selectedInteractionMode = value;
        OnPropertyChanged();
    }
}

public void OnPDFViewInitialized()
{
    // Logic to load document....

    SelectedInteractionMode = InteractionMode.Text;
}...

```

As a result of activating the interaction mode, Nutrient MAUI SDK will also enable the free text annotation button in the toolbar and the corresponding annotation type toolbar.

To reset the interaction mode and deactivate the button, you can set its value to `null`:

```csharp

SelectedInteractionMode = null;

```

See the [API Reference](https://www.nutrient.io/api/maui/) for a comprehensive list of supported [interaction modes](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.Enums.InteractionMode.html).

## Sidebar mode

Similar to `InteractionMode`, it’s possible to control the viewer sidebar by changing the [`PDFView.SidebarMode`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.Enums.SidebarMode.html).
---

## Related pages

- [Customizing existing tools in our viewer toolbar](/guides/maui/user-interface/main-toolbar/customize-existing-tools.md)
- [Create custom tools for MAUI PDF viewer](/guides/maui/user-interface/main-toolbar/create-a-new-tool.md)
- [Customizing download/export buttons in our PDF viewer](/guides/maui/user-interface/main-toolbar/download-export-button.md)
- [Customizing the dropdown navigation in our viewer toolbar](/guides/maui/user-interface/main-toolbar/dropdown-groups.md)
- [Hiding the toolbar in our PDF viewer](/guides/maui/user-interface/main-toolbar/hide-the-toolbar.md)
- [Adding page labels to navigation in our viewer](/guides/maui/user-interface/main-toolbar/page-label-navigation.md)
- [Rearrange tools in our viewer toolbar](/guides/maui/user-interface/main-toolbar/rearrange.md)
- [Adjust the placement of the toolbar in our viewer](/guides/maui/user-interface/main-toolbar/placement.md)
- [Removing a tool from the toolbar in our MAUI viewer](/guides/maui/user-interface/main-toolbar/remove-a-tool.md)
- [Customizing responsive navigation in our viewer toolbar](/guides/maui/user-interface/main-toolbar/responsive-groups.md)

