Events in WPF Diagram (SfDiagram)
4 Sep 2020 / 1 minute to read
The AnnotationChanged event will notify the annotation related actions and value changes. The AnnotationChangedEventArgs
class is used to get or set the entire annotation related properties and their values.
//Register the AnnotationChanged event
(diagram.Info as IGraphInfo).AnnotationChanged += Diagram_AnnotationChanged;
//Method to show message box when annotation is changed
private void Diagram_AnnotationChanged(object sender, ChangeEventArgs<object, AnnotationChangedEventArgs> args)
{
//When annotation is resized
if (args.NewValue.AnnotationInteractionState == AnnotationInteractionState.Resized)
{
MessageBox.Show("Annotation has been resized!");
}
//When annotation is resized
if (args.NewValue.AnnotationInteractionState == AnnotationInteractionState.Rotated)
{
MessageBox.Show("Annotation has been rotated!");
}
//When annotation is resized
if (args.NewValue.AnnotationInteractionState == AnnotationInteractionState.Edited)
{
MessageBox.Show("Annotation has been edited!");
}
}
See Also
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page