Esempio n. 1
0
 private void ConnectFailed(string message, string title)
 {
     Dispatcher.BeginInvoke(() => {
         HideProgressBar();
         gtalkHelper.ShowToast(message, title);
     });
 }
Esempio n. 2
0
        public Chat()
        {
            InitializeComponent();
            BuildAppbar();

            photoChooserTask.Completed += (s, r) => {
                if (r.TaskResult == TaskResult.OK)
                {
                    attachButton.IsEnabled = false;
                    BitmapImage bm = new BitmapImage();
                    bm.SetSource(r.ChosenPhoto);
                    ShowProgressBar(AppResources.Chat_ProgressUploadingPhoto);
                    Imgur.Upload(bm, (i, error) => {
                        if (i != null)
                        {
                            Dispatcher.BeginInvoke(() => {
                                MessageText.Text += " " + i.Original.ToString() + " ";
                                ScrollToBottom();
                                HideProgressBar();
                                attachButton.IsEnabled = true;
                                FlurryWP7SDK.Api.LogEvent("Chat - Image attached");
                            });
                        }
                        else
                        {
                            Dispatcher.BeginInvoke(() => {
                                gtalkHelper.ShowToast(error);
                                HideProgressBar();
                                attachButton.IsEnabled = true;
                                FlurryWP7SDK.Api.LogEvent("Chat - Image attached");
                            });
                        }
                    });
                }
            };
        }