←Select platform

InteractiveMode Property

Summary

Gets or sets a value that indicates the current user interaction mode with the control's display. This is a dependency property.

Syntax

C#
VB
C++
public InteractiveMode InteractiveMode { get; set; } 
  
Public Property InteractiveMode As Leadtools.Windows.Controls.InteractiveMode 

Property Value

An InteractiveMode enumeration member that indicates the current user interaction mode with the control's display. Default value is InteractiveMode.None.

Remarks

You can change the mouse cursor associated with a particular interactive mode with the SetInteractiveModeCursor method. For descriptions of the various interactive mode available, refer to InteractiveMode.

Example

This example changes between interactive modes -- from none, to pan, to magnifying glass and back to none.

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
 
private void viewer_InteractiveModeChanged(object sender, RoutedEventArgs e) 
{ 
   ImageViewer viewer = sender as ImageViewer; 
   string s = string.Format("InteractiveMode changed to: {0}", viewer.InteractiveMode.ToString()); 
   MessageBox.Show(s); 
} 
 
public void BitmapSourceViewer_InteractiveMode(ImageViewer viewer) 
{ 
   viewer.InteractiveModeChanged += new RoutedPropertyChangedEventHandler<InteractiveMode>(viewer_InteractiveModeChanged); 
   viewer.InteractivePan += new EventHandler<LineInteractiveEventArgs>(viewer_InteractivePan); 
 
   switch (viewer.InteractiveMode) 
   { 
      case InteractiveMode.None: 
         viewer.InteractiveMode = InteractiveMode.Pan; 
         break; 
 
      case InteractiveMode.Pan: 
         viewer.InteractiveMode = InteractiveMode.MagnifyGlass; 
         break; 
 
      case InteractiveMode.MagnifyGlass: 
         viewer.InteractiveMode = InteractiveMode.ZoomTo; 
         break; 
 
      case InteractiveMode.ZoomTo: 
         viewer.InteractiveMode = InteractiveMode.None; 
         break; 
   } 
 
   viewer.InteractiveModeChanged -= new RoutedPropertyChangedEventHandler<InteractiveMode>(viewer_InteractiveModeChanged); 
} 
Imports Leadtools.Windows.Controls 
 
Private Sub viewer_InteractiveModeChanged(ByVal sender As Object, ByVal e As RoutedEventArgs) 
   Dim viewer As ImageViewer = TryCast(sender, ImageViewer) 
   Dim s As String = String.Format("InteractiveMode changed to: {0}", viewer.InteractiveMode.ToString()) 
   MessageBox.Show(s) 
End Sub 
 
Public Sub BitmapSourceViewer_InteractiveMode(ByVal viewer As ImageViewer) 
   AddHandler viewer.InteractiveModeChanged, AddressOf viewer_InteractiveModeChanged 
   AddHandler viewer.InteractivePan, AddressOf viewer_InteractivePan 
 
   Select Case viewer.InteractiveMode 
      Case InteractiveMode.None 
         viewer.InteractiveMode = InteractiveMode.Pan 
 
      Case InteractiveMode.Pan 
         viewer.InteractiveMode = InteractiveMode.MagnifyGlass 
 
      Case InteractiveMode.MagnifyGlass 
         viewer.InteractiveMode = InteractiveMode.ZoomTo 
 
      Case InteractiveMode.ZoomTo 
         viewer.InteractiveMode = InteractiveMode.None 
   End Select 
 
   RemoveHandler viewer.InteractiveModeChanged, AddressOf viewer_InteractiveModeChanged 
End Sub 
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
 
private void viewer_InteractiveModeChanged(object sender, RoutedEventArgs e) 
{ 
   ImageViewer viewer = sender as ImageViewer; 
   string s = string.Format("InteractiveMode changed to: {0}", viewer.InteractiveMode.ToString()); 
   MessageBox.Show(s); 
} 
 
public void BitmapSourceViewer_InteractiveMode(ImageViewer viewer) 
{ 
   viewer.InteractiveModeChanged += new RoutedPropertyChangedEventHandler<InteractiveMode>(viewer_InteractiveModeChanged); 
   viewer.InteractivePan += new EventHandler<LineInteractiveEventArgs>(viewer_InteractivePan); 
 
   switch (viewer.InteractiveMode) 
   { 
      case InteractiveMode.None: 
         viewer.InteractiveMode = InteractiveMode.Pan; 
         break; 
 
      case InteractiveMode.Pan: 
         viewer.InteractiveMode = InteractiveMode.MagnifyGlass; 
         break; 
 
      case InteractiveMode.MagnifyGlass: 
         viewer.InteractiveMode = InteractiveMode.ZoomTo; 
         break; 
 
      case InteractiveMode.ZoomTo: 
         viewer.InteractiveMode = InteractiveMode.None; 
         break; 
   } 
 
   viewer.InteractiveModeChanged -= new RoutedPropertyChangedEventHandler<InteractiveMode>(viewer_InteractiveModeChanged); 
} 
Imports Leadtools 
Imports Leadtools.Windows.Controls 
 
Private Sub viewer_InteractiveModeChanged(ByVal sender As Object, ByVal e As RoutedEventArgs) 
   Dim viewer As ImageViewer = TryCast(sender, ImageViewer) 
   Dim s As String = String.Format("InteractiveMode changed to: {0}", viewer.InteractiveMode.ToString()) 
   MessageBox.Show(s) 
End Sub 
 
Public Sub BitmapSourceViewer_InteractiveMode(ByVal viewer As ImageViewer) 
   AddHandler viewer.InteractiveModeChanged, AddressOf viewer_InteractiveModeChanged 
   AddHandler viewer.InteractivePan, AddressOf viewer_InteractivePan 
 
   Select Case viewer.InteractiveMode 
      Case InteractiveMode.None 
         viewer.InteractiveMode = InteractiveMode.Pan 
 
      Case InteractiveMode.Pan 
         viewer.InteractiveMode = InteractiveMode.MagnifyGlass 
 
      Case InteractiveMode.MagnifyGlass 
         viewer.InteractiveMode = InteractiveMode.ZoomTo 
 
      Case InteractiveMode.ZoomTo 
         viewer.InteractiveMode = InteractiveMode.None 
   End Select 
 
   RemoveHandler viewer.InteractiveModeChanged, AddressOf viewer_InteractiveModeChanged 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Windows.Controls Assembly