Some test text!

Search
Hamburger Icon

UWP / Guides / Configuration

Customize the ViewerControl in UWP

ViewerControl is configurable and can be easily customized using it's internal properties which enables the UI components to be hidden and functionalities be disabled.

Configure ViewerControl

The control has a set of options to enable/disable features in the component.

For example:

var viewerCtrl = new ViewerControl();

viewerCtrl.ShowAnnotationToolbarButton = true;
viewerCtrl.ShowPrintOption = true;
viewerCtrl.ShowSaveAsOption = true;
viewerCtrl.ShowShareOption = true;
viewerCtrl.ShowTextSearchOption = true;
viewerCtrl.ShowThumbnailView = true;
viewerCtrl.ShowPDFCompare = true;
viewerCtrl.ShowExportXFDF = true;
viewerCtrl.ShowActionsOption = true;
viewerCtrl.ShowCropView = true;

StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Resources/GettingStarted.pdf"));
if (file != null)
    await viewerCtrl.ActivateWithFileAsync(file);

A full list of settings for ViewerControl can be found in the API documentation

AnnotationCommandBar

You also have the ability to access and configure the internal ViewerControl's Annotation Toolbar.

var viewerCtrl = new ViewerControl();

viewerCtrl.AnnotationToolbar.IsArrowToolButtonVisible = true;
viewerCtrl.AnnotationToolbar.IsCloudToolButtonVisible = true;
viewerCtrl.AnnotationToolbar.IsLassoToolButtonVisible = true;
viewerCtrl.AnnotationToolbar.IsMarqueeZoomToolButtonVisible = true;

StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Resources/GettingStarted.pdf"));
if (file != null)
    await ViewerControl.ActivateWithFileAsync(file);

A full list of settings for AnnotationCommandBar can be found in the API documentation

Get the answers you need: Chat with us