public void InitializeForecastTypes(IEnumerable <ForecastType> newForecastTypes) { ForecastTypes.Clear(); ForecastTypes.Add(new EmptyForecastType()); foreach (var newForecastType in newForecastTypes) { ForecastTypes.Add(newForecastType); } }
private void PresenceClickExecute(object obj) { // Cycle through presencetypes // If last is selected, then select first if (SelectedForecastType == null || ForecastTypes.IndexOf(SelectedForecastType) == ForecastTypes.Count - 1) { SelectedForecastType = ForecastTypes.FirstOrDefault(); return; } // Select next in list SelectedForecastType = ForecastTypes[ForecastTypes.IndexOf(SelectedForecastType) + 1]; }
/// <summary> /// To avoid presence type name poping up when direct setter is used /// </summary> public virtual void SilentStatusSetById(int id) { _selectedForecastType = ForecastTypes.SingleOrDefault(x => x.Id == id); OnForecastTypePropertyChanged(); }