Ejemplo n.º 1
0
        private void DataLoadedFromInternet(City result)
        {
            AppState state = null;
            if (result == null)
                MessageBox.Show(Utils.GetMessage(Error.NoServerAvailable));
            else
                state = new AppState() { City = result, Date = SettingsManager.CurrentDate, TheaterCode = SettingsManager.TheaterCode };

            ShowData(state);
        }
Ejemplo n.º 2
0
        private void ShowData(AppState state)
        {
            if (state == null)
            {
                NoDataLoaded();
                return;
            }

            AppState.Current = state;
            var theater = AppState.Current.City.Theaters.Where(x => x.Code == AppState.Current.TheaterCode).SingleOrDefault();

            pvtTheaters.Title = string.Format("{0} ({1})", AppState.Current.City.Name, Utils.GetLongDate(AppState.Current.Date));
            //TODO: Check if this doe not trigger a selection change event
            //DataContext = null;
            pvtTheaters.SelectedIndex = 0;
            DataContext = AppState.Current.City.Theaters;
            if (theater != null)
                pvtTheaters.SelectedItem = theater;

            if (AppState.Current.Date == DateTime.Today)
                sldFromTime.Value = (DateTime.Now - AppState.Current.Date).TotalMinutes - _startTime.TotalMinutes;
            else
                sldFromTime.Value = 0;

            RefreshShows();
        }