public override void Load() { string[] favorites = Settings.PeopleFavorites; contactsListBox.Items.Clear(); if (favorites == null || favorites.Length == 0) { message.Visibility = Visibility.Visible; return; } contactsListBox.Visibility = Visibility.Visible; message.Visibility = Visibility.Hidden; foreach (string each in favorites) { Contact c = ContactDatabase.GetContact(each); if (c != null) { PeopleView.SmartInsert(contactsListBox, c); } } // // BUG FIX: Since a contact is not placed in database until it is saved, // a contact marked as "Favorite" would be inaccessible. // if (!contactsListBox.HasItems) { contactsListBox.Visibility = Visibility.Hidden; message.Visibility = Visibility.Visible; FrictionScrollViewerControl scrollViewer = (FrictionScrollViewerControl)contactsListBox.Template.FindName("_tv_scrollviewer_", contactsListBox); scrollViewer.LayoutVerticalScrollBar(); scrollViewer.LayoutHorizontalScrollBar(); } }