コード例 #1
0
        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); };
                }
            };
        }
コード例 #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));
 }
コード例 #3
0
ファイル: DynamoView.xaml.cs プロジェクト: DynamoDS/Dynamo
 /// <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);
 }