Beispiel #1
0
        public async void GetUserLikes()
        {
            if (FBSession.ActiveSession.LoggedIn)
            {
                string graphPath = FBSession.ActiveSession.User.Id + "/likes";

                FBJsonClassFactory fact = new FBJsonClassFactory(
                    (JsonText) => MyFBPage.FromJson(JsonText));

                _likes = new FBPaginatedArray(graphPath, null, fact);
                FBResult result = await _likes.FirstAsync();

                if (result.Succeeded)
                {
                    BadResultsTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    LikesListView.Visibility       = Windows.UI.Xaml.Visibility.Visible;
                    if (_likes.Current.Count > 0)
                    {
                        AddLikes(_likes.Current);
                    }
                    else
                    {
                        LikesListView.Visibility       = Windows.UI.Xaml.Visibility.Collapsed;
                        BadResultsTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
                        BadResultsTextBlock.Text       = "No User likes found";
                    }
                }
                else
                {
                    LikesListView.Visibility       = Windows.UI.Xaml.Visibility.Collapsed;
                    BadResultsTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    BadResultsTextBlock.Text       = result.ErrorInfo.Message;
                }
            }
        }
Beispiel #2
0
        void ListView_SelectionChanged(Object sender, SelectionChangedEventArgs e)
        {
            //FBPageBindable ^ selected = static_cast < FBPageBindable ^> (e->AddedItems->GetAt(0));
            MyFBPage selected = (MyFBPage)e.AddedItems.First();

            ItemDescription.Text = "hello";
        }
Beispiel #3
0
        public static MyFBPage FromJson(
            string JsonText
            )
        {
            MyFBPage obj =
                JsonConvert.DeserializeObject <MyFBPage>(JsonText);

            return(obj);
        }
Beispiel #4
0
        public async void GetPageWithId(
            string ID
            )
        {
            FBSingleValue val = new FBSingleValue("/" + ID, null,
                                                  new FBJsonClassFactory((JsonText) =>
                                                                         MyFBPage.FromJson(JsonText)));
            FBResult result = await val.GetAsync();

            if (result.Succeeded)
            {
                MyFBPage page = (MyFBPage)result.Object;
                //Do something with page here
            }
            else
            {
                HandleError(result.ErrorInfo);
            }
        }
Beispiel #5
0
        public async void GetUserLikes()
        {
            if (FBSession.ActiveSession.LoggedIn)
            {
                string graphPath = FBSession.ActiveSession.User.Id + "/likes";

                FBJsonClassFactory fact = new FBJsonClassFactory(
                    (JsonText) => MyFBPage.FromJson(JsonText));

                _likes = new FBPaginatedArray(graphPath, null, fact);
                FBResult result = await _likes.FirstAsync();

                if (result.Succeeded)
                {
                    IReadOnlyList <object> pages =
                        (IReadOnlyList <object>)result.Object;
                    AddLikes(pages);
                }
            }
        }