AnnotationStore.AddAnnotation Method (Annotation)


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

Adds a new Annotation to the store.

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

public abstract void AddAnnotation(
	Annotation newAnnotation


Type: System.Windows.Annotations.Annotation

The annotation to add to the store.

Exception Condition

newAnnotation is null.


An Annotation with the same Id property value already exists in the store.


Dispose has been called on the store.

When a new Annotation is added to the store its globally unique identifier (GUID) Id property is set to a new value. When AddAnnotation is called, its Id property is checked to see if the Annotation already has been added to the store. If the Annotation already has been added and exists in the store (as determined by its Id property) an ArgumentException error is thrown.

.NET Framework
Available since 3.0
Return to top