Beispiel #1
0
        public HomeViewModel()
        {
            CurrentCity = HomeModel.GetCity();
            CurrentDate = DateTime.Now.DayOfWeek.ToString() + " " + DateTime.Now.Day.ToString() + " " + DateTime.Now.Month.ToString() + " " + DateTime.Now.Year.ToString();
            var tuple = HomeModel.GetWhether(CurrentCity);

            CurrentDiscription  = tuple.Item2;
            CurrentWeatherImage = tuple.Item3;
            WeatherNumber       = tuple.Item4 + "°C";

            Random rndm = new Random();

            int day;

            if (DateTime.Now.Day > 20)
            {
                day = DateTime.Now.Day - 20;
            }
            else
            {
                day = DateTime.Now.Day;
            }

            Element element = HomeModel.GetElement(day);

            if (element != null)
            {
                PlantImage = element.SideImage;
                PlantName  = element.Name;
                PlantType  = element.Type;
                PlantCost  = element.Cost + "$";
                PlantInfo  = element.Info;
            }
        }