public InCanvasSearchControl()
        {
            InitializeComponent();

            this.Loaded += (sender, e) =>
            {
                if (workspaceView == null)
                    workspaceView = WpfUtilities.FindUpVisualTree<WorkspaceView>(this.Parent);
                if (dynamoView == null)
                {
                    dynamoView = WpfUtilities.FindUpVisualTree<DynamoView>(this.Parent);
                    if (dynamoView != null)
                        dynamoView.Deactivated += (s, args) => { OnRequestShowInCanvasSearch(ShowHideFlags.Hide); };
                }
            };
        }
Example #2
0
 /// <summary>
 /// Paste nodes at the center of workspace view.
 /// </summary>
 /// <param name="workspace">workspace view</param>
 private void PasteNodeAtTheCenter(WorkspaceView workspace)
 {
     var centerX = (workspace.ActualWidth / 2 - workspace.ViewModel.Model.X) / workspace.ViewModel.Zoom;
     var centerY = (workspace.ActualHeight / 2 - workspace.ViewModel.Model.Y) / workspace.ViewModel.Zoom;
     dynamoViewModel.Model.Paste(new Point2D(centerX, centerY));
 }
Example #3
0
 /// <summary>
 /// Paste nodes at the center of workspace view.
 /// </summary>
 /// <param name="workspace">workspace view</param>
 private void PasteNodeAtTheCenter(WorkspaceView workspace)
 {
     var centerPoint = workspace.GetCenterPoint().AsDynamoType();
     dynamoViewModel.Model.Paste(centerPoint);
 }