Files
egtbeamwall/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowV.xaml.vb
T
Emmanuele Sassi b0c6bb52f8 - Aggiunta finestra LoadingWnd per caricamenti
- Nascosto parametri Q in ottimizzatore per travi
2022-02-11 19:23:05 +01:00

71 lines
2.2 KiB
VB.net

Imports EgtWPFLib5
Imports EgtUILib
Imports EgtBEAMWALL.Core
Class MainWindowV
Private m_MainWindowVM As MainWindowVM
#Region "CONSTRUCTOR"
Sub New()
' Funzione che interpreta l'xaml
InitializeComponent()
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_MainWindowVM = DirectCast(Me.DataContext, MainWindowVM)
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)
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)
' 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())
' Se BTL importo il file
If EgtGetFileType(sFiles(0)) = FT.BTL Then
Map.refProjManagerVM.ImportBTL(sFiles(0), False)
End If
End If
End Sub
Private Sub MainWindowV_Activated(sender As Object, e As EventArgs) Handles Me.Activated
LoadingWndHelper.SetMainWindowIsActive(True)
End Sub
Private Sub MainWindowV_Deactivated(sender As Object, e As EventArgs) Handles Me.Deactivated
LoadingWndHelper.SetMainWindowIsActive(False)
End Sub
#End Region ' EVENTS
End Class