Imports EgtWPFLib5
Imports System.Windows.Input

Public Class OnlyProdMachiningDbWindowV

   Private WithEvents m_MachiningDbWindowVM As MachiningDbWindowVM

   Sub New(Owner As System.Windows.Window, MachiningDbWindowVM As MachiningDbWindowVM)
      MyBase.New(Owner)
      ' This call is required by the designer.
      InitializeComponent()
      Me.DataContext = MachiningDbWindowVM
      ' Assegno al riferimento locale al VM il VM preso dal DataContext
      m_MachiningDbWindowVM = MachiningDbWindowVM
   End Sub

   Private Sub CloseWindow(bDialogResult As Boolean) Handles m_MachiningDbWindowVM.m_CloseWindow
      Me.DataContext = Nothing
      Me.DialogResult = bDialogResult
      Me.Close()
   End Sub

   Private Sub MachiningDb_Closing(sender As Object, e As ComponentModel.CancelEventArgs) Handles Me.Closing
      If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
         e.Cancel = True
         Return
      End If
   End Sub

End Class
