AnnotationStore.DeleteAnnotation(Guid) 메서드

정의

지정된 Id가 있는 주석을 저장소에서 삭제합니다.

public:
 abstract System::Windows::Annotations::Annotation ^ DeleteAnnotation(Guid annotationId);
public abstract System.Windows.Annotations.Annotation DeleteAnnotation (Guid annotationId);
abstract member DeleteAnnotation : Guid -> System.Windows.Annotations.Annotation
Public MustOverride Function DeleteAnnotation (annotationId As Guid) As Annotation

매개 변수

annotationId
Guid

삭제할 주석의 GUID Id 속성입니다.

반환

Annotation

삭제된 주석이거나, 지정된 annotationId가 있는 주석이 저장소에 없는 경우 null입니다.

예외

Dispose가 저장소에서 호출되었습니다.

예제

다음 예제에서는 사용 된 DeleteAnnotationFlush 메서드.

// ------------------------- DeleteMark_Click -------------------------
void DeleteMark_Click(object sender, RoutedEventArgs e)
{
    Annotation ann = ((MenuItem)sender).Tag as Annotation;
    _annStore.DeleteAnnotation(ann.Id);
    _annStore.Flush();

    MenuItem thisMenu = sender as MenuItem;
    ContextMenu parentMenu = thisMenu.Parent as ContextMenu;
    FrameworkElement dObj =
        parentMenu.PlacementTarget as FrameworkElement;
    while (!(dObj is StackPanel))
    {
        dObj = dObj.Parent as FrameworkElement;
    }

    ListBox collection = dObj.Parent as ListBox;
    collection.Items.Remove(dObj);
    Util.FlushDispatcher();
}

적용 대상

추가 정보