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); } }
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); } }
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); }
public ContactCollectionNavigator(FacebookContactCollection contacts, FacebookObjectId guid, Navigator parent) : base(contacts, guid, parent) { _contacts = contacts; }