This member is available in the WPF Express Edition. See the LEADTOOLS products page for full details on more WPF features available with LEADTOOLS toolkits.
Determines if the user is currently involved in an interactive operation.
Syntax
Visual Basic (Declaration) | |
---|
Public ReadOnly Property IsInteractiveModeBusy As Boolean |
C# | |
---|
public bool IsInteractiveModeBusy {get;} |
Managed Extensions for C++ | |
---|
public: __property bool get_IsInteractiveModeBusy(); |
C++/CLI | |
---|
public:
property bool IsInteractiveModeBusy {
bool get();
} |
XAML | |
---|
You cannot set this property in XAML. |
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 Basic | Copy 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); } |
XAML | Copy 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 15\Images\slave.jpg" DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Bottom" InteractiveMode="Geometry" InteractiveGeometryType="Rectangle" InteractiveGeometry="viewer_InteractiveGeometry" /> </DockPanel> </Window> |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family
See Also