private static void OnMapPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MapNavigator navigation = d as MapNavigator; ESRI.ArcGIS.Client.Map newValue = e.NewValue as ESRI.ArcGIS.Client.Map; ESRI.ArcGIS.Client.Map oldValue = e.OldValue as ESRI.ArcGIS.Client.Map; if (oldValue != null) { oldValue.RotationChanged -= new ESRI.ArcGIS.Client.Map.RotationChangedEventHandler(navigation.Map_RotationChanged); oldValue.ExtentChanged -= new EventHandler <ExtentEventArgs>(navigation.Map_ExtentChanged); oldValue.ExtentChanging -= new EventHandler <ExtentEventArgs>(navigation.Map_ExtentChanging); if (oldValue.Layers != null) { oldValue.Layers.LayersInitialized -= new LayerCollection.LayersInitializedHandler(navigation.Layers_LayersInitialized); } } if (newValue != null) { newValue.RotationChanged += new ESRI.ArcGIS.Client.Map.RotationChangedEventHandler(navigation.Map_RotationChanged); newValue.ExtentChanged += new EventHandler <ExtentEventArgs>(navigation.Map_ExtentChanged); newValue.ExtentChanging += new EventHandler <ExtentEventArgs>(navigation.Map_ExtentChanging); if (newValue.Layers != null) { newValue.Layers.LayersInitialized += new LayerCollection.LayersInitializedHandler(navigation.Layers_LayersInitialized); } if (navigation.TransformRotate != null) { navigation.TransformRotate.Angle = newValue.Rotation; } navigation.SetupZoom(); navigation.InitDrawObject(); navigation.ResetExtentHistory(); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.grid_Content = ((System.Windows.Controls.Grid)(target)); return; case 2: this.MapNavigator = ((SmartScene.View.MapNavigator)(target)); return; } this._contentLoaded = true; }