private static void OnLayerPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { OverviewMap2 ovmap = d as OverviewMap2; if (ovmap.OVMapImage != null) { ovmap.OVMapImage.Layers.Clear(); if (ovmap.Layer != null) { ovmap.OVMapImage.Layers.Add(ovmap.Layer); } } if (ovmap.Layer != null) { bool isInit = ovmap.Layer.IsInitialized; if (isInit) { ovmap.Layer_LayersInitialized(ovmap.Layer, null); } else { ovmap.Layer.Initialized += ovmap.Layer_LayersInitialized; } } }
private static void OnUseEllipseAOIPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { OverviewMap2 ovmap = d as OverviewMap2; if (ovmap.UseEllipseAOI) { ovmap.MapDisplayEllipse.Visibility = Visibility.Visible; ovmap.MapDisplayBorder.Visibility = Visibility.Collapsed; } else { ovmap.MapDisplayEllipse.Visibility = Visibility.Collapsed; ovmap.MapDisplayBorder.Visibility = Visibility.Visible; } }
private static void OnMapPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { OverviewMap2 ovmap = d as OverviewMap2; Map oldMap = e.OldValue as Map; if (oldMap != null) //clean up { if (ovmap.OVMapImage != null) { ovmap.OVMapImage.Layers.Clear(); } oldMap.ExtentChanged -= ovmap.UpdateOVMap; } Map newMap = e.NewValue as Map; if (newMap != null) { newMap.ExtentChanged += ovmap.UpdateOVMap; if (ovmap.Layer != null && ovmap.OVMapImage != null) { ovmap.OVMapImage.Layers.Add(ovmap.Layer); } } }