Exemplo n.º 1
0
        public FriendBarControl()
        {
            InitializeComponent();
            FacebookContactCollection friends = ServiceProvider.ViewManager.Friends;

            if (friends.Count > 0)
            {
                this.FilmStrip.SelectedItem = friends[0];
            }
            else
            {
                ServiceProvider.ViewManager.Friends.CollectionChanged += new NotifyCollectionChangedEventHandler(Friends_CollectionChanged);
            }
        }
Exemplo n.º 2
0
        private void Friends_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            FacebookContactCollection friends = ServiceProvider.ViewManager.Friends;

            // The FilmStrip won't display anything if SelectedItem doesn't get set.
            if (friends.Count > 0)
            {
                if (this.FilmStrip.SelectedItem == null)
                {
                    this.FilmStrip.SelectedItem = friends[0];
                }

                friends.CollectionChanged -= new NotifyCollectionChangedEventHandler(Friends_CollectionChanged);
            }
        }
Exemplo n.º 3
0
        public static void GenerateCustomSplashScreen(FacebookContactCollection friends)
        {
            // We don't need to lock on _hasGeneratedSplash because this should only ever enter on one thread.
            friends.VerifyAccess();

            if (_hasGeneratedSplash)
            {
                return;
            }
            _hasGeneratedSplash = true;
            // Do this on a separate thread to not block the UI.
            var t = new Thread((ParameterizedThreadStart)_BuildFriendsListsAndUpdateSplashImages)
            {
                Name         = "Splash Screen Generation",
                IsBackground = true,
            };

            t.Start(friends);
        }
Exemplo n.º 4
0
 public ContactCollectionNavigator(FacebookContactCollection contacts, FacebookObjectId guid, Navigator parent)
     : base(contacts, guid, parent)
 {
     _contacts = contacts;
 }