Beispiel #1
0
        private void OnAppMapChanged(MapChangedEventArgs args)
        {
            if (args.OldValue != null)
            {
                // Unsubscribe events from old map
                args.OldValue.Layers.LayerSelected -= Layers_LayerSelected;
                if (args.OldValue is Map)
                {
                    ((Map)args.OldValue).ViewExtentsChanged -= MapFrame_ViewExtentsChanged;
                }
            }

            if (args.NewValue != null)
            {
                args.NewValue.Layers.LayerSelected += Layers_LayerSelected;
                if (args.NewValue is Map)
                {
                    ((Map)args.NewValue).ViewExtentsChanged += MapFrame_ViewExtentsChanged;
                }
            }
        }
Beispiel #2
0
        private void OnAppMapChanged(MapChangedEventArgs args)
        {
            if (args.OldValue != null)
            {
                // Unsubscribe events from old map
                args.OldValue.Layers.LayerSelected -= LayersLayerSelected;
                var map = args.OldValue as Map;
                if (map != null)
                {
                    map.ViewExtentsChanged -= MapFrameViewExtentsChanged;
                }
            }

            if (args.NewValue != null)
            {
                args.NewValue.Layers.LayerSelected += LayersLayerSelected;
                var map = args.NewValue as Map;
                if (map != null)
                {
                    map.ViewExtentsChanged += MapFrameViewExtentsChanged;
                }
            }
        }