예제 #1
0
        public override void EnterToolHandler()
        {
            base.EnterToolHandler();

            ViewerToolManager.AddTool(new SelectNodeTool());
            ViewerToolManager.AddTool(new EditNodeTool());
        }
예제 #2
0
        public static Geometry.Vector?point(string tip)
        {
            PickPointTool pp = new PickPointTool();

            ViewerToolManager.AddTool(pp);
            CursorTipTool ct = new CursorTipTool(tip);

            ViewerToolManager.AddTool(ct);
            MapControl.Current.Cursor = System.Windows.Input.Cursors.Cross;

            while (true)
            {
                Dreambuild.Gis.Desktop.App.DoEvents();
                if (pp.Picked)
                {
                    break;
                }
            }

            ViewerToolManager.RemoveTool(ct);
            //MainWindow.Current.InitializeTool();
            ViewerToolManager.RemoveTool(pp);
            MapControl.Current.Cursor = System.Windows.Input.Cursors.Arrow;
            return(pp.Point);
        }
예제 #3
0
        public MainWindow()
        {
            InitializeComponent();

            MainWindow.Current = this;

            this.Scale = 1;
            ViewerToolManager.AddTool(new WheelScalingTool());
            ViewerToolManager.AddTool(new PanCanvasTool());
            ViewerToolManager.SetFrameworkElement(this);
        }
예제 #4
0
        //public Viewbox viewbox1 = new Viewbox();
        //public ScrollViewer scrollViewer1 = new ScrollViewer { HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, BorderThickness = new Thickness(0) };
        //public Canvas MyCanvas = new Canvas();

        public MainPage()
        {
            InitializeComponent();

            Current = this;

            //Zoom(false);
            Scale = 1;
            ViewerToolManager.AddTool(new WheelScalingTool());
            ViewerToolManager.AddTool(new PanCanvasTool());
            ViewerToolManager.SetFrameworkElement(this);
        }
예제 #5
0
        private void InitializeTool()
        {
            var toggleButtons = this.Toolbar.Children
                                .Cast <UIElement>()
                                .Where(button => button is ToggleButton)
                                .Cast <ToggleButton>()
                                .ToArray();

            toggleButtons.ForEach(toggleButton => toggleButton.Click += (sender, e) =>
            {
                toggleButtons.ForEach(other => other.IsChecked = false);
                (sender as ToggleButton).IsChecked             = true;
            });

            this.Scale = 1;
            ViewerToolManager.AddTool(new WheelScalingTool());
            ViewerToolManager.ExclusiveTool = new PanCanvasTool();
            ViewerToolManager.SetFrameworkElement(this);
        }
예제 #6
0
        public MainPage()
        {
            InitializeComponent();

            Current = this;

            _radioButtons = new Button[] { btnAddConnection, btnEditConnection, btnAddNode, btnMoveNode, btnSubmit, btnPan, btnSubmit1 };
            SetButtonsHover();
            SetRadioButton(btnPan);

            Scale = 1;
            ViewerToolManager.AddTool(new WheelScalingTool());
            ViewerToolManager.ExclusiveTool = new PanCanvasTool();
            ViewerToolManager.SetFrameworkElement(this);

            AddGriddingToCanvas();
            MouseMove += new MouseEventHandler(MainPage_MouseMove);

            SiteBaseUri = new Uri(Application.Current.Host.Source, "../");
        }
예제 #7
0
        public static Extents extents(string tip)
        {
            PickExtentsTool pe = new PickExtentsTool();

            ViewerToolManager.AddTool(pe);
            CursorTipTool ct = new CursorTipTool(tip);

            ViewerToolManager.AddTool(ct);
            MapControl.Current.Cursor = System.Windows.Input.Cursors.Cross;

            while (true)
            {
                Dreambuild.Gis.Desktop.App.DoEvents();
                if (pe.Picked)
                {
                    break;
                }
            }

            ViewerToolManager.RemoveTool(ct);
            ViewerToolManager.RemoveTool(pe);
            MapControl.Current.Cursor = System.Windows.Input.Cursors.Arrow;
            return(pe.Extents);
        }