public MainWindow() { InitializeComponent(); this.Hide(); // Dieses Windows startet Minimized und Unsichtbar (nur im Tray sichtbar) this.LevelCombo.ItemsSource = Enum.GetValues(typeof(ILogging.Level)).Cast <ILogging.Level>(); MyViewModel = (MainViewModel)DataContext; MyViewModel.AddChildVm(this.LiveLogView.DataContext); this.Title = "Wpf Trayhost - CashAccounting"; string startMessage = ""; try { MyViewModel.StartService(); startMessage = "CashAccounting started."; } catch (Exception ex) { startMessage = $"Error starting CashAccounting: '{ex.Message}'."; } CreateNotifyIcon(startMessage); }