private LiveContactsCollection GetAllContacts(LiveOperatingEnvironment liveOperatingEnvironment) { if (liveOperatingEnvironment != null) { if (!liveOperatingEnvironment.Contacts.IsLoaded) { liveOperatingEnvironment.Contacts.Load(); } LiveContactsCollection contacts = new LiveContactsCollection(liveOperatingEnvironment.Contacts.Entries); return(contacts); } return(new LiveContactsCollection()); }
void mainWindowViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "LiveOperatingEnvironment") { this.liveOperatingEnvironment = mainWindowViewModel.LiveOperatingEnvironment; this.liveContacts = GetAllContacts(this.liveOperatingEnvironment); OnPropertyChanged("LiveContacts"); OnPropertyChanged("ChatDisclaimerVisibility"); } if (e.PropertyName == "LibraryItems") { this.libraryItems = mainWindowViewModel.LibraryItems; GetImageLibraryItems(); GetXpsLibraryItems(); OnPropertyChanged("ImageLibraryItems"); OnPropertyChanged("XpsLibraryItems"); } }