private void SetPeriod(WxPeriod period) { var periods = period.Period.Replace(" to ", "|").Split('|'); var fromTime = ToTimeString(periods[0].Trim()); var toTime = ToTimeString(periods[1].Trim()); Period = string.Format("{0}-{1}", fromTime, toTime); }
public WeatherPeriodViewModel(WxPeriod period) { var weatherCode = WeatherCodes.Instance.TryFind(period.Weather); Icon = weatherCode.Icon; Weather = weatherCode.Description .Replace("(day)", string.Empty) .Replace("(night)", string.Empty); Probability = period.Probability; SetPeriod(period); }