Exemplo n.º 1
0
        private void MakePost()
        {
            var dlg = EditPostWindow.CreateForRant();

            dlg.Owner = window;

            dlg.ShowDialog();

            if (!dlg.Cancelled)
            {
                if (dlg.AddedDraft != null)
                {
                    //TODO: Should store the added draft in mem?
                    UpdateDrafts(db.GetNumberOfDrafts());
                }
            }
        }
Exemplo n.º 2
0
        public async void OpenPost()
        {
            if (SelectedPost == null)
            {
                return;
            }
            else if (await Utilities.OpenFeedItem(SelectedPost, api, window))
            {
                if (SelectedPost is ViewModels.Notification)
                {
                    ViewModels.Notification notif = SelectedPost as ViewModels.Notification;
                    foreach (ViewModels.Notification n in feeds)
                    {
                        if (n.RantId == notif.RantId)
                        {
                            n.MarkRead();
                        }
                    }

                    UpdateNotifications(new NotificationsChecker.UpdateArgs(feeds.Where(x => !x.Read).Count(), feeds.Count));
                    FeedView.Refresh();
                }
            }
            else if (SelectedPost is Draft)
            {
                var dlg = EditPostWindow.CreateForRant(SelectedPost as Draft);
                dlg.Owner = window;

                dlg.ShowDialog();

                if (!dlg.Cancelled)
                {
                    UpdateDrafts(AppManager.Instance.DB.GetNumberOfDrafts());
                    LoadDrafts();
                }
            }
        }