void mapCenter_MapSelectedForOpening(object sender, MapCenter.MapEventArgs e)
 {
     if (e != null && e.Map != null)
     {
         mapXaml = MapCenter.GetMapXaml(e);
         btnOk.IsEnabled = true;
     }
     BuilderApplication.Instance.HideWindow(mapCenter);
 }
        private static void OnInitialVisibilityPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MapCenter  mapCenter  = d as MapCenter;
            Visibility visibility = (Visibility)e.NewValue;

            if (visibility == Visibility.Visible)
            {
                mapCenter.ShowBackStage(true);
            }
        }
		public override void Execute(object parameter)
		{
            //always start with new map center to reflect changes to urls ( arcgis online, proxy, geometry service)
            View view = View.Instance;
            mapCenter = new MapCenter();
            mapCenter.Height = view.ActualHeight - 100;
            mapCenter.Width = view.ActualWidth - 100;
            mapCenter.InitialVisibility = System.Windows.Visibility.Visible;
            mapCenter.MapSelectedForOpening += mapCenter_MapSelectedForOpening;
            
            ESRI.ArcGIS.Client.Extensibility.MapApplication.Current.ShowWindow(Resources.Strings.OpenWebMapFromArcGISCom,
                mapCenter);
		}
        public override void Execute(object parameter)
        {
            //always start with new map center to reflect changes to urls ( arcgis online, proxy, geometry service)
            View view = View.Instance;

            mapCenter                        = new MapCenter();
            mapCenter.Height                 = view.ActualHeight - 100;
            mapCenter.Width                  = view.ActualWidth - 100;
            mapCenter.InitialVisibility      = System.Windows.Visibility.Visible;
            mapCenter.MapSelectedForOpening += mapCenter_MapSelectedForOpening;

            ESRI.ArcGIS.Client.Extensibility.MapApplication.Current.ShowWindow(Resources.Strings.OpenWebMapFromArcGISCom,
                                                                               mapCenter);
        }
        private void BrowseWebMap_Click(object sender, RoutedEventArgs e)
        {
            if (mapCenter == null)
            {
                View view = View.Instance;
                mapCenter = new MapCenter();
                mapCenter.Height = Application.Current.RootVisual.RenderSize.Height - 100;
                mapCenter.Width = Application.Current.RootVisual.RenderSize.Width - 100;
                mapCenter.InitialVisibility = System.Windows.Visibility.Visible;
                mapCenter.MapSelectedForOpening += new EventHandler<MapCenter.MapEventArgs>(mapCenter_MapSelectedForOpening);
            }

            BuilderApplication.Instance.ShowWindow(ESRI.ArcGIS.Mapping.Builder.Resources.Strings.OpenWebMapFromArcGISCom,
                mapCenter);            
        }
        void SearchControl_NoteSelectedForAdd(object sender, ESRI.ArcGIS.Mapping.Controls.ArcGISOnline.NoteEventArgs e)
        {
            GraphicsLayer noteLayer = MapCenter.AddToMap(e.Name, e.Graphic, Map);

            if (MapContentLayerConfigurationHost != null)
            {
                ShowMapContents();

                // unselect all other layers
                foreach (Layer layer in Map.Layers)
                {
                    LayerExtensions.SetIsSelected(layer, false);
                }

                // select the note layer
                if (noteLayer != null)
                {
                    LayerExtensions.SetIsSelected(noteLayer, true);
                }

                MapContentLayerConfigurationHost.RefreshMapBindings();
            }
        }
 void mapCenter_MapSelectedForOpening(object sender, MapCenter.MapEventArgs e)
 {
     MapCenter.OpenMap(e);
     ESRI.ArcGIS.Client.Extensibility.MapApplication.Current.HideWindow(mapCenter);
 }
 void mapCenter_MapSelectedForOpening(object sender, MapCenter.MapEventArgs e)
 {
     MapCenter.OpenMap(e);
     ESRI.ArcGIS.Client.Extensibility.MapApplication.Current.HideWindow(mapCenter);
 }