Show / Hide Table of Contents

Class ViewerControl

Inheritance
System.Object
Windows.UI.Xaml.DependencyObject
Windows.UI.Xaml.UIElement
Windows.UI.Xaml.FrameworkElement
Windows.UI.Xaml.Controls.Control
Windows.UI.Xaml.Controls.UserControl
ViewerControl
Implements
Windows.UI.Composition.IAnimationObject
Windows.UI.Composition.IVisualElement
IDisposable
Namespace: pdftron.PDF.Tools.Controls.Viewer
Assembly: pdftron.PDF.Tools.dll
Syntax
public sealed class ViewerControl : UserControl, IDependencyObject, IDependencyObject2, IUIElement, IUIElement2, IUIElement3, IUIElement4, IUIElement5, IUIElement7, IUIElement8, IUIElement9, IUIElement10, IUIElementOverrides, IUIElementOverrides7, IUIElementOverrides8, IUIElementOverrides9, IAnimationObject, IVisualElement, IFrameworkElement, IFrameworkElement2, IFrameworkElement3, IFrameworkElement4, IFrameworkElement6, IFrameworkElement7, IFrameworkElementProtected7, IFrameworkElementOverrides, IFrameworkElementOverrides2, IControl, IControl2, IControl3, IControl4, IControl5, IControl7, IControlProtected, IControlOverrides, IControlOverrides6, IUserControl, IDisposable

Constructors

ViewerControl()

Declaration
public ViewerControl()

Properties

AnnotationToolbar

Get the Annotation Toolbar used by all opened documents

Declaration
public AnnotationCommandBar AnnotationToolbar { get; }
Property Value
Type Description
AnnotationCommandBar

EnableTracking

Declaration
public bool EnableTracking { get; set; }
Property Value
Type Description
System.Boolean

HandleSystemBackButton

Whether or not the ViewerControl should handle the BackButton event from Windows.UI.Core.SystemNavigationManager.GetForCurrentView

