AnnotationStore::StoreContentChanged Event


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Occurs when an Annotation is added to or deleted from the store.

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

event StoreContentChangedEventHandler^ StoreContentChanged {
	void add(StoreContentChangedEventHandler^ value);
	void remove(StoreContentChangedEventHandler^ value);

The following example shows how to add an event delegate for the StoreContentChanged event.

// Enable Annotations
_annotationBuffer = new MemoryStream();
_annStore = new XmlStreamStore(_annotationBuffer);
_annServ  = new AnnotationService(FDPV);
_annStore.StoreContentChanged +=
    new StoreContentChangedEventHandler(_annStore_StoreContentChanged);

The following example shows operation of the StoreContentChanged event delegate.

// ------------------ _annStore_StoreContentChanged -------------------
void _annStore_StoreContentChanged(object sender, StoreContentChangedEventArgs e)
    if (e.Action == StoreContentAction.Deleted) return;
    Annotation ann = e.Annotation;
    if (ann.Cargos.Count > 0)
        AnnotationResource annResource = ann.Cargos[0] as AnnotationResource;
        if (annResource.Name == "Highlight")
            AddBookmarkOrComment(BookmarkList, ann);
            AddBookmarkOrComment(CommentsList, ann);
        AddBookmarkOrComment(CommentsList, ann);

.NET Framework
Available since 3.0
Return to top