Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            MainWindow.Current = this;

            this.Scale = 1;
            ViewerToolManager.AddTool(new WheelScalingTool());
            ViewerToolManager.AddTool(new PanCanvasTool());
            ViewerToolManager.SetFrameworkElement(this);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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, "../");
        }