Leadtools.Windows.Controls Send comments on this topic. | Back to Introduction - LEADTOOLS WPF | Help Version 16.5.9.25
IsInteractiveModeBusy Property
See Also  Example
Leadtools.Windows.Controls Namespace > BitmapSourceViewer Class : IsInteractiveModeBusy Property





Determines if the user is currently involved in an interactive operation.

Syntax

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

Dependencies Property Information 

Identifier field

InteractiveGeometryTypeProperty

Metadata properties set to true

None

XAML Syntax 
You cannot set this property in XAML.

Dependencies Property Information 

Identifier field

InteractiveGeometryTypeProperty

Metadata properties set to true

None

Return Value

true if the user is currently involved in an interactive operation, false otherwise.

Example

This sets the interactive mode to MagnifyGlass. 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 BitmapSourceViewer)
    AddHandler viewer.InteractiveGeometry, AddressOf viewer_InteractiveGeometry
    viewer.InteractiveMode = BitmapSourceViewerInteractiveMode.Geometry
    viewer.InteractiveGeometryType = BitmapSourceViewerInteractiveGeometryType.Rectangle

    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_InteractiveGeometry(ByVal sender As Object, ByVal e As BitmapSourceViewerRectangleEventArgs)
    Console.WriteLine("" & e.Status)
    Dim viewer As BitmapSourceViewer = CType(IIf(TypeOf sender Is BitmapSourceViewer, sender, Nothing), BitmapSourceViewer)

    Dim ee As BitmapSourceViewerRectangleEventArgs = New BitmapSourceViewerRectangleEventArgs(e.Status, e.Rectangle)
    If e.Status = BitmapSourceViewerInteractiveStatus.End Then
        e.Cancel = True
        If (Not viewer.IsInteractiveModeBusy) Then
            MessageBox.Show("Interactive mode (Rectangular geometry) cancelled")
            viewer.InteractiveMode = BitmapSourceViewerInteractiveMode.None
        End If
    End If
    Console.WriteLine("" & e.Rectangle.Left & ", " & e.Rectangle.Top & ", " & e.Rectangle.Right & ", " & e.Rectangle.Bottom)
End Sub
C#Copy Code
public void BitmapSourceViewer_IsInteractiveModeBusy(BitmapSourceViewer viewer) 

   viewer.InteractiveGeometry += new InteractiveGeometryEventHandler(viewer_InteractiveGeometry); 
   viewer.InteractiveMode = BitmapSourceViewerInteractiveMode.Geometry; 
   viewer.InteractiveGeometryType = BitmapSourceViewerInteractiveGeometryType.Rectangle; 
 
   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_InteractiveGeometry(object sender, BitmapSourceViewerRectangleEventArgs e) 

   Console.WriteLine(@"" + e.Status); 
   BitmapSourceViewer viewer = sender as BitmapSourceViewer; 
 
   BitmapSourceViewerRectangleEventArgs ee = new BitmapSourceViewerRectangleEventArgs(e.Status, e.Rectangle); 
   if (e.Status == BitmapSourceViewerInteractiveStatus.End) 
   { 
      e.Cancel = true; 
      if(!viewer.IsInteractiveModeBusy) 
      { 
         MessageBox.Show("Interactive mode (Rectangular geometry) cancelled"); 
         viewer.InteractiveMode = BitmapSourceViewerInteractiveMode.None; 
      } 
   } 
   Console.WriteLine(@"" + e.Rectangle.Left + ", " + e.Rectangle.Top + ", " + e.Rectangle.Right + ", " + e.Rectangle.Bottom); 
}
XAMLCopy Code
<Window x:Class="WPFSamples.BitmapSourceViewer" Height="600" Width="800" Title="IsInteractiveModeBusy Sample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Leadtools_Windows_Controls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls"> 
  <DockPanel> 
    <Leadtools_Windows_Controls:BitmapSourceViewer Name="theViewer" Source="file:///C:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\slave.jpg" DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Bottom" InteractiveMode="Geometry" InteractiveGeometryType="Rectangle" InteractiveGeometry="viewer_InteractiveGeometry" /> 
  </DockPanel> 
</Window>

Remarks

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

Requirements

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

See Also