using System.Windows.Controls; using System.Windows.Data; using MahTweets.Mobile.Core; using MahTweets.Mobile.TwitterPlugin.ViewModels; namespace MahTweets.Mobile.TwitterPlugin.Views { public partial class ProfileView { public ProfileView() { InitializeComponent(); } protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); var UpdatesCollectionView = Resources["UpdatesCollectionView"] as CollectionViewSource; UpdatesCollectionView.Source = ((ProfileViewModel)ViewModel).Updates; } private AbstractStatusUpdate _oldSelection; private void LbEverythingSelectionChanged(object sender, SelectionChangedEventArgs e) { if (!(lbEverything.SelectedItem is AbstractStatusUpdate)) return; var update = (AbstractStatusUpdate)lbEverything.SelectedItem; update.IsSelected = update.IsSelected != true; if (update != _oldSelection && _oldSelection != null) { _oldSelection.IsSelected = false; } _oldSelection = update; } } }