private static Grid TransformMoon(Grid scene, DayDataPoint dayDataPoint) { var moonContainer = (Grid)scene.FindName("MoonContainer"); if (moonContainer == null) { return(scene); } moonContainer = Icons.CreateMoon(dayDataPoint.MoonPhase, s_compositor, Color.FromArgb(255, 192, 57, 43)); return(scene); }
private static Canvas CreateRainyScene() { var container = new Canvas(); var rand = new Random(); for (int i = 0; i < 35; i++) { var x = rand.Next(0, (int)_screenSize.Width); var duration = rand.Next(3, 8); var delay = rand.Next(0, 10); var line = Icons.CreateLine(x, duration, delay, _screenSize); container.Children.Add(line); } return(container); }
private static Canvas CreateSnowScene() { var container = new Canvas(); var rand = new Random(); for (int i = 0; i < 20; i++) { var x = rand.Next(0, (int)_screenSize.Width); var size = rand.Next(4, 20); var duration = rand.Next(10, 20); var delay = rand.Next(0, 10); var snow = Icons.CreateSnowBall(x, size, duration, delay, _screenSize); container.Children.Add(snow); } return(container); }
private static Canvas CreateStarsScene(int starsNumber = 35) { var container = new Canvas(); var rand = new Random(); var x = (int)_screenSize.Width; for (int i = 0; i < starsNumber; i++) { var coord = new Vector2(rand.Next(-x, x), rand.Next(0, 400)); var duration = rand.Next(10, 20); var radius = rand.Next(1, 7); var star = Icons.CreateStar(duration, coord, radius); container.Children.Add(star); } return(container); }
public static Grid CreateNew(Forecast forecast, bool isPremiumUser, bool deactivateBackgroundColorAnimation = false) { CurrentDataPoint currentForecast = forecast.Currently; DayDataPoint todayForecast = forecast.Daily.Days[0]; InitializeVariables(todayForecast); var scene = new Grid(); scene = Backgrounds.PaintBackground(scene, currentForecast, todayForecast); if (!deactivateBackgroundColorAnimation) { scene = Backgrounds.AnimateBackgroundColor(scene, currentForecast.Icon, _screenSize); } scene = AddAnimations(scene, currentForecast.Icon); scene = Icons.AddWeatherIconCondition(scene, forecast, _IsDay, isPremiumUser); //scene = isPremiumUser ? AddSpecialEvents(scene, forecast) : scene; return(scene); }