public static void SendToBack(StarControl newStar) { Canvas.SetZIndex(newStar, -1000); }
private void _model_StarChanged(object sender, StarChangedEventArgs e) { Star starThatChanged = e.StarThatChanged; if (e.Removed) { StarControl starControl = _stars[starThatChanged]; _fadedStars.Add(starControl); _stars.Remove(starThatChanged); starControl.FadeOut(); } else { if(_stars.ContainsKey(starThatChanged)) { StarControl starControl; _stars.TryGetValue(starThatChanged,out starControl); if(starControl == null) { starControl = new StarControl(); BeeStarHelper.SendToBack(starControl); starControl.FadeIn(); _sprites.Add(starControl); _stars[starThatChanged] = starControl; BeeStarHelper.SetCanvasLocation(starControl, starThatChanged.Location.X, starThatChanged.Location.Y); } } } }