public ShellViewModel(IShellView view, IShellService shellService, ISyncService syncStartService, IGuiInteractionService guiInteractionService, Settings settings, SyncSummary syncSummary, IMessageService messageService, ApplicationLogger applicationLogger, IApplicationUpdateService applicationUpdateService, SystemTrayNotifierViewModel systemTrayNotifierViewModel, ChildContentViewFactory childContentViewFactory) : base(view) { _statusBuilder = new StringBuilder(); MessageService = messageService; ApplicationLogger = applicationLogger; Logger = applicationLogger.GetLogger(GetType()); ApplicationUpdateService = applicationUpdateService; ShellService = shellService; SyncStartService = syncStartService; GuiInteractionService = guiInteractionService; Settings = settings; SyncSummary = syncSummary; SystemTrayNotifierViewModel = systemTrayNotifierViewModel; ChildContentViewFactory = childContentViewFactory; view.Closing += ViewClosing; view.Closed += ViewClosed; }
private void UpdateNotification(string popupText) { if (!Settings.AppSettings.HideSystemTrayTooltip) { try { SystemTrayNotifierViewModel.UpdateBalloonText(popupText); } catch (Exception exception) { Logger.Error("Updating status in balloon", exception); } } }
private void ShowNotification(bool showHide, string popupText = "Syncing...") { if (!Settings.AppSettings.HideSystemTrayTooltip) { try { if (showHide) { SystemTrayNotifierViewModel.ShowBalloon(popupText); } else { SystemTrayNotifierViewModel.HideBalloon(); } } catch (Exception exception) { Logger.Error(exception); } } }
private void UpdateContinuationAction(Task <string> task) { BeginInvokeOnCurrentDispatcher(() => { if (task.Result == null) { if (ApplicationUpdateService.IsNewVersionAvailable()) { var version = ApplicationUpdateService.GetNewAvailableVersion(); if (string.IsNullOrEmpty(LatestVersion) || !version.Equals(LatestVersion)) { IsLatestVersionAvailable = true; LatestVersion = version; SystemTrayNotifierViewModel.ShowBalloon( $"New Update {version} Available!", 5000); } } _lastCheckDateTime = DateTime.Now; } }); }