40 lines
1.3 KiB
VB.net
40 lines
1.3 KiB
VB.net
Imports EgtWPFLib5
|
|
Imports EgtUILib
|
|
|
|
Class Application
|
|
|
|
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
|
|
' can be handled in this file.
|
|
Protected Overrides Sub OnStartUp(e As System.Windows.StartupEventArgs)
|
|
MyBase.OnStartup(e)
|
|
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
|
' Creo la View principale
|
|
Me.MainWindow = New MainWindowV(e.Args)
|
|
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(Me.MainWindow)
|
|
If OptionModule.AdjustDDT Then
|
|
Me.MainWindow.Hide()
|
|
Else
|
|
Me.MainWindow.Show()
|
|
End If
|
|
'' Mostro la View principale
|
|
'Me.MainWindow.Show()
|
|
End Sub
|
|
|
|
Public Property ThemeDictionary As ResourceDictionary
|
|
' You could probably get it via its name with some query logic as well.
|
|
Get
|
|
Return Resources.MergedDictionaries(0)
|
|
End Get
|
|
Set(value As ResourceDictionary)
|
|
End Set
|
|
End Property
|
|
|
|
Public Sub ChangeTheme(uri As Uri)
|
|
ThemeDictionary.MergedDictionaries.Clear()
|
|
Dim rd As ResourceDictionary = New ResourceDictionary()
|
|
rd.Source = uri
|
|
ThemeDictionary.MergedDictionaries.Add(rd) ' New ResourceDictionary()) ' Source:=uri))
|
|
End Sub
|
|
|
|
End Class
|