The comments pane might be a list box that displays the text from a list of annotations that are anchored to a document. For example, consider a simple document reader application that has a comments pane. You can match annotations with the corresponding annotated objects. Matching Annotations with Annotated Objects When the document view changes (scrolls, resizes, scales, or otherwise moves), the highlight annotation moves with the original data selection. For example, the following graphic illustrates an annotation that the user has made on a text selection. Therefore, if the document view changes, such as when the user scrolls or resizes the display window, the annotation stays with the data selection to which it is bound. The Annotations Framework binds annotations to the data that the user selects, not just to a position on the display view. The following example shows the Extensible Application Markup Language (XAML) you can use to declare a ContextMenu with routed commands that users can access to create and manage annotations. Users typically create annotations by first selecting some text or an item of interest, and then right-clicking to display a ContextMenu of annotation options. The following illustration shows an example of a highlight annotation. Highlight annotations in Microsoft Annotations Framework provide a similar feature for marking up information displayed in WPF document viewing controls. People use creative methods to draw attention to items of interest when they mark up a paper document, such as underlining, highlighting, circling words in a sentence, or drawing marks or notations in the margin. ' Enable the AnnotationService using the new store. _annotStore = New XmlStreamStore(_annotStream) ' Create an AnnotationStore using the file stream. _annotStream = New FileStream(_annotStorePath, FileMode.OpenOrCreate, FileAccess.ReadWrite) ' Open a stream to the file for storing annotations. ' If the AnnotationService is currently enabled, disable it. _annotService = New AnnotationService(docViewer) ' docViewer is a document viewing control named in Window1.xaml. ' If there is no AnnotationService yet, create one. ''' Enables annotations and displays all that are viewable. Enable the AnnotationService using the new store. _annotStore = new XmlStreamStore(_annotStream) Create an AnnotationStore using the file stream. _annotStorePath, FileMode.OpenOrCreate, FileAccess.ReadWrite) Open a stream to the file for storing annotations. If the AnnotationService is currently enabled, disable it. _annotService = new AnnotationService(docViewer) docViewer is a document viewing control named in Window1.xaml. If there is no AnnotationService yet, create one. / Enables annotations and displays all that are viewable. The following example shows the method that you can use to enable annotation support in your application. The following illustration shows some examples of highlight, text sticky note, and ink sticky note annotations. Digital sticky notes provide similar functionality for electronic documents, but with the added flexibility to include many other types of content such as typed text, handwritten notes (for example, Tablet PC "ink" strokes), or Web links. WPF document viewing controls that support annotations include FlowDocumentReader and FlowDocumentScrollViewer, as well as controls derived from DocumentViewerBase such as DocumentViewer and FlowDocumentPageViewer.Ī typical sticky note contains information written on a small piece of colored paper that is then "stuck" to a document. This topic reviews several common types of annotations, specifically sticky notes and highlights, and illustrates how the Microsoft Annotations Framework facilitates these types of annotations in applications through the Windows Presentation Foundation (WPF) document viewing controls. Although writing notes on printed documents is easy and commonplace, the ability to add personal comments to electronic documents is typically very limited, if available at all. These notes or comments are "annotations" that we add to a document to flag information or to highlight items of interest for later reference. Writing notes or comments on paper documents is such a commonplace activity that we almost take it for granted.
0 Comments
Leave a Reply. |