Version

Moving Event

Occurs when a XamDialogWindow starting to move.
Syntax
'Declaration
 
Public Event Moving As EventHandler(Of MovingEventArgs)
public event EventHandler<MovingEventArgs> Moving
Event Data

The event handler receives an argument of type MovingEventArgs containing data related to this event. The following MovingEventArgs properties provide information specific to this event.

PropertyDescription
Cancel (Inherited from Infragistics.CancellableEventArgs) 
Left Gets or sets the Left coordinate property
Top Gets or sets the Top coordinate property
Example
The moment right before the dialog window is moved, the Moving event fires. This event can be cancelled if certain conditions are not met.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

AddHandler DialogWindow.Moving, AddressOf DialogWindow_Moving

Private Sub DialogWindow_Moving(ByVal sender As System.Object, ByVal e As MovingEventArgs)
   'Don't allow the dialog window to move more than 200 pixels 
   If (e.Left > 200) Then
      e.Cancel = True
      System.Diagnostics.Debug.WriteLine("Moving Cancelled")
      Return
   End If
   System.Diagnostics.Debug.WriteLine("Dialog Window Moving Successfully")
End Sub
DialogWindow.Moving += new EventHandler<MovingEventArgs>(DialogWindow_Moving);
...
void DialogWindow_Moving(object sender, MovingEventArgs e)
{
    //Don't allow the dialog window to move more than 200 pixels 
   if (e.Left > 200)
   {
      e.Cancel = true;
      System.Diagnostics.Debug.WriteLine("Moving Cancelled");
      return;
   }
   System.Diagnostics.Debug.WriteLine("Dialog Window Moving Successfully");
}
<Grid x:Name="LayoutRoot" Background="White">
   
<ig:XamDialogWindow Content="Dialog Window" 
      
x:Name="DialogWindow" Width="200" Height="200" 
      
Moving="DialogWindow_Moving"/>
</Grid>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also