LEADTOOLS WPF and Silverlight (Leadtools.Windows.Controls assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
IsInteractiveModeBusy Property
See Also 
Leadtools.Windows.Controls Namespace > ImageViewer Class : IsInteractiveModeBusy Property



Determines if the control is currently performing an interactive operation. Supported in Silverlight, Windows Phone 7

Syntax

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

Property Value

true if the control is currently performing an interactive operation, false otherwise.

Example

This example sets the interactive mode to draw a rectangular region. If the mouse is dragged up or to the left, the interactive mode is cancelled.

Visual BasicCopy Code
Public Sub BitmapSourceViewer_IsInteractiveModeBusy(ByVal viewer As ImageViewer)
    AddHandler viewer.InteractiveUserRectangle, AddressOf viewer_InteractiveUserRectangle
    viewer.InteractiveMode = InteractiveMode.UserRectangle

    MessageBox.Show("Interactive mode set to draw a rectangular geometry." & Constants.vbLf & "If mouse is dragged up or to the left, interactive mode is cancelled")
End Sub

Private Sub viewer_InteractiveUserRectangle(ByVal sender As Object, ByVal e As RectangleInteractiveEventArgs)
    Console.WriteLine("" & e.Status)
    Dim viewer As ImageViewer = TryCast(sender, ImageViewer)

    Dim ee As RectangleInteractiveEventArgs = New RectangleInteractiveEventArgs(e.Status, e.Bounds)
    If e.Status = InteractiveModeStatus.End Then
        e.Cancel = True
        If (Not viewer.IsInteractiveModeBusy) Then
            MessageBox.Show("Interactive mode (Rectangular geometry) cancelled")
            viewer.InteractiveMode = InteractiveMode.None
        End If
    End If

    Console.WriteLine("" & e.Bounds.Left & ", " & e.Bounds.Top & ", " & e.Bounds.Right & ", " & e.Bounds.Bottom)
End Sub
C#Copy Code
public void BitmapSourceViewer_IsInteractiveModeBusy(ImageViewer viewer)
{
   viewer.InteractiveUserRectangle += new EventHandler<RectangleInteractiveEventArgs>(viewer_InteractiveUserRectangle);
   viewer.InteractiveMode = InteractiveMode.UserRectangle;

   MessageBox.Show("Interactive mode set to draw a rectangular geometry.\nIf mouse is dragged up or to the left, interactive mode is cancelled");
}

void viewer_InteractiveUserRectangle(object sender, RectangleInteractiveEventArgs e)
{
   Console.WriteLine(@"" + e.Status);
   ImageViewer viewer = sender as ImageViewer;

   RectangleInteractiveEventArgs ee = new RectangleInteractiveEventArgs(e.Status, e.Bounds);
   if (e.Status == InteractiveModeStatus.End)
   {
      e.Cancel = true;
      if (!viewer.IsInteractiveModeBusy)
      {
         MessageBox.Show("Interactive mode (Rectangular geometry) cancelled");
         viewer.InteractiveMode = InteractiveMode.None;
      }
   }

   Console.WriteLine(@"" + e.Bounds.Left + ", " + e.Bounds.Top + ", " + e.Bounds.Right + ", " + e.Bounds.Bottom);
}
SilverlightCSharpCopy Code
public void BitmapSourceViewer_IsInteractiveModeBusy(ImageViewer viewer)
{
   viewer.InteractiveUserRectangle += new EventHandler<RectangleInteractiveEventArgs>(viewer_InteractiveUserRectangle);
   viewer.InteractiveMode = InteractiveMode.UserRectangle;

   MessageBox.Show("Interactive mode set to draw a rectangular geometry.\nIf mouse is dragged up or to the left, interactive mode is cancelled");
}

void viewer_InteractiveUserRectangle(object sender, RectangleInteractiveEventArgs e)
{
   Console.WriteLine(@"" + e.Status);
   ImageViewer viewer = sender as ImageViewer;

   RectangleInteractiveEventArgs ee = new RectangleInteractiveEventArgs(e.Status, e.Bounds);
   if (e.Status == InteractiveModeStatus.End)
   {
      e.Cancel = true;
      if (!viewer.IsInteractiveModeBusy)
      {
         MessageBox.Show("Interactive mode (Rectangular geometry) cancelled");
         viewer.InteractiveMode = InteractiveMode.None;
      }
   }

   Console.WriteLine(@"" + e.Bounds.Left + ", " + e.Bounds.Top + ", " + e.Bounds.Right + ", " + e.Bounds.Bottom);
}
SilverlightVBCopy Code
Public Sub BitmapSourceViewer_IsInteractiveModeBusy(ByVal viewer As ImageViewer)
   AddHandler viewer.InteractiveUserRectangle, AddressOf viewer_InteractiveUserRectangle
   viewer.InteractiveMode = InteractiveMode.UserRectangle

   MessageBox.Show("Interactive mode set to draw a rectangular geometry." & Constants.vbLf & "If mouse is dragged up or to the left, interactive mode is cancelled")
End Sub

Private Sub viewer_InteractiveUserRectangle(ByVal sender As Object, ByVal e As RectangleInteractiveEventArgs)
   Console.WriteLine("" & e.Status)
   Dim viewer As ImageViewer = TryCast(sender, ImageViewer)

   Dim ee As RectangleInteractiveEventArgs = New RectangleInteractiveEventArgs(e.Status, e.Bounds)
   If e.Status = InteractiveModeStatus.End Then
      e.Cancel = True
      If (Not viewer.IsInteractiveModeBusy) Then
         MessageBox.Show("Interactive mode (Rectangular geometry) cancelled")
         viewer.InteractiveMode = InteractiveMode.None
      End If
   End If

   Console.WriteLine("" & e.Bounds.Left & ", " & e.Bounds.Top & ", " & e.Bounds.Right & ", " & e.Bounds.Bottom)
End Sub

Remarks

The type of interactive user operation is determined by the ImageViewer.InteractiveMode property.

Requirements

Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also