520da5abe9
- Cambiato nome cartella progetto da Test a Tray - Modificati Service e Console per compilare - gestito ordine di compilazione - aggiunta copia dopo compilazione su Core
37 lines
1.0 KiB
VB.net
37 lines
1.0 KiB
VB.net
Imports System.Windows.Threading
|
|
Imports EgwWPFBaseLib
|
|
|
|
Class MainWindowV
|
|
|
|
Private m_FocusTimer As New DispatcherTimer
|
|
|
|
Private m_MainWindowVM As MainWindowVM
|
|
|
|
Sub New(MainWindowVM As MainWindowVM)
|
|
m_MainWindowVM = MainWindowVM
|
|
' Funzione che interpreta l'xaml
|
|
InitializeComponent()
|
|
' Assegno al DataContext il VM appena creato
|
|
Me.DataContext = m_MainWindowVM
|
|
AddHandler Me.ContentRendered, AddressOf MainWindowV_ContentRendered
|
|
AddHandler Me.Closing, AddressOf MainWindowV_Closing
|
|
m_FocusTimer.Interval = TimeSpan.FromMilliseconds(10)
|
|
AddHandler m_FocusTimer.Tick, AddressOf FocusTimer_Tick
|
|
End Sub
|
|
|
|
Private Sub MainWindowV_Closing() Handles Me.Closing
|
|
m_MainWindowVM.OnClose()
|
|
End Sub
|
|
|
|
Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs)
|
|
m_FocusTimer.Start()
|
|
End Sub
|
|
|
|
Private Sub FocusTimer_Tick(sender As Object, e As EventArgs)
|
|
m_FocusTimer.Stop()
|
|
Me.Activate()
|
|
Me.Focus()
|
|
End Sub
|
|
|
|
End Class
|