private void DynWorkspaceView_OnMouseUp(object sender, MouseButtonEventArgs e) { //Debug.WriteLine("Starting mouse up."); dynWorkspaceViewModel vm = (DataContext as dynWorkspaceViewModel); if (e.ChangedButton == MouseButton.Left) { //MVVM: this is in the bench, should it be here? //beginNameEditClick = false; if (isWindowSelecting) { #region release window selection //DEBUG WINDOW SELECTION // Release the mouse capture and stop tracking it. isWindowSelecting = false; //workBench.ReleaseMouseCapture(); // Hide the drag selection box. selectionBox.Visibility = Visibility.Collapsed; #endregion } } }
private void Id_butt_OnClick(object sender, RoutedEventArgs e) { //get the value of the id field //and trigger the command string id = id_tb.Text; int workspace_index = _vm.CurrentWorkspaceIndex; dynWorkspaceViewModel view_model = _vm.Workspaces[workspace_index]; if (view_model.FindByIdCommand.CanExecute(id)) { view_model.FindByIdCommand.Execute(id); } }
void DynamoView_KeyUp(object sender, KeyEventArgs e) { if (e.Key != Key.Escape) { return; } int workspace_index = _vm.CurrentWorkspaceIndex; dynWorkspaceViewModel view_model = _vm.Workspaces[workspace_index]; view_model.WatchEscapeIsDown = false; }
private void DynWorkspaceView_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { dynWorkspaceViewModel vm = (DataContext as dynWorkspaceViewModel); if (!(DataContext as dynWorkspaceViewModel).IsConnecting) { #region window selection //WorkBench.ClearSelection(); DynamoSelection.Instance.ClearSelection(); //DEBUG WINDOW SELECTION // Capture and track the mouse. isWindowSelecting = true; mouseDownPos = e.GetPosition(WorkBench); //workBench.CaptureMouse(); // Initial placement of the drag selection box. Canvas.SetLeft(selectionBox, mouseDownPos.X); Canvas.SetTop(selectionBox, mouseDownPos.Y); selectionBox.Width = 0; selectionBox.Height = 0; // Make the drag selection box visible. selectionBox.Visibility = Visibility.Visible; #endregion } //if you click on the canvas and you're connecting //then drop the connector, otherwise do nothing if (vm != null) { if (vm.ActiveConnector != null) { vm.IsConnecting = false; vm.ActiveConnector = null; } } //if (editingName && !hoveringEditBox) //{ // DisableEditNameBox(); //} dynSettings.ReturnFocusToSearch(); }
public Watch3DFullscreenViewModel(dynWorkspaceViewModel parentWorkspace) { _parentWorkspace = parentWorkspace; dynSettings.Controller.RunCompleted += new DynamoController.RunCompletedHandler(Watch3DFullscreenViewModel_RunCompleted); }
public Watch3DFullscreenViewModel(dynWorkspaceViewModel parentWorkspace) { _parentWorkspace = parentWorkspace; dynSettings.Controller.RunCompleted += Watch3DFullscreenViewModel_RunCompleted; dynSettings.Controller.RequestsRedraw += Controller_RequestsRedraw; }
public Watch3DFullscreenViewModel(dynWorkspaceViewModel parentWorkspace) { ParentWorkspace = parentWorkspace; }