public async Task <bool> LoadThread(string token)
        {
            IWindowManager wm = IoC.Get <IWindowManager>();

            wm.ShowBusyView("Loading Feedbacks...");
            try
            {
                this.FeedbackThread = await HockeyClientWPF.Instance.OpenFeedbackThreadAsync(token);

                this.FeedbackMessages.Clear();

                if (this.FeedbackThread != null)
                {
                    this.FeedbackThread.Messages.ForEach(p => FeedbackMessages.Add(new FeedbackMessageViewModel(p)));
                    this.FeedbackMessages.Add(new NewFeedbackMessage(this));
                }
                else
                {
                    FeedbackToken.DeleteToken(token);
                    raiseDeletedOnServer();
                }
            }
            catch (Exception ex)
            {
                wm.ShowBusyView("An error ocurred:\n" + ex.Message);
            }
            finally
            {
                wm.HideBusyView();
            }
            return(this.FeedbackThread != null);
        }
        private async void loadFeedbackThreads()
        {
            foreach (string token in FeedbackToken.Get())
            {
                FeedbackThreadViewModel fbThread = new FeedbackThreadViewModel(null);
                if (await fbThread.LoadThread(token))
                {
                    fbThread.DeletedOnServer += delegate(object sender, EventArgs args)
                    {
                        IWindowManager wm = IoC.Get <IWindowManager>();
                        wm.ShowMetroMessageBox("Feedback-Thread was deleted on the server!", "Deleted", System.Windows.MessageBoxButton.OK);
                        this.FeedbackThreadList.Remove(fbThread);
                    };
                    FeedbackThreadList.Add(fbThread);
                }
            }

            if (this.FeedbackThreadList.Count == 0)
            {
                this.NewThread();
            }

            //this.FeedbackThreadList.Add(new AddFeedbackThreadViewModel());

            this.SelectedFeedbackThread = this.FeedbackThreadList.FirstOrDefault();
        }
        public void CloseThread()
        {
            IWindowManager wm = IoC.Get <IWindowManager>();

            if (wm.ShowMetroMessageBox("Thread will be closed and cannot be opened later. Continue anyway?", "Close thread", System.Windows.MessageBoxButton.YesNo) == System.Windows.MessageBoxResult.Yes)
            {
                FeedbackToken.DeleteToken(this.SelectedFeedbackThread.FeedbackThread.Token);
                int pos = this.FeedbackThreadList.IndexOf(this.SelectedFeedbackThread);
                this.FeedbackThreadList.Remove(this.SelectedFeedbackThread);
                if (this.FeedbackThreadList.Count >= pos + 1)
                {
                    this.SelectedFeedbackThread = this.FeedbackThreadList[pos];
                }
                else if (this.FeedbackThreadList.Count > 0)
                {
                    this.SelectedFeedbackThread = this.FeedbackThreadList[this.FeedbackThreadList.Count - 1];
                }
                else
                {
                    this.NewThread();
                }
            }
        }
        public async void Submit()
        {
            bool            wasNewThread = this._fbThreadVM.IsNewThread;
            IFeedbackThread fbThread     = this._fbThreadVM.FeedbackThread;
            IWindowManager  wm           = IoC.Get <IWindowManager>();

            wm.ShowBusyView("Submitting...");
            try
            {
                IFeedbackMessage msg = await fbThread.PostFeedbackMessageAsync(this.Message, this.EMail, this.Subject, this.Username);

                HockeyApp.AppLoader.Properties.Settings.Default.LastFeedbackUserName  = this.Username;
                HockeyApp.AppLoader.Properties.Settings.Default.LastFeedbackUserEMail = this.EMail;
                HockeyApp.AppLoader.Properties.Settings.Default.Save();

                if (msg != null)
                {
                    if (wasNewThread)
                    {
                        FeedbackToken.AddToken(fbThread.Token);
                    }
                    this._fbThreadVM.FeedbackMessages.Insert(this._fbThreadVM.FeedbackMessages.Count - 1, new FeedbackMessageViewModel(msg));
                    this._fbThreadVM.NotifyOfPropertyChange(() => this._fbThreadVM.Subject);
                    this.NotifyOfPropertyChange(() => this.IsNewThread);
                    this.Message = "";
                }
            }
            catch (Exception ex)
            {
                wm.ShowMetroMessageBox("An error ocurred:\n" + ex.Message);
            }
            finally
            {
                wm.HideBusyView();
            }
        }