void PlanetTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { var body = e.NewValue as CelestialObject; if (body == null) { return; } var mapIcon = MapCanvas.Children.OfType <IMapIcon>().Single(icon => icon.Body == body); var childCoords = new Point(mapIcon.X, mapIcon.Y); ZoomControl.ZoomAndCenter(0.25, ZoomControl.ChildToParent(childCoords)); }