Bewerken

Share via


AnnotationHelper.CreateInkStickyNoteForSelection Method

Definition

Creates an ink sticky note annotation on the current selection of the viewer control associated with the specified AnnotationService.

public:
 static System::Windows::Annotations::Annotation ^ CreateInkStickyNoteForSelection(System::Windows::Annotations::AnnotationService ^ service, System::String ^ author);
public static System.Windows.Annotations.Annotation CreateInkStickyNoteForSelection (System.Windows.Annotations.AnnotationService service, string author);
static member CreateInkStickyNoteForSelection : System.Windows.Annotations.AnnotationService * string -> System.Windows.Annotations.Annotation
Public Shared Function CreateInkStickyNoteForSelection (service As AnnotationService, author As String) As Annotation

Parameters

service
AnnotationService

The annotation service to use to create the ink sticky note annotation.

author
String

The author of the annotation.

Returns

The ink sticky note annotation; or null, if there is no selected content to annotate.

Exceptions

service is null.

service is not enabled.

The viewer control contains no content selection.

Remarks

The ink sticky note annotation is anchored to the content defined by the current selection of the DocumentViewerBase, DocumentViewer, FlowDocumentPageViewer, FlowDocumentScrollViewer, or FlowDocumentReader control specified to the AnnotationService constructor.

If there is no user-selected content (the selection length is zero length), no annotation is created and an InvalidOperationException is thrown.

author can be specified as null in which case no author is defined.

The given annotation service must be enabled by means of a call to AnnotationService.Enable prior to calling CreateInkStickyNoteForSelection.

Applies to

See also