The BeforeObjectChanged Event supports WPF/Silverlight.
The BeforeObjectChanged Event is available in LEADTOOLS Document and Medical Imaging toolkits.
Occurs before an AnnObject is about to be changed. Supported in Silverlight, Windows Phone 7Visual Basic (Declaration) | |
---|---|
Public Event BeforeObjectChanged As EventHandler(Of AnnBeforeObjectChangedEventArgs) |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As AnnAutomation Dim handler As EventHandler(Of AnnBeforeObjectChangedEventArgs) AddHandler instance.BeforeObjectChanged, handler |
C# | |
---|---|
public event EventHandler<AnnBeforeObjectChangedEventArgs> BeforeObjectChanged |
C++/CLI | |
---|---|
public: event EventHandler<AnnBeforeObjectChangedEventArgs^>^ BeforeObjectChanged |
The event handler receives an argument of type AnnBeforeObjectChangedEventArgs containing data related to this event. The following AnnBeforeObjectChangedEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel | Gets or sets a value indicating whether the change should be canceled. Supported in Silverlight, Windows Phone 7 |
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 |
This example will prevent changing the stroke of all annotation objects.
Visual Basic | Copy Code |
---|---|
Private Sub AnnAutomation_BeforeObjectChanged(ByVal manager As AnnAutomationManager) ' subscribe to the BeforeObjectChanged of all automations For Each automation As AnnAutomation In manager.Automations AddHandler automation.BeforeObjectChanged, AddressOf automation_BeforeObjectChanged Next automation End Sub Private Sub automation_BeforeObjectChanged(ByVal sender As Object, ByVal e As AnnBeforeObjectChangedEventArgs) ' prevent changing the stroke If e.ChangeType = AnnObjectChangedType.Stroke Then e.Cancel = True End If End Sub |
C# | Copy Code |
---|---|
private void AnnAutomation_BeforeObjectChanged(AnnAutomationManager manager) { // subscribe to the BeforeObjectChanged of all automations foreach(AnnAutomation automation in manager.Automations) automation.BeforeObjectChanged += new EventHandler<AnnBeforeObjectChangedEventArgs>(automation_BeforeObjectChanged); } private void automation_BeforeObjectChanged(object sender, AnnBeforeObjectChangedEventArgs e) { // prevent changing the stroke if(e.ChangeType == AnnObjectChangedType.Stroke) e.Cancel = true; } |
SilverlightCSharp | Copy Code |
---|---|
private void AnnAutomation_BeforeObjectChanged(AnnAutomationManager manager) { // subscribe to the BeforeObjectChanged of all automations foreach(AnnAutomation automation in manager.Automations) automation.BeforeObjectChanged += new EventHandler<AnnBeforeObjectChangedEventArgs>(automation_BeforeObjectChanged); } private void automation_BeforeObjectChanged(object sender, AnnBeforeObjectChangedEventArgs e) { // prevent changing the stroke if(e.ChangeType == AnnObjectChangedType.Stroke) e.Cancel = true; } |
SilverlightVB | Copy Code |
---|---|
Private Sub AnnAutomation_BeforeObjectChanged(ByVal manager As AnnAutomationManager) ' subscribe to the BeforeObjectChanged of all automations For Each automation As AnnAutomation In manager.Automations AddHandler automation.BeforeObjectChanged, AddressOf automation_BeforeObjectChanged Next automation End Sub Private Sub automation_BeforeObjectChanged(ByVal sender As Object, ByVal e As AnnBeforeObjectChangedEventArgs) ' prevent changing the stroke If e.ChangeType = AnnObjectChangedType.Stroke Then e.Cancel = True End If End Sub |
This event will be fired before an AnnObject is about to be modified by this AnnAutomation.
Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)