Exemplo n.º 1
0
        protected virtual async Task onOpenItem()
        {
            if (TreatAsASingleItem == false)
            {
                return;
            }
            //if (this.IgnoreTapping)
            //    return;

            if (App.Navigator.GetOpenedPage(typeof(NewsfeedItemPage)) != null)
            {
                return;
            }

            var page = new NewsfeedItemPage(item, false);
            await App.Navigator.NavPage.PushAsync(page);

            page.Disappearing += (s1, e1) =>
            {
                if (page.AnythingChanged)
                {
                    this.fireNeedsARefresh();
                }
            };
        }
Exemplo n.º 2
0
        public void OpenNewsfeedItemPage(int commentID)
        {
            PleaseWaitPage pleaseWaitPage = new PleaseWaitPage();

            pleaseWaitPage.StatusText       = "Loading.";
            pleaseWaitPage.ShowCancelButton = true;
            NavPage.Navigation.PushModalAsync(pleaseWaitPage);
            pleaseWaitPage.CancelButtonClicked += (s1, e1) =>
            {
                NavPage.Navigation.PopModalAsync();
                pleaseWaitPage = null;
            };

            Task task = new Task(async() =>
            {
                var item = await App.WebService.GetNewsfeedItemFromCommentID(commentID);
                Device.BeginInvokeOnMainThread(async() =>
                {
                    // close the wait page
                    await NavPage.Navigation.PopModalAsync();

                    // open newsfeed item page
                    if (item == null)
                    {
                        await this.GoToCommunity();
                    }
                    else
                    {
                        NewsfeedItemPage page = new NewsfeedItemPage(item, true);
                        await NavPage.Navigation.PushModalAsync(page);
                    }
                });
            });

            task.Start();
        }