Declaration
public bool HandleSystemBackButton { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Default state is False - back button expected to be handled externally by the application

HandleViewerBackButton

Whether or not the ViewerControl should handle the Viewer/Command bar BackButton event

Declaration
public bool HandleViewerBackButton { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Default state: True - expect to be handled internally by the ViewerControl

It needs the ShowBackButton to be set to true

InitializeOnCreation

Perform default initialization on ViewerControl creation

Declaration
public bool InitializeOnCreation { get; set; }
Property Value
Type Description
System.Boolean

IsAnyContentDialogOpened

Check whether any content dialog is currently opened in the ViewerControl

Declaration
public bool IsAnyContentDialogOpened { get; }
Property Value
Type Description
System.Boolean

IscurrentDocumentModified

Whether or not the current document has been modified since the last time it got saved

Declaration
public bool IscurrentDocumentModified { get; }
Property Value
Type Description
System.Boolean
Remarks

Return false if no tabs are opened or an internal error ocurred

IsCustomViewModel

Declaration
public static bool IsCustomViewModel { get; set; }
Property Value
Type Description
System.Boolean

IsDeactivationOnNavigationEnabled

Ensure to deactivate all opened tabs when navigating away from the page that hosts the ViewerControl

Declaration
public bool IsDeactivationOnNavigationEnabled { get; set; }
Property Value
Type Description
System.Boolean

IsExternalSaveEnabled

Enable or Disable the ViewerControl to allow the handling of Save and Save As to be external

Declaration
public bool IsExternalSaveEnabled { get; set; }
Property Value
Type Description
System.Boolean
Remarks

For external handling use the events SaveRequested and SaveAsRequested

IsForceGoBackAllowed

When enabled it will force the ViewerControl to navigate back to the previous Frame page listening to the SystemNavigationManager.GetForCurrentView().BackRequested event

Declaration
public bool IsForceGoBackAllowed { get; set; }
Property Value
Type Description
System.Boolean

IsOutlineEditingEnabled

Choose whether or not editing outlines is enabled

Declaration
public bool IsOutlineEditingEnabled { get; set; }
Property Value
Type Description
System.Boolean

IsRightToLeftVisible

Change the visibility of the Right To Left reading direction option

Declaration
public bool IsRightToLeftVisible { get; set; }
Property Value
Type Description
System.Boolean

IsSaveCopyEnabled

Declaration
public bool IsSaveCopyEnabled { get; set; }
Property Value
Type Description
System.Boolean

IsTabReorderEnabled

Choose whether or not Tab Reordering is enabled

Declaration
public bool IsTabReorderEnabled { get; set; }
Property Value
Type Description
System.Boolean

MaximumTabs

Declaration
public int MaximumTabs { get; set; }
Property Value
Type Description
System.Int32

ReadOnlyMode

Allows user to externally control whether the ViewerControl operates in View/Read only mode which won't allow the PDF documents to be edited (annotated).

Declaration
public bool ReadOnlyMode { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Note1: It is still possible to select and copy text to the clipboard.

Note2: There are still some compoenents that allow editing which need to be manually disabled.

SaveCopyMenuItems

Declaration
public static IList<IMenuItem> SaveCopyMenuItems { get; set; }
Property Value
Type Description
IList<IMenuItem>

ShowActionsOption

Allows user to externally control whether the Actions button is visible or collapsed

Declaration
public bool ShowActionsOption { get; set; }
Property Value
Type Description
System.Boolean

ShowAddTabButton

Allows user to externally control whether the Add tab button is visible or collapsed

Declaration
public bool ShowAddTabButton { get; set; }
Property Value
Type Description
System.Boolean

ShowBackButton

Allows user to navigate back from the ViewerControl

Declaration
public bool ShowBackButton { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Use HandleViewerBackButton to select whether or not ViewerControl will handle it internally

ShowCloseTabButton

Declaration
public bool ShowCloseTabButton { get; set; }
Property Value
Type Description
System.Boolean

ShowCropView

Allows user to externally control whether the Crop View button is visible or collapsed

Declaration
public bool ShowCropView { get; set; }
Property Value
Type Description
System.Boolean

ShowEditOption

Declaration
public bool ShowEditOption { get; set; }
Property Value
Type Description
System.Boolean

ShowExport

Allows user to externally control whether the Export option in the secondary menu is visible or collapsed

Declaration
public bool ShowExport { get; set; }
Property Value
Type Description
System.Boolean

ShowExportXFDF

Allows user to externally control whether the Export XFDF button is visible or collapsed

Declaration
public bool ShowExportXFDF { get; set; }
Property Value
Type Description
System.Boolean

ShowMultiWindow

Allows user to externally control whether the Multi Window button is visible or collapsed

Declaration
public bool ShowMultiWindow { get; set; }
Property Value
Type Description
System.Boolean

ShowOutlineOption

Allows user to externally control whether the Outline button is visible or collapsed

Declaration
public bool ShowOutlineOption { get; set; }
Property Value
Type Description
System.Boolean

ShowPDFCompare

Allows user to externally control whether the PDFCompare button is visible or collapsed

Declaration
public bool ShowPDFCompare { get; set; }
Property Value
Type Description
System.Boolean

ShowPrintOption

Allows user to externally control whether the Print document is visible or collapsed

Declaration
public bool ShowPrintOption { get; set; }
Property Value
Type Description
System.Boolean

ShowSaveAsOption

Allows user to externally control whether the Save As document button is visible or collapsed

Declaration
public bool ShowSaveAsOption { get; set; }
Property Value
Type Description
System.Boolean

ShowSaveOption

Allows user to externally control whether the Save document button is visible or collapsed

Declaration
public bool ShowSaveOption { get; set; }
Property Value
Type Description
System.Boolean

ShowSeeMoreOption

Allows user to externally control whether the SeeMore button is visible or collapsed

Declaration
public bool ShowSeeMoreOption { get; set; }
Property Value
Type Description
System.Boolean

ShowShareOption

Allows user to externally control whether the Share document is visible or collapsed

Declaration
public bool ShowShareOption { get; set; }
Property Value
Type Description
System.Boolean

ShowSidePanelAnnotations

Allows user to externally control whether the Side Panel Annotations is visible or collapsed

Declaration
public bool ShowSidePanelAnnotations { get; set; }
Property Value
Type Description
System.Boolean

ShowSidePanelBookmarks

Allows user to externally control whether the Side Panel Bookmarks is visible or collapsed

Declaration
public bool ShowSidePanelBookmarks { get; set; }
Property Value
Type Description
System.Boolean

ShowSidePanelOutline

Allows user to externally control whether the Side Panel Outline is visible or collapsed

Declaration
public bool ShowSidePanelOutline { get; set; }
Property Value
Type Description
System.Boolean

ShowSidePanelThumbnails

Allows user to externally control whether the Side Panel Thumbnails is visible or collapsed

Declaration
public bool ShowSidePanelThumbnails { get; set; }
Property Value
Type Description
System.Boolean

ShowTabFileInfo

Enable or Disable the file path popup when right clicking on a tab

Declaration
public bool ShowTabFileInfo { get; set; }
Property Value
Type Description
System.Boolean

ShowTextSearchOption

Allows user to externally control whether the Text Search button is visible or collapsed

Declaration
public bool ShowTextSearchOption { get; set; }
Property Value
Type Description
System.Boolean

ShowThumbnailView

Allows user to externally control whether the Thumbnail button is visible or collapsed

Declaration
public bool ShowThumbnailView { get; set; }
Property Value
Type Description
System.Boolean

ShowViewModeOption

Allows user to externally control whether the ViewMode button is visible or collapsed

Declaration
public bool ShowViewModeOption { get; set; }
Property Value
Type Description
System.Boolean

ThumbnailViewer

Get the Thumbnail Viewer used to display all document pages and perform insert, merging, delete, and duplicate of PDF pages.

Declaration
public ThumbnailViewer ThumbnailViewer { get; }
Property Value
Type Description
ThumbnailViewer

ViewModel

Declaration
public ViewerViewModel ViewModel { get; set; }
Property Value
Type Description
ViewerViewModel

Methods

ActivateWithFileAsync(StorageFile, NewDocumentProperties)

Activate the ViewerControl with a file

Declaration
public Task ActivateWithFileAsync(StorageFile file, NewDocumentProperties properties = null)
Parameters
Type Name Description
Windows.Storage.StorageFile file

StorageFile

NewDocumentProperties properties

Optional properties

Returns
Type Description
Task
Remarks

Supported file types: .pdf, .doc, .docx, .ppt, .pptx, .xls, .xlsx, .oxps, .xps, .jpeg, .jpg, .png, .bmp, .cbz

Note: Ensure to make this call using proper await to avoid the risk of deadlock

CancelAnyOpenedContentDialog()

Performs the closing of any opened content dialog in the ViewerControl

Declaration
public void CancelAnyOpenedContentDialog()

Dispose()

Declaration
public void Dispose()

FindText_ContentIsAvailable(EntranceAnimationContentControlEx)

Declaration
public void FindText_ContentIsAvailable(EntranceAnimationContentControlEx control)
Parameters
Type Name Description
EntranceAnimationContentControlEx control

Highlight_Text(FrameworkElement, DataContextChangedEventArgs)

Waits until the data context containing the appropriate full search item is ready and then positions the highlight rectangle according to the information

Declaration
public void Highlight_Text(FrameworkElement sender, DataContextChangedEventArgs args)
Parameters
Type Name Description
Windows.UI.Xaml.FrameworkElement sender
Windows.UI.Xaml.DataContextChangedEventArgs args

Refresh(ViewerViewModel)

Declaration
public void Refresh(ViewerViewModel viewModel)
Parameters
Type Name Description
ViewerViewModel viewModel

SearchFlyout_OnOpened(Object, Object)

Declaration
public void SearchFlyout_OnOpened(object sender, object e)
Parameters
Type Name Description
System.Object sender
System.Object e

Events

DocumentCreationFailed

Raised when a document creation attempt fails

Declaration
public event CreateDocControlViewModel.DocumentCreationFailedDelegate DocumentCreationFailed
Event Type
Type Description
CreateDocControlViewModel.DocumentCreationFailedDelegate

DocumentModified

Raised when a document has been modified

Declaration
public event ViewerControl.DocumentModifiedHandler DocumentModified
Event Type
Type Description
ViewerControl.DocumentModifiedHandler
Remarks

Types of modification: Annotation added, removed, or edited

GoBackRequested

Declaration
public event ViewerViewModel.GoBackRequestedHandler GoBackRequested
Event Type
Type Description
ViewerViewModel.GoBackRequestedHandler

ImageLoaded

Raised when an image has been loaded in the document creation dialog

Declaration
public event CreateDocControlViewModel.ImageLoadedDelegate ImageLoaded
Event Type
Type Description
CreateDocControlViewModel.ImageLoadedDelegate

ImageLoadingFailed

Raised when an image failed to during loading in the document creation dialog

Declaration
public event CreateDocControlViewModel.ImageLoadingFailedDelegate ImageLoadingFailed
Event Type
Type Description
CreateDocControlViewModel.ImageLoadingFailedDelegate

NewDocumentCreated

Raised when a document is successfully created

Declaration
public event CreateDocControlViewModel.NewDocumentCreatedDelegate NewDocumentCreated
Event Type
Type Description
CreateDocControlViewModel.NewDocumentCreatedDelegate

SaveAsRequested

Declaration
public event ViewerViewModel.SaveAsRequestedHandler SaveAsRequested
Event Type
Type Description
ViewerViewModel.SaveAsRequestedHandler

SaveRequested

Raised when the save document action has been requested

Declaration
public event ViewerViewModel.SaveRequestedHandler SaveRequested
Event Type
Type Description
ViewerViewModel.SaveRequestedHandler

ShowToolContextMenu

Declaration
public event ToolManager.ShowingContextMenuHandler ShowToolContextMenu
Event Type
Type Description
ToolManager.ShowingContextMenuHandler

ShowToolPopupMenu

Declaration
public event ToolManager.ShowingPopupMenuHandler ShowToolPopupMenu
Event Type
Type Description
ToolManager.ShowingPopupMenuHandler

Implements

Windows.UI.Composition.IAnimationObject
Windows.UI.Composition.IVisualElement
IDisposable

Extension Methods

DependencyObjectExtensions.FindControls<T>(DependencyObject)
DependencyObjectExtensions.FindVisualChild<T>(DependencyObject)
DependencyObjectExtensions.FindControl<T>(UIElement, String)
In This Article
Back to top Generated by DocFX