private static void UpdatePartyIndicator(DependencyObject d, DependencyPropertyChangedEventArgs e) { HexCanvas canvas = d as HexCanvas; if (e.OldValue != null) { canvas.Children.Remove(((PartyIndicator)e.OldValue).renderable); } canvas.Children.Add(((PartyIndicator)e.NewValue).renderable); }
private static void UpdateHexagons(DependencyObject d, DependencyPropertyChangedEventArgs e) { HexCanvas canvas = d as HexCanvas; if (e.OldValue != null) { foreach (Hexagon h in ((List <Hexagon>)e.OldValue)) { canvas.Children.Remove(h.Path); } } foreach (Hexagon h in ((List <Hexagon>)e.NewValue)) { canvas.Children.Add(h.Path); } }
private static void PointsOfInterestIndicator(DependencyObject d, DependencyPropertyChangedEventArgs e) { HexCanvas canvas = d as HexCanvas; if (e.OldValue != null) { foreach (KeyValuePair <int, PointOfInterest> p in (Dictionary <int, PointOfInterest>)e.OldValue) { foreach (FrameworkElement f in p.Value.ElementList) { canvas.Children.Remove(f); } } } foreach (KeyValuePair <int, PointOfInterest> p in (Dictionary <int, PointOfInterest>)e.NewValue) { foreach (FrameworkElement f in p.Value.ElementList) { canvas.Children.Add(f); } } }