// Listen for download completions, send message to UI when all done
        private void BattlelogResponseMessageReceived(BattlelogResponseMessage message)
        {
            if (message.Sender == null || (message.Sender.GetType() != (typeof(DownloadService))))
            {
                return;
            }

            _responseMessages++;
            if (_responseMessages == ExpectedResponseMessages)
            {
                Messenger.Default.Send(new BattlelogUpdateCompleteMessage());
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Update UI when web requests complete
 /// </summary>
 /// <param name="message"></param>
 private void BattlelogResponseMessageReceived(BattlelogResponseMessage message)
 {
     if (message.IsOk)
     {
         ((App)Application.Current).RootFrame.Dispatcher.BeginInvoke(() =>
                                                                     StatusInformation = message.Message);
     }
     else
     {
         ((App)Application.Current).RootFrame.Dispatcher.BeginInvoke(() =>
                                                                     StatusInformation = string.Empty);
         ((App)Application.Current).RootFrame.Dispatcher.BeginInvoke(() =>
                                                                     LogInFailedReason = message.Message);
         ((App)Application.Current).RootFrame.Dispatcher.BeginInvoke(() =>
                                                                     UserInterfaceEnabled = true);
     }
 }