AnnotationService.Disable Method ()

 

Disables annotations processing and hides all visible annotations.

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

public void Disable()

When Disable is called all annotations become hidden.

The following example shows how to use the Disable method when you stop the AnnotationService.

// ------------------------ StopAnnotations ---------------------------
/// <summary>
///   Disables annotation processing and hides all annotations.</summary>
private void StopAnnotations()
{
    // If the AnnotationStore is active, flush and close it.
    if (_annotStore != null)
    {
        _annotStore.Flush();
        _annotStream.Flush();
        _annotStream.Close();
        _annotStore = null;
    }

    // If the AnnotationService is active, shut it down.
    if (_annotService != null)
    {
        if (_annotService.IsEnabled)
        {
            _annotService.Disable();  // Disable the AnnotationService.
            _annotService = null;
        }
    }
}// end:StopAnnotations()

.NET Framework
Available since 3.0
Return to top
Show: