Files
icarus/Icarus/MainWindow/MainWindowV.xaml.vb
T
Emmanuele Sassi 0532c0c486 - cambio nome del progetto in Icarus
- gestione ribs completata
- nuove funzionalita' introdotte su tabella TFS
- correzioni e migliorie varie
2022-09-08 17:36:35 +02:00

69 lines
2.1 KiB
VB.net

Imports EgtWPFLib5
Imports EgtUILib
Imports System.Windows.Interop
Class MainWindowV
Private m_MainWindowVM As MainWindowVM
Private m_SceneHostWnd As SecondaryWindowV
#Region "CONSTRUCTOR"
Sub New()
m_MainWindowVM = New MainWindowVM
' Funzione che interpreta l'xaml
InitializeComponent()
Me.DataContext = m_MainWindowVM
' creo finestra della scena
AddHandler Me.Loaded, AddressOf MainWindowV_Loaded
AddHandler Me.ContentRendered, AddressOf MainWindowV_ContentRendered
AddHandler Me.Closing, AddressOf MainWindowV_Closing
AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown
End Sub
#End Region ' CONSTRUCTOR
#Region "EVENTS"
Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs)
' Carico e imposto posizione finestra
WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
' Recupero e imposto handle finestra principale
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
EgtSetMainWindowHandle(hMainWnd)
End Sub
Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs)
m_MainWindowVM.ContentRendered()
End Sub
Private Sub MainWindowV_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
e.Cancel = True
Return
End If
' Salvo posizione finestra (se non minimizzata)
If WindowState <> WindowState.Minimized Then
WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
End If
End Sub
Private Sub MainWindowV_KeyDown(sender As Object, e As KeyEventArgs)
m_MainWindowVM.KeyDown(e.Key)
End Sub
Private Sub MainWindowV_Drop(sender As Object, e As DragEventArgs)
' Se drag di file
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
' Attivo il programma
Me.Activate()
' Recupero l'array di stringhe con i nomi del file
Dim sFiles() As String = DirectCast(e.Data.GetData(DataFormats.FileDrop), String())
End If
End Sub
#End Region ' EVENTS
End Class