Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Team Bloggers

Browse by Tags

All Tags » Windows Present... » Documents   (RSS)

  • Annotated FlowDocument Viewer with Comments Pane

    A new WPF 3.5 feature in the Annotations area is the capability to match annotations with the corresponding annotated objects. For example, you can now implement a document viewing application that has a comments pane, where the paragraph that contains the corresponding comment (a text sticky note in this case) is brought into view if you make a selection. A simplified version of such an application may look like this: The list box is bound to the list of annotations. In particular, it uses a converter (IValueConverter) to turn the content of each annotation (64-bit binary data) into text strings. The following is the implementation of the converter: public class AnnotationDataConverter : IValueConverter { public object Convert( object value, Type targetType, object parameter, CultureInfo culture) { // Convert 64 bit binary data into an 8 bit byte array and load // it into a memory buffer byte [] data = System. Convert .FromBase64String(value as string ); using ( MemoryStream buffer = new Read More...

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us