LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.31
AfterObjectChanged Event
See Also 
Leadtools.Windows.Annotations Namespace > AnnAutomation Class : AfterObjectChanged Event



The AfterObjectChanged Event supports WPF/Silverlight.

The AfterObjectChanged Event is available in LEADTOOLS Document and Medical Imaging toolkits.

Occurs after an AnnObject has been changed. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
Public Event AfterObjectChanged As EventHandler(Of AnnAfterObjectChangedEventArgs)
Visual Basic (Usage)Copy Code
Dim instance As AnnAutomation
Dim handler As EventHandler(Of AnnAfterObjectChangedEventArgs)
 
AddHandler instance.AfterObjectChanged, handler
C# 
public event EventHandler<AnnAfterObjectChangedEventArgs> AfterObjectChanged
C++/CLI 
public:
event EventHandler<AnnAfterObjectChangedEventArgs^>^ AfterObjectChanged

Event Data

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

PropertyDescription
ChangeType Gets the type of change. Supported in Silverlight, Windows Phone 7
Designer Gets the designer responsible for the change. Supported in Silverlight, Windows Phone 7
Objects Gets the objects that have been changed. Supported in Silverlight, Windows Phone 7

Example

This example will subscribe to the AnnAutomation.AfterObjectChanged event of all automations and print out a message every time an object changes.

Visual BasicCopy Code
Private Sub AnnAutomation_AfterObjectChanged(ByVal manager As AnnAutomationManager)
   ' subscribe to the AfterObjectChanged event of all automations
   For Each automation As AnnAutomation In manager.Automations
      AddHandler automation.AfterObjectChanged, AddressOf automation_AfterObjectChanged
   Next automation
End Sub
Private Sub automation_AfterObjectChanged(ByVal sender As Object, ByVal e As AnnAfterObjectChangedEventArgs)
   ' print out a message
   Dim message As String

   If Not e.Objects Is Nothing AndAlso e.Objects.Count < 0 Then
      message = String.Format("Objects Count: {0}, First object: {1}, Changed: {2}", e.Objects.Count, e.Objects(0).GetType().Name, e.ChangeType)
   Else
      message = String.Format("Changed: {0}", e.ChangeType)
   End If

   MessageBox.Show(message)
End Sub
C#Copy Code
private void AnnAutomation_AfterObjectChanged(AnnAutomationManager manager)
{
   // subscribe to the AfterObjectChanged event of all automations
   foreach(AnnAutomation automation in manager.Automations)
      automation.AfterObjectChanged += new EventHandler<AnnAfterObjectChangedEventArgs>(automation_AfterObjectChanged);
}
private void automation_AfterObjectChanged(object sender, AnnAfterObjectChangedEventArgs e)
{
   // print out a message
   string message;

   if(e.Objects != null && e.Objects.Count < 0)
      message = string.Format("Objects Count: {0}, First object: {1}, Changed: {2}", e.Objects.Count, e.Objects[0].GetType().Name, e.ChangeType);
   else
      message = String.Format("Changed: {0}", e.ChangeType);

   MessageBox.Show(message);
}
SilverlightCSharpCopy Code
private void AnnAutomation_AfterObjectChanged(AnnAutomationManager manager)
{
   // subscribe to the AfterObjectChanged event of all automations
   foreach(AnnAutomation automation in manager.Automations)
      automation.AfterObjectChanged += new EventHandler<AnnAfterObjectChangedEventArgs>(automation_AfterObjectChanged);
}
private void automation_AfterObjectChanged(object sender, AnnAfterObjectChangedEventArgs e)
{
   // print out a message
   string message;

   if(e.Objects != null && e.Objects.Count < 0)
      message = string.Format("Objects Count: {0}, First object: {1}, Changed: {2}", e.Objects.Count, e.Objects[0].GetType().Name, e.ChangeType);
   else
      message = String.Format("Changed: {0}", e.ChangeType);

   MessageBox.Show(message);
}
SilverlightVBCopy Code
Private Sub AnnAutomation_AfterObjectChanged(ByVal manager As AnnAutomationManager)
   ' subscribe to the AfterObjectChanged event of all automations
   For Each automation As AnnAutomation In manager.Automations
      AddHandler automation.AfterObjectChanged, AddressOf automation_AfterObjectChanged
   Next automation
End Sub
Private Sub automation_AfterObjectChanged(ByVal sender As Object, ByVal e As AnnAfterObjectChangedEventArgs)
   ' print out a message
   Dim message As String

   If Not e.Objects Is Nothing AndAlso e.Objects.Count < 0 Then
      message = String.Format("Objects Count: {0}, First object: {1}, Changed: {2}", e.Objects.Count, e.Objects(0).GetType().Name, e.ChangeType)
   Else
      message = String.Format("Changed: {0}", e.ChangeType)
   End If

   MessageBox.Show(message)
End Sub

Remarks

This event will be fired after an AnnObject has been modified by this AnnAutomation.

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

AfterObjectChanged requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.