AnnotationStore.DeleteAnnotation(Guid) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Elimina la anotación con el especificado Id en el almacén.
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
Parámetros
Devoluciones
Anotación que se eliminó; de lo contrario, null si no se encontró una anotación con el especificado annotationId en el almacén.
Excepciones
Dispose se ha llamado a en la tienda.
Ejemplos
En el ejemplo siguiente se muestra el uso de los DeleteAnnotation métodos y Flush .
// ------------------------- 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();
}