public AccuWeather() { if (DesignerProperties.GetIsInDesignMode(new DependencyObject())) { DailyForecasts = new List <DailyForecast>(); for (int i = 0; i < 3; i++) { DailyForecast dailyForecast = new DailyForecast { Date = DateTime.Now.AddDays(-i), Temperature = new Temperature { Maximum = new Maximum { Value = 21 + i }, Minimum = new Minimum { Value = 5 - i } } }; DailyForecasts.Add(dailyForecast); } } }
public WeatherForecast() { if (DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject())) { DailyForecasts = new List <DailyForecast>(); for (int i = 0; i < 3; i++) { DailyForecast dailyForecast = new DailyForecast { Date = DateTime.Now.AddDays(i), Temperature = new Temperature { Maximum = new TemperatureValue { Value = 20 + i }, Minimum = new TemperatureValue { Value = 30 + i } } }; DailyForecasts.Add(dailyForecast); } } }
public AccuWeather() { if (DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject())) // Allows default values to be pased while in Design mode //that will not pass when running progam { DailyForecasts = new List <DailyForecast>(); for (int i = 0; i < 3; i++) { DailyForecast dailyForecast = new DailyForecast { Date = DateTime.Now.AddDays(-i), Temperature = new Temperature { Maximum = new Range { Value = 21 + i }, Minimum = new Range { Value = 5 - i } }, Day = new TimeOfDay { Icon = 0, IconPhrase = "partly sunny" } }; DailyForecasts.Add(dailyForecast); } } }
public AccuWeather() { Headline = new Headline() { EffectiveDate = DateTime.Now.AddDays(1), ForecastText = "Sunny and clear" }; DailyForecastDay1 = new DailyForecast() { MaximumTemperature = "75 °F", MinimumTemperature = "60 °F", DayText = "Sunny", NightText = "Cool and clear", Day = new Day() { IconPhrase = "Sunny" }, Night = new Night() { IconPhrase = "Cool and clear" }, Temperature = new Temperature() { Maximum = new Maximum() { Value = 75, Unit = "F" }, Minimum = new Minimum() { Value = 60, Unit = "F" } } }; }