private void SetFilmsForSelectedDate(DateTime userSelection) { if (fdViewViewByDate == null) { return; } try { var dataLetter = fdViewViewByDate.GetGroupForDate(userSelection.Date); FilmsForSelectedDate.Clear(); foreach (var entry in dataLetter) { FilmsForSelectedDate.Add(entry); } (semanticZoomShowByDate.ZoomedOutView as ListViewBase).ItemsSource = fdViewViewByDate.GetFilmHeaders(dataLetter); (semanticZoomShowByDate.ZoomedOutView as ListViewBase).UpdateLayout(); GroupInfoList <object> group = dataLetter.Find(g => g.Count > 0); if (group != null) { (this.semanticZoomShowByDate.ZoomedInView as ListViewBase).ScrollIntoView(group); } } catch { } }
private void SetCinemaView(CinemaView newCinemaView) { if (this.currentCinemaView == newCinemaView) { return; } this.currentCinemaView = newCinemaView; if (currentCinemaView == CinemaView.ShowByDate) { this.SetFilmsForSelectedDate((DateTime)this.dpShowing.Value); this.semanticZoomShowByDate.Visibility = Windows.UI.Xaml.Visibility.Visible; this.semanticZoomFilmList.Visibility = Windows.UI.Xaml.Visibility.Collapsed; return; } List <GroupInfoList <object> > filmDataSet = null; switch (this.currentCinemaView) { case CinemaView.Current: filmDataSet = fdViewViewByDate.CurrentFilmGroups; break; case CinemaView.Upcoming: filmDataSet = fdViewViewByDate.UpcomingFilmGroups; break; } this.semanticZoomShowByDate.Visibility = Windows.UI.Xaml.Visibility.Collapsed; this.semanticZoomFilmList.Visibility = Windows.UI.Xaml.Visibility.Visible; if (filmDataSet != null) { FilmsForSelectedDate.Clear(); foreach (var entry in filmDataSet) { FilmsForSelectedDate.Add(entry); } (this.semanticZoomFilmList.ZoomedOutView as ListViewBase).ItemsSource = fdViewViewByDate.GetFilmHeaders(filmDataSet); (this.semanticZoomFilmList.ZoomedOutView as ListViewBase).UpdateLayout(); GroupInfoList <object> group = filmDataSet.Find(g => g.Count > 0); if (group != null) { (this.semanticZoomFilmList.ZoomedInView as ListViewBase).ScrollIntoView(group); } } }
private void SetView(FilmView newCinemaView) { if (this.currentview == newCinemaView) { return; } this.currentview = newCinemaView; List <GroupInfoList <object> > filmDataSet = null; switch (this.currentview) { case FilmView.Current: filmDataSet = filmData.CurrentFilmGroups; break; case FilmView.Upcoming: filmDataSet = filmData.UpcomingFilmGroups; break; } if (filmDataSet != null) { GroupedFilms.Clear(); foreach (var entry in filmDataSet) { GroupedFilms.Add(entry); } (this.semanticZoom.ZoomedOutView as ListViewBase).ItemsSource = filmData.GetFilmHeaders(filmDataSet); (this.semanticZoom.ZoomedInView as ListViewBase).UpdateLayout(); GroupInfoList <object> group = filmDataSet.Find(g => g.Count > 0); if (group != null) { (this.semanticZoom.ZoomedInView as ListViewBase).ScrollIntoView(group); } } }