Leadtools.Windows.Annotations Requires Document/Medical license. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Container Property
See Also  Example
Leadtools.Windows.Annotations Namespace > AnnObjectBase Class : Container Property





Gets the AnnContainer that contains this AnnObjectBase. This is a dependency property.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Container As AnnContainer
Visual Basic (Usage)Copy Code
Dim instance As AnnObjectBase
Dim value As AnnContainer
 
value = instance.Container
C# 
public AnnContainer Container {get;}
C++/CLI 
public:
property AnnContainer^ Container {
   AnnContainer^ get();
}
XAML Syntax 
You cannot set this property in XAML.
XAML Syntax 
You cannot set this property in XAML.

Return Value

The AnnContainer that contains this AnnObjectBase.

Example

This example creates two containers, adds an object to the first container then moves it to the second while checking the Container property of the object.

Visual BasicCopy Code
Public Sub AnnObject_Container()
   ' create 2 containers
   Dim firstContainer As AnnContainer = New AnnContainer()
   firstContainer.Name = "FirstContainer"
   Dim secondContainer As AnnContainer = New AnnContainer()
   secondContainer.Name = "SecondContainer"
   ' add an object to the first container
   Dim line As AnnLineObject = New AnnLineObject()
   line.Header = "Line1"

   ' add the object to the first container
   firstContainer.Children.Add(line)
   Dim s As String = String.Format("Container: {0}", line.Container.Name)
   MessageBox.Show(s)

   ' move the object to the second container
   firstContainer.Children.Remove(line)
   secondContainer.Children.Add(line)
   s = String.Format("Container: {0}", line.Container.Name)
   MessageBox.Show(s)
End Sub
C#Copy Code
public void AnnObject_Container() 

   // create 2 containers 
   AnnContainer firstContainer = new AnnContainer(); 
   firstContainer.Name = "FirstContainer"; 
   AnnContainer secondContainer = new AnnContainer(); 
   secondContainer.Name = "SecondContainer"; 
   // add an object to the first container 
   AnnLineObject line = new AnnLineObject(); 
   line.Header = "Line1"; 
 
   // add the object to the first container 
   firstContainer.Children.Add(line); 
   string s = string.Format("Container: {0}", line.Container.Name); 
   MessageBox.Show(s); 
 
   // move the object to the second container 
   firstContainer.Children.Remove(line); 
   secondContainer.Children.Add(line); 
   s = string.Format("Container: {0}", line.Container.Name); 
   MessageBox.Show(s); 
}

Remarks

(Read Only) An AnnObjectBase can be part of one AnnContainer only at any given time.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also

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