コード例 #1
0
        void LoadItem()
        {
            // store
            State["CurrentIDIndex"] = CurrentIDIndex;

            var btnNext = ApplicationBar.FindButton("next");
            var btnPrev = ApplicationBar.FindButton("prev");
            btnNext.IsEnabled = CurrentIDIndex < IDList.Count - 1;
            btnPrev.IsEnabled = CurrentIDIndex > 0;

            OnBeforeLoading();

            LoadingManager.Start();

            var id = IDList[CurrentIDIndex];
            FBEntity.FindByID<FeedItem>(id, u =>
            {
                Item = u;

                ThreadHelper.RunOnUI(() =>
                {
                    OnItemLoaded();
                });

                LoadingManager.Stop();
            });
        }
コード例 #2
0
 public static void UpdateUserTileStatus(ShellTile shellTile, User user, FeedItem first)
 {
     shellTile.Update(new StandardTileData
     {
         BackBackgroundImage = GenerateUserTileBackBackgroundImage(user, first)
     });
 }
コード例 #3
0
        public static Uri GenerateUserTileBackBackgroundImage(User user, FeedItem first)
        {
            var date = "";
            var story = "";
            if (first != null)
            {
                date = first.Date.ToTimeDifferenceString();
                story = first.Story;
            }

            Uri backtileimageuri = null;
            var tilelock = new ManualResetEvent(false);
            ThreadHelper.RunOnUI(() =>
            {
                new Templates.TileBackTemplate
                {
                    Date = date,
                    Body = story,
                    User = user.Name
                }.SaveAsImage("User.{0}.BackTile".FormatWith(user.Id), fn =>
                {
                    backtileimageuri = fn;
                    tilelock.Set();
                });
            });
            tilelock.WaitOne();

            return backtileimageuri;
        }
コード例 #4
0
ファイル: Me.cs プロジェクト: mvalipour/WP7Facefeed
 /// <summary>
 /// Shares the given news feed item on my wall, when done the given callback is fired.
 /// </summary>
 public void ShareFeed(FeedItem item, Action callback)
 {
     FBDataAccess.Current.PostGraph(Id + "/links", new Dictionary<string, object>
     {
         {"link", item.Link.Or("www.facebook.com/{0}".FormatWith(item.Id.Replace("_", "/posts/")))},
         /*TODO: input message!*/
     }, callback);
 }