Example





In This Topic
GdPicture14.WPF Namespace / GdViewer Class / AnnotationSelected Event

AnnotationSelected Event (GdViewer)

In This Topic
This event is raised when a GdPicture/XMP annotation has been selected or deselected.

The event makes use of bubble routing strategy. Please check the corresponded GdViewer.AnnotationSelectedEventArgs for given parameters.

Syntax
'Declaration
 
Public Event AnnotationSelected As GdViewer.AnnotationSelectedHandler
public event GdViewer.AnnotationSelectedHandler AnnotationSelected
public event AnnotationSelected: GdViewer.AnnotationSelectedHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.AnnotationSelectedHandler* AnnotationSelected
public:
event GdViewer.AnnotationSelectedHandler^ AnnotationSelected
Event Data

The event handler receives an argument of type GdViewer.AnnotationSelectedEventArgs containing data related to this event. The following GdViewer.AnnotationSelectedEventArgs properties provide information specific to this event.

PropertyDescription
The 0-based index of the selected annotation within the current page of the displayed document. It is a value from 0 to GetAnnotationCount-1.  
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
Remarks
Be aware, that this event only handles GdPicture/XMP annotations.
Example
How to utilize this event in your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated
'and the AnnotationSelected event has been properly added.
            
'Define the event.
Sub GdViewer1_AnnotationSelected(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.AnnotationSelectedEventArgs)
    Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(e.AnnotationIdx)
    If annot.Selected Then
        MessageBox.Show("The annotation with the index " + e.AnnotationIdx.ToString() + " has been selected.", "GdViewer.AnnotationSelected")
    Else
        MessageBox.Show("The annotation with the index " + e.AnnotationIdx.ToString() + " has been deselected.", "GdViewer.AnnotationSelected")
    End If
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and the AnnotationSelected event has been properly added.
            
//Define the event.
void GdViewer1_AnnotationSelected(object sender, GdPicture14.WPF.GdViewer.AnnotationSelectedEventArgs e)
{
    GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(e.AnnotationIdx);
    if (annot.Selected)
        MessageBox.Show("The annotation with the index " + e.AnnotationIdx.ToString() + " has been selected.", "GdViewer.AnnotationSelected");
    else
        MessageBox.Show("The annotation with the index " + e.AnnotationIdx.ToString() + " has been deselected.", "GdViewer.AnnotationSelected");
}
See Also