public MainWindow() { InitializeComponent(); MainWindow.Current = this; this.Scale = 1; ViewerToolManager.AddTool(new WheelScalingTool()); ViewerToolManager.AddTool(new PanCanvasTool()); ViewerToolManager.SetFrameworkElement(this); }
//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); }
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); }
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, "../"); }