Example #1
0
        public async void PopulateContent()
        {
            InitTBI();
            var preloadStack = new StackLayout {
                Orientation = StackOrientation.Vertical,
                Children    =
                {
                    //Util.CreateSearchBar()
                }
            };

            Content = preloadStack;

            refreshHandler.ExecuteRefreshCommand(this);
        }
Example #2
0
        void UpdatePosts(PullToRefreshViewModel refreshModel, StackLayout PostsContainer, PostItem message, string groupid)
        {
            if (string.Equals(message.GroupID, groupid))
            {
                Debug.WriteLine("signalr message and current group match!");
                //PostItem postwID = await App.DataDB.GetSinglePostByPostTextTitleUserIDGroupID(message.Body, message.Title, message.UserId, message.GroupID);//dont delete, sometimes azure gets delayed so calling it here gives it time
                if (message != null)
                {
                    Debug.WriteLine("Recieved PostItem, generated ID is: {0}", message.ID);

                    //add to top stack
                    Device.BeginInvokeOnMainThread(() => {
                        if (PostsContainer == null)
                        {
                            Debug.WriteLine("no posts in feed yet");
                            refreshModel.ExecuteRefreshCommand();
                        }
                        else
                        {
                            Debug.WriteLine("{0}, posts in feed", PostsContainer.Children.Count);
                            PostsContainer.Children.Insert(1, new PostItemStackLayout(message));
                        }
                    });
                }
                else
                {
                    Debug.WriteLine("Couldn't fetch PostItem from db");
                }
            }
            else
            {
                Debug.WriteLine("PostItem {0} received, does not match group id {1}", message.ID, message.GroupID);
            }
        }