Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetService Method (DocumentViewerBase)

AnnotationService.GetService Method (DocumentViewerBase)

Returns the AnnotationService instance associated with a specified document viewing control.

Namespace:  System.Windows.Annotations
Assembly:  PresentationFramework (in PresentationFramework.dll)

public static AnnotationService GetService(
	DocumentViewerBase viewer


Type: System.Windows.Controls.Primitives.DocumentViewerBase

The document viewing control to return the AnnotationService instance for.

Return Value

Type: System.Windows.Annotations.AnnotationService
The AnnotationService associated with the given document viewing control; or null if the specified document viewing control has no AnnotationService.


viewer is null.

The GetService method can be used to return the AnnotationService associated with the following document viewing controls:

The viewer control associated with the annotation service is specified in the parameter to the AnnotationService constructor.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft