public PopupWindow(ActionsViewModel vm) { InitializeComponent(); this.viewModel = vm; this.uiHelper = new WindowOverTrayHelper(this, viewModel); this.DataContext = viewModel; this.viewModel.NewActionRetreived += viewModel_NewActionRetreived; this.hideTimer = new DispatcherTimer(DispatcherPriority.ContextIdle); hideTimer.Interval = TimeSpan.FromSeconds(ShowTimeoutSeconds); hideTimer.Tick += hideTimer_Tick; this.chimePlayer = new SoundPlayer(AppResources.chime); }
/// <summary> /// Запустить функциональность проверки недавних действий /// </summary> public void StartActivity() { this.viewModel = new ActionsViewModel(); this.uiHelper = new WindowOverTrayHelper(this, viewModel); this.DataContext = viewModel; this.popupNotifyWindow = new PopupWindow(viewModel); SetupNotifyIcon(); if (SettingsStore.Instance.IsCleanRun) { ShowNotifyBaloon(); } // Таймер проверки новых действий checkTimer = new DispatcherTimer(DispatcherPriority.ApplicationIdle); checkTimer.Interval = TimeSpan.FromSeconds(CheckIntervalSeconds); checkTimer.Tick += checkTimer_Tick; checkTimer.Start(); // Проверить сразу же checkTimer_Tick(this, EventArgs.Empty); }