void MyMapView_Loaded(object sender, RoutedEventArgs e)
        {
            if (Projects == null)
            {
                LoadProjectList();

                // switch to the default project
                if (Projects != null)
                {
                    ProjectLocation loc =
                        Projects.Locations.Find(i => i.Default == true);
                    if (loc != null)
                    {
                        App           app = Application.Current as App;
                        IS3MainWindow mw  = (IS3MainWindow)app.MainWindow;
                        mw.SwitchToMainFrame(loc.DefinitionFile);
                    }
                }
            }

            if (Projects != null)
            {
                Envelope projectExtent = new Envelope(Projects.XMin, Projects.YMin,
                                                      Projects.XMax, Projects.YMax);

                AddProjectsToMap();
                //Map.ZoomTo(ProjectExtent);
            }
        }
        async void MyMapView_MouseDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                _isHitTesting = true;

                Point   screenPoint = e.GetPosition(MyMapView);
                Graphic graphic     = await ProjectGraphicsLayer.HitTestAsync(MyMapView, screenPoint);

                if (graphic != null)
                {
                    string definitionFile = graphic.Attributes["DefinitionFile"] as string;
                    App    app            = Application.Current as App;

                    IS3MainWindow mw = (IS3MainWindow)app.MainWindow;
                    mw.SwitchToMainFrame(definitionFile);
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                _isHitTesting = false;
            }
        }
Beispiel #3
0
        //右键项目,进入项目详情页
        private void ViewMenu_Click(object sender, RoutedEventArgs e)
        {
            string        _projectID = _selectGraphic.Attributes["ID"] as string;
            App           app        = Application.Current as App;
            IS3MainWindow mw         = (IS3MainWindow)app.MainWindow;

            mw.SwitchToMainFrame(_projectID);
        }