public async Task ExecuteRefreshCommand(GroupFeed feed = null)
        {
            Debug.WriteLine("Started ExecuteRefreshCommand");
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            if (feed != null)
            {
                feed.IsBusy = true;
            }

            Debug.WriteLine("Rebuilding UI post list");
            if (string.Equals(App.NewestOrTrending, Values.TRENDING))
            {
                //then sort posts by trending
                page.Content = page.CreateScrollableFeedView(Util.LoadFeedDataIntoFeedList(await App.DataDB.GetPostItemsByGroupOrderByPopularAsync(page.groupid),
                                                                                           await App.DataDB.GetCommentsByGroupIDAsync(page.groupid), page.groupid), "Search", page.Title, page.groupid);
            }
            else if (string.Equals(App.NewestOrTrending, Values.NEWEST))
            {
                //then order by most recently posted
                page.Content = page.CreateScrollableFeedView(Util.LoadFeedDataIntoFeedList(await App.DataDB.GetPostItemsByGroupOrderByRecentAsync(page.groupid),
                                                                                           await App.DataDB.GetCommentsByGroupIDAsync(page.groupid), page.groupid), "Search", page.Title, page.groupid);
            }

            IsBusy = false;
            Debug.WriteLine("ExecuteRefreshCommand done");
            if (feed != null)
            {
                feed.IsBusy = false;
            }

            //start refresh interval for posts
            App.ChatClient.ListenForNewPosts(this, page.feedPosts, page.groupid);
        }
 public PullToRefreshViewModel(GroupFeed page)
 {
     this.page = page;
 }