private void Window_Loaded(object sender, RoutedEventArgs e) { grdMain.Background = DataUtilities.ChooseBackground(); //Randomly select background NameCityDict = CityUtilities.getNameCityDict(); // Get dictionary of City Name to City objects txtCity.Focus(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { grdMain.Background = DataUtilities.ChooseBackground(); //Randomly select background NameCityDict = CityUtilities.getNameCityDict(); //Get dictionary of City Names to City Objects cityCodeDict = CityUtilities.getCityCodeDict(); //Get dictionary of City IDs to City Objects txtCity.Focus(); //Pre load fields with values supplied from loaded forecast object txtCity.Text = cityCodeDict[loadedForecast.CityID].ToString(); lstCities.SelectedItem = cityCodeDict[loadedForecast.CityID]; lstCities.SelectedIndex = 0; dtpDate.SelectedDate = loadedForecast.ForecastDate; sldMin.Value = loadedForecast.MinimumTemp; sldMax.Value = loadedForecast.MaximumTemp; sldWind.Value = loadedForecast.WindSpeed; sldHumidity.Value = loadedForecast.Humidity; sldPrecip.Value = loadedForecast.Precipitation; }