private void SetPlotExtent() { TemperaturePlotViewModel m = DataContext as TemperaturePlotViewModel; if (m != null) { m.SetPlotExtent(dataPlot.ActualWidth, dataPlot.ActualHeight); } }
public StationViewModel() { _selectedCountry = Settings.Default.SelectedCountry; _selectedStation = _allStations.FirstOrDefault(s => s.Id == Settings.Default.SelectedStationId); _year = Settings.Default.SelectedYear; _tpvModel = new TemperaturePlotViewModel(); if (!String.IsNullOrEmpty(_selectedCountry) && (_selectedStation != null) && _year > 0) { _availableStations = _allStations.Where(s => s.Country == _selectedCountry); int minYear = _selectedStation.MinDate.Year, maxYear = _selectedStation.MaxDate.Year; _availableYears = _allYears.Where(y => y >= minYear && y <= maxYear); ApplyYear(); } else { SelectedCountry = _allCountries.First(); } }