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



The CanBringToFront Property supports WPF/Silverlight.

The CanBringToFront Property is available in LEADTOOLS Document and Medical Imaging toolkits.

Gets a value that indicates whether this AnnAutomation can bring the currently selected object(s) up in the Z-order. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
Public Overridable ReadOnly Property CanBringToFront As Boolean
Visual Basic (Usage)Copy Code
Dim instance As AnnAutomation
Dim value As Boolean
 
value = instance.CanBringToFront
C# 
public virtual bool CanBringToFront {get;}
C++/CLI 
public:
virtual property bool CanBringToFront {
   bool get();
}

Property Value

true if this AnnAutomation can bring the currently selected object(s) up in the Z-order; otherwise, false.

Example

Visual BasicCopy Code
Private Sub AnnAutomation_CanBringToFront(ByVal automation As AnnAutomation)
   ' first make sure no objects are in this automation container
   automation.Container.Children.Clear()
   ' add three objects to the automation
   Dim brush() As Color = {Colors.Red, Colors.Green, Colors.Blue}
   Dim rectObj As AnnRectangleObject() = New AnnRectangleObject(2) {}
   Dim x As Integer = 100
   Dim y As Integer = 100
   For i As Integer = 0 To 2
      rectObj(i) = New AnnRectangleObject()
      rectObj(i).Rect = New Rect(x, y, 100, 100)
      rectObj(i).Stroke = Colors.Blue
      rectObj(i).StrokeThickness = 2.0

      rectObj(i).Fill = brush(i)
      rectObj(i).Header = String.Format("Rectangle {0}", i + 1)
      rectObj(i).IsHeaderVisible = True
      automation.Container.Children.Add(rectObj(i))

      x += 25
      y += 25
   Next i


   MessageBox.Show("Rectangle1 -> Rectangle2 -> Rectangle3.  Now will select Rectangle1 and move it up")

   ' select rectangle 1 then move it one up in the Z-order
   automation.StartEditing(rectObj(0), False)
   If automation.CanBringToFront Then
      automation.BringToFront(False)
   End If

   MessageBox.Show("Rectangle2 -> Rectangle1 -> Rectangle3.  Now will select Rectangle3 and move it down")

   ' select rectangle 3 then move it down in the Z-order
   automation.StartEditing(rectObj(2), False)
   If automation.CanSendToBack Then
      automation.SendToBack(False)
   End If

   MessageBox.Show("Rectangle2 -> Rectangle3 -> Rectangle1.  Now will select Rectangle2 and move to top")

   ' select rectangle 2 then move it to first of Z-order
   automation.StartEditing(rectObj(1), False)
   If automation.CanBringToFirst Then
      automation.BringToFront(True)
   End If

   MessageBox.Show("Rectangle3 -> Rectangle1 -> Rectangle2.  Now will select Rectangle2 and move to the bottom")

   ' select rectangle 2 then move it to bottom of Z-order
   automation.StartEditing(rectObj(1), False)
   If automation.CanSendToLast Then
      automation.SendToBack(True)
   End If
