Files
icarus/Icarus/SecondaryWindow/SecondaryWindowV.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

66 lines
2.4 KiB
VB.net

Imports EgtWPFLib5
Imports EgtUILib
Public Class SecondaryWindowV
Private m_SecondaryWindowVM As SecondaryWindowVM
#Region "CONSTRUCTOR"
Sub New(Owner As Window)
' Funzione che interpreta l'xaml
InitializeComponent()
m_SecondaryWindowVM = New SecondaryWindowVM
Me.DataContext = m_SecondaryWindowVM
Map.SetRefSecondaryWindowV(Me)
AddHandler Me.ContentRendered, AddressOf SecondaryWindowV_ContentRendered
AddHandler Me.Loaded, AddressOf SecondaryWindowV_Loaded
AddHandler Me.Closing, AddressOf SecondaryWindowV_Closing
AddHandler Me.LocationChanged, AddressOf SecondaryWindowV_LocationChanged
AddHandler Me.SizeChanged, AddressOf SecondaryWindowV_SizeChanged
AddHandler Me.StateChanged, AddressOf SecondaryWindowV_StateChanged
End Sub
Private Sub SecondaryWindowV_ContentRendered(sender As Object, e As EventArgs)
m_SecondaryWindowVM.ContentRendered()
End Sub
Private Sub SecondaryWindowV_Loaded(sender As Object, e As RoutedEventArgs)
' Carico e imposto posizione finestra
WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
End Sub
Private Sub SecondaryWindowV_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 SecondaryWindowV_LocationChanged(sender As Object, e As EventArgs)
Application.Current.MainWindow.Top = Me.Top
Application.Current.MainWindow.Left = Me.Left
End Sub
Private Sub SecondaryWindowV_SizeChanged(sender As Object, e As SizeChangedEventArgs)
If Not IsNothing(Application.Current.MainWindow) Then
If e.WidthChanged Then Application.Current.MainWindow.Width = e.NewSize.Width
If e.HeightChanged Then Application.Current.MainWindow.Height = e.NewSize.Height
Application.Current.MainWindow.InvalidateVisual()
End If
End Sub
Private Sub SecondaryWindowV_StateChanged(sender As Object, e As EventArgs)
Application.Current.MainWindow.WindowState = Me.WindowState
Application.Current.MainWindow.Topmost = True
Application.Current.MainWindow.Topmost = False
End Sub
#End Region ' CONSTRUCTOR
End Class