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
ShowObjectPropertiesDialog Method
See Also 
Leadtools.Windows.Annotations Namespace > AnnAutomation Class : ShowObjectPropertiesDialog Method



The ShowObjectPropertiesDialog Method supports WPF/Silverlight.

The ShowObjectPropertiesDialog Method is available in LEADTOOLS Document and Medical Imaging toolkits.

Opens the object's Properties dialog. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
Public Overridable Sub ShowObjectPropertiesDialog() 
Visual Basic (Usage)Copy Code
Dim instance As AnnAutomation
 
instance.ShowObjectPropertiesDialog()
C# 
public virtual void ShowObjectPropertiesDialog()
C++/CLI 
public:
virtual void ShowObjectPropertiesDialog(); 

Example

This example displays the annotation properties dialog

Visual BasicCopy Code
Private Sub AnnAutomation_ShowObjectPropertiesDialog(ByVal automation As AnnAutomation)
   ' first add a new object to the automation
   Dim rectObj As AnnRectangleObject = New AnnRectangleObject()
   rectObj.Rect = New Rect(100, 100, 100, 100)
   rectObj.Stroke = Colors.Blue
   rectObj.StrokeThickness = 2.0
   rectObj.Fill = Colors.Yellow
   automation.Container.Children.Add(rectObj)

   ' make sure no objects are selected in the automation
   automation.SelectNone()

   ' show the object properties dialog (this should show a message informing you that no objects are currently selected (bring edited)
   ShowProperties(automation)

   ' select (edit) the object we have just added
   automation.StartEditing(rectObj, False)

   ' show the object properties dialog (should show the object properties dialog)
   ShowProperties(automation)
End Sub

Private Sub ShowProperties(ByVal automation As AnnAutomation)
   ' check if we can show the dialog
   If automation.CanShowObjectPropertiesDialog Then
      automation.ShowObjectPropertiesDialog()
   Else
      MessageBox.Show("Cannot show the object properties dialog because no object is currently being edited (selected)")
   End If
End Sub
C#Copy Code
private void AnnAutomation_ShowObjectPropertiesDialog(AnnAutomation automation)
{
   // first add a new object to the automation
   AnnRectangleObject rectObj = new AnnRectangleObject();
   rectObj.Rect = new Rect(100, 100, 100, 100);
   rectObj.Stroke = Colors.Blue;
   rectObj.Fill = Colors.Yellow;
   rectObj.StrokeThickness = 2.0;
   automation.Container.Children.Add(rectObj);

   // make sure no objects are selected in the automation
   automation.SelectNone();

   // show the object properties dialog (this should show a message informing you that no objects are currently selected (bring edited)
   ShowProperties(automation);

   // select (edit) the object we have just added
   automation.StartEditing(rectObj, false);

   // show the object properties dialog (should show the object properties dialog)
   ShowProperties(automation);
}

private void ShowProperties(AnnAutomation automation)
{
   // check if we can show the dialog
   if(automation.CanShowObjectPropertiesDialog)
      automation.ShowObjectPropertiesDialog();
   else
      MessageBox.Show("Cannot show the object properties dialog because no object is currently being edited (selected)");
}
SilverlightCSharpCopy Code
private void AnnAutomation_ShowObjectPropertiesDialog(AnnAutomation automation)
{
   // first add a new object to the automation
   AnnRectangleObject rectObj = new AnnRectangleObject();
   rectObj.Rect = new Rect(100, 100, 100, 100);
   rectObj.Stroke = Colors.Blue;
   rectObj.Fill = Colors.Yellow;
   rectObj.StrokeThickness = 2.0;
   automation.Container.Children.Add(rectObj);

   // make sure no objects are selected in the automation
   automation.SelectNone();

   // show the object properties dialog (this should show a message informing you that no objects are currently selected (bring edited)
   ShowProperties(automation);

   // select (edit) the object we have just added
   automation.StartEditing(rectObj, false);

   // show the object properties dialog (should show the object properties dialog)
   ShowProperties(automation);
}

private void ShowProperties(AnnAutomation automation)
{
   // check if we can show the dialog
   if(automation.CanShowObjectPropertiesDialog)
      automation.ShowObjectPropertiesDialog();
   else
      MessageBox.Show("Cannot show the object properties dialog because no object is currently being edited (selected)");
}
SilverlightVBCopy Code
Private Sub AnnAutomation_ShowObjectPropertiesDialog(ByVal automation As AnnAutomation)
   ' first add a new object to the automation
   Dim rectObj As AnnRectangleObject = New AnnRectangleObject()
   rectObj.Rect = New Rect(100, 100, 100, 100)
   rectObj.Stroke = Colors.Blue
   rectObj.Fill = Colors.Yellow
   rectObj.StrokeThickness = 2.0
   automation.Container.Children.Add(rectObj)

   ' make sure no objects are selected in the automation
   automation.SelectNone()

   ' show the object properties dialog (this should show a message informing you that no objects are currently selected (bring edited)
   ShowProperties(automation)

   ' select (edit) the object we have just added
   automation.StartEditing(rectObj, False)

   ' show the object properties dialog (should show the object properties dialog)
   ShowProperties(automation)
End Sub

Private Sub ShowProperties(ByVal automation As AnnAutomation)
   ' check if we can show the dialog
   If automation.CanShowObjectPropertiesDialog Then
      automation.ShowObjectPropertiesDialog()
   Else
      MessageBox.Show("Cannot show the object properties dialog because no object is currently being edited (selected)")
   End If
End Sub

Remarks

Call the CanShowObjectPropertiesDialog property to determine whether the object's Properties dialog can be displayed at this time. The dialog used is AnnAutomationManager.ObjectPropertiesDialogType. If the value of AnnAutomationManager.ObjectPropertiesDialogType is null (Nothing in Visual Basic), this method will not do anything.

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

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