End Sub
C#Copy Code
private void AnnAutomation_CanBringToFront(AnnAutomation automation)
{
   // first make sure no objects are in this automation container
   automation.Container.Children.Clear();
   // add three objects to the automation
   Color[] brush = { Colors.Red, Colors.Green, Colors.Blue };
   AnnRectangleObject[] rectObj = new AnnRectangleObject[3];
   int x = 100;
   int y = 100;
   for(int i = 0; i < 3; i++)
   {
      rectObj[i] = new AnnRectangleObject();
      rectObj[i].Rect = new Rect(x, y, 100, 100);
      rectObj[i].Stroke = Colors.Blue;
      rectObj[i].Fill = brush[i];
      rectObj[i].StrokeThickness = 2.0;

      rectObj[i].Header = String.Format("Rectangle {0}", i + 1);
      rectObj[i].IsHeaderVisible = true;
      automation.Container.Children.Add(rectObj[i]);

      x += 25;
      y += 25;
   }

   MessageBox.Show("Rectangle1 -> Rectangle2 -> Rectangle3.  Now will select Rectangle1 and move it up");

   // select rectangle 1 then move it one up in the Z-order
   automation.StartEditing(rectObj[0], false);
   if(automation.CanBringToFront)
      automation.BringToFront(false);

   MessageBox.Show("Rectangle2 -> Rectangle1 -> Rectangle3.  Now will select Rectangle3 and move it down");

   // select rectangle 3 then move it down in the Z-order
   automation.StartEditing(rectObj[2], false);
   if(automation.CanSendToBack)
      automation.SendToBack(false);

   MessageBox.Show("Rectangle2 -> Rectangle3 -> Rectangle1.  Now will select Rectangle2 and move to top");

   // select rectangle 2 then move it to first of Z-order
   automation.StartEditing(rectObj[1], false);
   if(automation.CanBringToFirst)
      automation.BringToFront(true);

   MessageBox.Show("Rectangle3 -> Rectangle1 -> Rectangle2.  Now will select Rectangle2 and move to the bottom");

   // select rectangle 2 then move it to bottom of Z-order
   automation.StartEditing(rectObj[1], false);
   if(automation.CanSendToLast)
      automation.SendToBack(true);
}
SilverlightCSharpCopy Code
private void AnnAutomation_CanBringToFront(AnnAutomation automation)
{
   // first make sure no objects are in this automation container
   automation.Container.Children.Clear();
   // add three objects to the automation
   Color[] brush = { Colors.Red, Colors.Green, Colors.Blue };
   AnnRectangleObject[] rectObj = new AnnRectangleObject[3];
   int x = 100;
   int y = 100;
   for(int i = 0; i < 3; i++)
   {
      rectObj[i] = new AnnRectangleObject();
      rectObj[i].Rect = new Rect(x, y, 100, 100);
      rectObj[i].Stroke = Colors.Blue;
      rectObj[i].Fill = brush[i];
      rectObj[i].StrokeThickness = 2.0;

      rectObj[i].Header = String.Format("Rectangle {0}", i + 1);
      rectObj[i].IsHeaderVisible = true;
      automation.Container.Children.Add(rectObj[i]);

      x += 25;
      y += 25;
   }

   MessageBox.Show("Rectangle1 -> Rectangle2 -> Rectangle3.  Now will select Rectangle1 and move it up");

   // select rectangle 1 then move it one up in the Z-order
   automation.StartEditing(rectObj[0], false);
   if(automation.CanBringToFront)
      automation.BringToFront(false);

   MessageBox.Show("Rectangle2 -> Rectangle1 -> Rectangle3.  Now will select Rectangle3 and move it down");

   // select rectangle 3 then move it down in the Z-order
   automation.StartEditing(rectObj[2], false);
   if(automation.CanSendToBack)
      automation.SendToBack(false);

   MessageBox.Show("Rectangle2 -> Rectangle3 -> Rectangle1.  Now will select Rectangle2 and move to top");

   // select rectangle 2 then move it to first of Z-order
   automation.StartEditing(rectObj[1], false);
   if(automation.CanBringToFirst)
      automation.BringToFront(true);

   MessageBox.Show("Rectangle3 -> Rectangle1 -> Rectangle2.  Now will select Rectangle2 and move to the bottom");

   // select rectangle 2 then move it to bottom of Z-order
   automation.StartEditing(rectObj[1], false);
   if(automation.CanSendToLast)
      automation.SendToBack(true);
}
SilverlightVBCopy Code
Private Sub AnnAutomation_CanBringToFront(ByVal automation As AnnAutomation)
   ' first make sure no objects are in this automation container
   automation.Container.Children.Clear()
   ' add three objects to the automation
   Dim brush As Color() = { Colors.Red, Colors.Green, Colors.Blue }
   Dim rectObj As AnnRectangleObject() = New AnnRectangleObject(2){}
   Dim x As Integer = 100
   Dim y As Integer = 100
   For i As Integer = 0 To 2
      rectObj(i) = New AnnRectangleObject()
      rectObj(i).Rect = New Rect(x, y, 100, 100)
      rectObj(i).Stroke = Colors.Blue
      rectObj(i).Fill = brush(i)
      rectObj(i).StrokeThickness = 2.0

      rectObj(i).Header = String.Format("Rectangle {0}", i + 1)
      rectObj(i).IsHeaderVisible = True
      automation.Container.Children.Add(rectObj(i))

      x += 25
      y += 25
   Next i

   MessageBox.Show("Rectangle1 -> Rectangle2 -> Rectangle3.  Now will select Rectangle1 and move it up")

   ' select rectangle 1 then move it one up in the Z-order
   automation.StartEditing(rectObj(0), False)
   If automation.CanBringToFront Then
      automation.BringToFront(False)
   End If

   MessageBox.Show("Rectangle2 -> Rectangle1 -> Rectangle3.  Now will select Rectangle3 and move it down")

   ' select rectangle 3 then move it down in the Z-order
   automation.StartEditing(rectObj(2), False)
   If automation.CanSendToBack Then
      automation.SendToBack(False)
   End If

   MessageBox.Show("Rectangle2 -> Rectangle3 -> Rectangle1.  Now will select Rectangle2 and move to top")

   ' select rectangle 2 then move it to first of Z-order
   automation.StartEditing(rectObj(1), False)
   If automation.CanBringToFirst Then
      automation.BringToFront(True)
   End If

   MessageBox.Show("Rectangle3 -> Rectangle1 -> Rectangle2.  Now will select Rectangle2 and move to the bottom")

   ' select rectangle 2 then move it to bottom of Z-order
   automation.StartEditing(rectObj(1), False)
   If automation.CanSendToLast Then
      automation.SendToBack(True)
   End If
End Sub

Remarks

(Read only) Call the AnnAutomation.BringToFront method to bring the object up in the Z-order.

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

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