# Default UI

Use the predefined user interface (UI) of `RadPdfViewer` to add PDF viewing commands to your application. `RadPdfViewerToolBar` provides page navigation, [zoom](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/zoom-in-or-out-a-radfixeddocument), and buttons to open, save, and print documents.

`RadPdfViewerNavigationPane` displays navigation panels, including the document's [bookmarks](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/bookmarks). Add the components you need with the Visual Studio designer, then customize the toolbar and context menu.

> caption RadPdfViewer with default UI, RadPdfViewerNavigationPane, and context menu

![PDF document with a toolbar, navigation pane, and context menu](https://www.telerik.com/products/wpf/documentation/assets/3c1c098650b0778f5169df578b749e13/radpdfviewer_defaultui_00.png)

## Adding RadPdfViewer with Predefined UI to Your Application

Before you begin, configure your Windows Presentation Foundation (WPF) project with the references described in [Getting Started with RadPdfViewer](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/getting-started). Include the dialogs and additional UI references, not only the minimal viewer references. For NuGet applications that use Xaml binaries, install `Telerik.Windows.Controls.FixedDocumentViewersUI.for.Wpf.Xaml`. For NoXaml applications, follow the package and theme guidance in the getting-started article.

> note The designer's component-selection dialog is available starting with R1 2018.

To add the viewer and choose its UI components:

1. Drag `RadPdfViewer` from the Visual Studio **Toolbox** to the XAML (Extensible Application Markup Language) designer.
2. Select the components you need in the component-selection dialog and select **OK** to generate the XAML.

The dialog provides the following options:

* **Add ToolBar**—Adds `RadPdfViewerToolBar` with PDF viewing commands. Clear this option to omit the toolbar.

* **Add Signature Panel**—Adds a panel that shows validation results for documents with [digital signatures](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/digital-signature).

* **Add Context Menu**—Adds the viewer's [context menu](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/ui/context-menu).

* **Add Find Dialog**—Adds the **[Find Dialog](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/ui/find-dialog)** for document searches.

* **Add Signature Properties Dialog**—Adds the **[Signature Properties Dialog](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/digital-signature#using-signaturepropertiesdialog)**.

* **Add Sign Signature Dialog**—Adds the **[Sign Signature Dialog](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/digital-signature#signing)**.

* **Add Navigation Pane**—Adds `RadPdfViewerNavigationPane` to display the document's bookmarks.

> caption Choose the components you would like to use

![Component-selection dialog with checkboxes for the toolbar, panels, context menu, and dialogs](https://www.telerik.com/products/wpf/documentation/assets/b5eb9ed036ecbf77b626330ec5b196fa/radpdfviewer_defaultui_01.png)

**Example 1** shows the XAML generated when you select all options.

**\[XAML] Example 1: Default UI**

```XAML

	<Grid>
	    <Grid.RowDefinitions>
	        <RowDefinition Height="Auto"/>
	        <RowDefinition Height="Auto"/>
	        <RowDefinition/>
	    </Grid.RowDefinitions>
	    <telerik:RadPdfViewerToolBar RadPdfViewer="{Binding ElementName=pdfViewer, Mode=OneTime}" SignaturePanel="{Binding ElementName=signaturePanel, Mode=OneTime}"/>
	    <telerik:SignaturePanel x:Name="signaturePanel" PdfViewer="{Binding ElementName=pdfViewer, Mode=OneWay}" Grid.Row="1"/>
	    <Grid Grid.Row="2">
	        <Grid.ColumnDefinitions>
	            <ColumnDefinition Width="Auto"/>
	            <ColumnDefinition Width="*"/>
	        </Grid.ColumnDefinitions>
	        <telerik:RadPdfViewerNavigationPane RadPdfViewer="{Binding ElementName=pdfViewer, Mode=OneTime}"/>
	        <telerik:RadPdfViewer x:Name="pdfViewer" Grid.Column="1" DataContext="{Binding CommandDescriptors, ElementName=pdfViewer}" telerik:RadPdfViewerAttachedComponents.RegisterSignSignatureDialog="True" telerik:RadPdfViewerAttachedComponents.RegisterFindDialog="True" telerik:RadPdfViewerAttachedComponents.RegisterSignaturePropertiesDialog="True" telerik:RadPdfViewerAttachedComponents.RegisterContextMenu="True"/>
	    </Grid>
	</Grid>
```

## Customizing the Default UI

Use the toolbar properties to show or hide existing buttons and sections. For custom buttons or layout changes, replace the toolbar with editable XAML.

For project prerequisites, see [Getting Started with RadPdfViewer](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/getting-started).

### Adding and Removing Buttons and Sections from RadPdfViewerToolBar

`RadPdfViewerToolBar` exposes properties that show or hide parts of its UI. Select the toolbar in the Visual Studio designer and open the **Properties** window to find the available options.

> caption Toolbar customization options in the Visual Studio Properties window

![Checkboxes for showing or hiding RadPdfViewerToolBar buttons and sections](https://www.telerik.com/products/wpf/documentation/assets/f282129e440b0253a6dd90a2ba261f8e/radpdfviewer_defaultui_02.png)

The default value for all of the **ToolBar Customization** options is `true`. Clear an option to set the corresponding property in XAML to `false`. **Example 2** shows these properties in XAML.

**\[XAML] Example 2: Using the properties of RadPdfViewerToolBar**

```XAML

	<telerik:RadPdfViewerToolBar RadPdfViewer="{Binding ElementName=pdfViewer, Mode=OneTime}" 
	                                HasPrintButton="False" HasSaveButton="False" HasSignatureButton="False" 
	                                HasZoomOutButton="False" HasZoomInButton="False" HasPercentComboBox="False" 
	                                HasPanTextSelectionGroup="False" HasPageUpButton="False" HasPagesCountGroup="False" 
	                                HasPageDownButton="False" HasOpenButton="False" HasFitToWidthButton="False" 
	                                HasFitToPageButton="False" HasCounterclockwiseButton="False" HasClockwiseButton="False"/>
```

### Customizing the Template of RadPdfViewerToolBar

To add a custom button or change the toolbar layout, replace `RadPdfViewerToolBar` with editable XAML:

1. Right-click `RadPdfViewerToolBar` in the Visual Studio designer.
2. Select **Replace RadPdfViewerToolBar with Editable XAML** from the context menu.

> caption Replace RadPdfViewerToolBar with editable XAML option of the Visual Studio designer's context menu

![Designer context menu command for replacing the PDF viewer toolbar with editable markup](https://www.telerik.com/products/wpf/documentation/assets/f67f6ffb5550e3042049c929190203a9/radpdfviewer_defaultui_03.png)

> important This operation replaces the `RadPdfViewerToolBar` instance with its generated XAML. The extracted markup no longer receives the toolbar control's automatic UI updates or styling support. Use the toolbar properties instead when you only need to show or hide existing buttons.

### Customizing the Template of the Default Context Menu

To edit the default context menu's XAML:

1. Right-click `RadPdfViewer` in the Visual Studio designer.
2. Select **Replace Default Context Menu with Editable XAML** from the context menu.

For context-menu configuration details, see the [context menu documentation](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/ui/context-menu).

## See Also

* [Getting Started with RadPdfViewer](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/getting-started)
* [Showing a File](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/showing-a-file)
* [Bookmarks](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/bookmarks)
* [Interactive Forms](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/interactive-forms)
