AnnotationService.GetService Method

Definition

Returns the AnnotationService associated with a specified document viewing control.

Overloads

GetService(FlowDocumentReader)

Returns the AnnotationService associated with a specified FlowDocumentReader.

GetService(FlowDocumentScrollViewer)

Returns the AnnotationService associated with a specified FlowDocumentScrollViewer.

GetService(DocumentViewerBase)

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

Remarks

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.

GetService(FlowDocumentReader)

Returns the AnnotationService associated with a specified FlowDocumentReader.

public static System.Windows.Annotations.AnnotationService GetService (System.Windows.Controls.FlowDocumentReader reader);

Parameters

reader
FlowDocumentReader

The document reader control to return the AnnotationService instance for.

Returns

The AnnotationService associated with the given document reader control; or null if the specified document reader has no AnnotationService.

Exceptions

reader is null.

Remarks

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.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

GetService(FlowDocumentScrollViewer)

Returns the AnnotationService associated with a specified FlowDocumentScrollViewer.

public static System.Windows.Annotations.AnnotationService GetService (System.Windows.Controls.FlowDocumentScrollViewer viewer);

Parameters

viewer
FlowDocumentScrollViewer

The document viewer control to return the AnnotationService instance for.

Returns

The AnnotationService associated with the given document viewer control; or null if the specified viewer control has no AnnotationService.

Exceptions

viewer is null.

Remarks

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.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

GetService(DocumentViewerBase)

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

public static System.Windows.Annotations.AnnotationService GetService (System.Windows.Controls.Primitives.DocumentViewerBase viewer);

Parameters

viewer
DocumentViewerBase

The document viewing control to return the AnnotationService instance for.

Returns

The AnnotationService associated with the given document viewing control; or null if the specified document viewing control has no AnnotationService.

Exceptions

viewer is null.

Remarks

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.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9