public MainViewModel(IDataService dataService, IEnumerable <INotifyService> notifyService, System.Windows.Forms.NotifyIcon notifyIcon, ILogViewModel logVM = null) { _Startup = true; Dispatcher.CurrentDispatcher.ShutdownStarted += Dispatcher_ShutdownStarted; LoadSettings(); SetNotifyIcon(notifyIcon); DataService = dataService; NotifyService.AddRange(notifyService); _LogViewModel = logVM; IsAutoStart = GetStartWithSystem(); AddSortingByDate(); LoadData(); View.Closing += View_Closing; NotifyTimer = new DispatcherTimer(); NotifyTimer.Interval = FirstTick; NotifyTimer.Tick += NotifyTimer_Tick; NotifyTimer.Start(); if (IsAutoStart) { View.Hide(); _NotifyIcon.ShowBalloonTip(Properties.Settings.Default.BaloonBasicTipTime, Properties.Settings.Default.AppName, Properties.Resources.Started, System.Windows.Forms.ToolTipIcon.None); } else { View.Show(); } _Startup = false; }