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





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

Syntax

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

Return Value

The AnnGroupObject that contains this AnnObjectBase.

Example

This example creates a line, adds it to a group then adds the group to a container while checking the AnnObjectBase.Container and Group property of the object.

Visual BasicCopy Code
Public Sub AnnObject_Group()
   ' add an object to the first container
   Dim line As AnnLineObject = New AnnLineObject()
   line.Header = "Line1"
   ShowGroupAndContainer(line)

   ' add it to a group
   Dim group As AnnGroupObject = New AnnGroupObject()
   group.Name = "Group1"
   group.Children.Add(line)

   ShowGroupAndContainer(line)

   ' add the group to a container
   Dim container As AnnContainer = New AnnContainer()
   container.Name = "Container1"
   container.Children.Add(group)

   ShowGroupAndContainer(line)
End Sub

Private Sub ShowGroupAndContainer(ByVal obj As AnnObjectBase)
   Console.Write("Container: ")
   If Not obj.Container Is Nothing Then
      Console.Write(obj.Container.Name)
   Else
      Console.Write("none")
   End If

   Console.Write(", Group: ")
   If Not obj.Group Is Nothing Then
      Console.Write(obj.Group.Name)
   Else
      Console.Write("none")
   End If

   Console.WriteLine()
End Sub
C#Copy Code
public void AnnObject_Group() 

   // add an object to the first container 
   AnnLineObject line = new AnnLineObject(); 
   line.Header = "Line1"; 
   ShowGroupAndContainer(line); 
 
   // add it to a group 
   AnnGroupObject group = new AnnGroupObject(); 
   group.Name = "Group1"; 
   group.Children.Add(line); 
 
   ShowGroupAndContainer(line); 
 
   // add the group to a container 
   AnnContainer container = new AnnContainer(); 
   container.Name = "Container1"; 
   container.Children.Add(group); 
 
   ShowGroupAndContainer(line); 

 
private void ShowGroupAndContainer(AnnObjectBase obj) 

   Console.Write("Container: "); 
   if(obj.Container != null) 
      Console.Write(obj.Container.Name); 
   else 
      Console.Write("none"); 
 
   Console.Write(", Group: "); 
   if(obj.Group != null) 
      Console.Write(obj.Group.Name); 
   else 
      Console.Write("none"); 
 
   Console.WriteLine(); 
}

Remarks

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

Requirements

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

See Also

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