示例#1
0
        /// <summary>
        /// Вызывается при остановке сервиса.
        /// </summary>
        /// <param name="reason">Причина остановки.</param>
        private void OnServiceStopped(VKLongPollServiceStopReason reason)
        {
            IsWorking = false;
            if (ServiceStopped != null)
            {
                ServiceStopped(this, reason);
            }

            var notification = new AppNotification
            {
                Type       = AppNotificationType.Error,
                Title      = "Сервис мгновенных сообщений остановлен",
                Content    = "Коснитесь для перезапуска",
                ActionToDo = Start,
                Duration   = TimeSpan.FromSeconds(15)
            };

            appNotificationsService.SendNotification(notification);
        }
示例#2
0
 private void VKLongPollService_ServiceStopped(IVKLongPollService sender, VKLongPollServiceStopReason args)
 {
     OnPropertyChanged(nameof(LongPollServiceState));
 }