/// <summary> /// Event handler for the NodeDoubleClickEvent /// </summary> /// <param name="args">Arguments for the event</param> public void NodeDoubleClickEventHandler(NodeViewModelMouseEventArgs <System.Windows.Input.MouseButtonEventArgs> args) { if (NodeDoubleClicked != null) { NodeDoubleClicked(this, ScriptableNodeEventArgs.Create(args)); } }
/// <summary> /// Event handler for the NodeMouseLeaveEvent /// </summary> /// <param name="args">Arguments for the event</param> public void NodeMouseLeaveEventHandler(NodeViewModelMouseEventArgs <System.Windows.Input.MouseEventArgs> args) { if (NodeMouseLeave != null) { NodeMouseLeave(this, ScriptableNodeEventArgs.Create(args)); } }
/// <summary> /// Handles the MouseLeftButtonDown event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseLeftButtonDownEventHandler(NodeViewModelMouseEventArgs <MouseButtonEventArgs> args) { // Turn on node dragging if we are in node selection mode if (!isPanMode) { isLeftButtonDown = true; dragTargetNode = args.NodeViewModel; isMouseDownHandled = true; } }
/// <summary> /// Handles the NodeMouseEnter event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseEnterEventHandler(NodeViewModelMouseEventArgs <MouseEventArgs> args) { // Positioning of the popup (the horizontal and vertical offsets) are // handled by a Behavior on the view. if (args.NodeViewModel.ParentNode != null && args.NodeViewModel.ParentNode.Attributes != null) { Show(args.NodeViewModel.ParentNode.Attributes.Select((record) => new KeyValuePair <string, string>(record.Key, record.Value.DisplayValue))); } else { Show(null); } }
/// <summary> /// Handles the MouseRightButtonDown event for the Node /// </summary> /// <param name="args">Arguments for the event</param> public void NodeMouseRightButtonDownEventHandler(NodeViewModelMouseEventArgs <MouseButtonEventArgs> args) { // Ensure that the context menu has not already been initialized if (nodeContextMenu == null) { nodeContextMenu = new ContextMenu(); nodeContextMenu.ItemsSource = nodeMenuItems; nodeContextMenu.Opening += new RoutedEventHandler(NodeContextMenuOpeningHandler); nodeContextMenu.Closed += new RoutedEventHandler(NodeContextMenuClosedHandler); } // Save the NodeViewModel that the right click was on targetNodeVM = args.NodeViewModel; // Open the Node's ContextMenu nodeContextMenu.OpenPopup(args.MouseArgs.GetPosition(null)); }
/// <summary> /// Handles the NodeMouseMoveEvent /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseMoveEventHandler(NodeViewModelMouseEventArgs <MouseEventArgs> args) { // If the left mouse button is down while the mouse is being moved // we can assume the user is dragging the node and shouldn't show // the attribute popup if (this.mouseLeftButtonDown) { if (IsOpen) { IsOpen = false; } else { this.openTimer.Stop(); } } }
/// <summary> /// Event handler for the NodeDoubleClickEvent /// </summary> /// <param name="args">Arguments for the event</param> public void NodeDoubleClickEventHandler(NodeViewModelMouseEventArgs<System.Windows.Input.MouseButtonEventArgs> args) { if (NodeDoubleClicked != null) { NodeDoubleClicked(this, ScriptableNodeEventArgs.Create(args)); } }
/// <summary> /// Handles the MouseRightButtonDown event for the Node /// </summary> /// <param name="args">Arguments for the event</param> public void NodeMouseRightButtonDownEventHandler(NodeViewModelMouseEventArgs<MouseButtonEventArgs> args) { // Ensure that the context menu has not already been initialized if (nodeContextMenu == null) { nodeContextMenu = new ContextMenu(); nodeContextMenu.ItemsSource = nodeMenuItems; nodeContextMenu.Opening += new RoutedEventHandler(NodeContextMenuOpeningHandler); nodeContextMenu.Closed += new RoutedEventHandler(NodeContextMenuClosedHandler); } // Save the NodeViewModel that the right click was on targetNodeVM = args.NodeViewModel; // Open the Node's ContextMenu nodeContextMenu.OpenPopup(args.MouseArgs.GetPosition(null)); }
public void OnNodeMouseMove(NodeViewModelMouseEventArgs <MouseEventArgs> eventArgs) { Events.Add(string.Format("NodeMoved - {0}", eventArgs.NodeViewModel.ParentNode.ID)); }
public void OnNodeMouseLeftButtonDown(NodeViewModelMouseEventArgs <MouseButtonEventArgs> eventArgs) { Events.Add(string.Format("NodeMouseLeftButtonDown - {0}", eventArgs.NodeViewModel.ParentNode.ID)); }
public void OnNodeMouseMove(NodeViewModelMouseEventArgs<MouseEventArgs> eventArgs) { Events.Add(string.Format("NodeMoved - {0}", eventArgs.NodeViewModel.ParentNode.ID)); }
/// <summary> /// Handles the NodeMouseLeftButtonUp event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseLeftButtonUpEventHandler(NodeViewModelMouseEventArgs <MouseButtonEventArgs> args) { // Update the flag that indicates the state of the left // mouse button on the node this.mouseLeftButtonDown = false; }
/// <summary> /// Event handler to handle when a node is clicked /// </summary> /// <param name="eventArgs">Any event arguments that might be passed</param> public void OnNodeMouseLeftButtonUp(NodeViewModelMouseEventArgs<MouseButtonEventArgs> eventArgs) { Events.Add(string.Format("NodeMouseLeftButtonUp - {0}", eventArgs.NodeViewModel.ParentNode.ID)); }
/// <summary> /// Handles the NodeDoubleClick event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeDoubleClickEventHandler(NodeViewModelMouseEventArgs<MouseButtonEventArgs> args) { CollapseOrExpandNode(args.NodeViewModel); }
/// <summary> /// Handles the NodeMouseLeftButtonUp event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseLeftButtonUpEventHandler(NodeViewModelMouseEventArgs<MouseButtonEventArgs> args) { // Update the flag that indicates the state of the left // mouse button on the node this.mouseLeftButtonDown = false; }
/// <summary> /// Handles the NodeMouseLeave event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseLeaveEventHandler(NodeViewModelMouseEventArgs<MouseEventArgs> args) { Close(); }
/// <summary> /// Handles the NodeMouseEnter event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseEnterEventHandler(NodeViewModelMouseEventArgs<MouseEventArgs> args) { // Positioning of the popup (the horizontal and vertical offsets) are // handled by a Behavior on the view. if (args.NodeViewModel.ParentNode != null && args.NodeViewModel.ParentNode.Attributes != null) { Show(args.NodeViewModel.ParentNode.Attributes.Select((record) => new KeyValuePair<string, string>(record.Key, record.Value.DisplayValue))); } else { Show(null); } }
/// <summary> /// Raises the NodeMouseMove event /// </summary> /// <param name="e">The event arguments</param> protected virtual void OnNodeMouseMove(NodeViewModelMouseEventArgs <MouseEventArgs> args) { this.eventAggregator.GetEvent <NodeMouseMoveEvent>().Publish(args); }
/// <summary> /// Event handler for the NodeMouseLeaveEvent /// </summary> /// <param name="args">Arguments for the event</param> public void NodeMouseLeaveEventHandler(NodeViewModelMouseEventArgs<System.Windows.Input.MouseEventArgs> args) { if (NodeMouseLeave != null) { NodeMouseLeave(this, ScriptableNodeEventArgs.Create(args)); } }
/// <summary> /// Raises the NodeMouseMove event /// </summary> /// <param name="e">The event arguments</param> protected virtual void OnNodeMouseMove(NodeViewModelMouseEventArgs<MouseEventArgs> args) { this.eventAggregator.GetEvent<NodeMouseMoveEvent>().Publish(args); }
/// <summary> /// Handles the NodeDoubleClick event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeDoubleClickEventHandler(NodeViewModelMouseEventArgs <MouseButtonEventArgs> args) { CollapseOrExpandNode(args.NodeViewModel); }
/// <summary> /// Handles the MouseLeftButtonUp event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseLeftButtonUpEventHandler(NodeViewModelMouseEventArgs <MouseButtonEventArgs> args) { // Only allow node manipulation if we are not in pan mode if (!isPanMode) { NodeSelector nodeSelector = GraphManager.Instance.DefaultGraphComponentsInstance.NodeSelector; // Check if we were dragging the node if (isNodeDragging) { // Turn off node dragging isNodeDragging = false; dragTargetNode = null; } else { // Check if any nodes are currently selected if (nodeSelector.AreAnyNodesSelected) { // Check if Control is pressed if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0) { nodeSelector.InvertSelection(); } else { // Check if multiple nodes are selected if (nodeSelector.AreMultipleNodesSelected) { // Check if target node is already selected if (nodeSelector.SelectedNodes.Contains(args.NodeViewModel)) { // Check if Control is pressed if ((Keyboard.Modifiers & ModifierKeys.Control) > 0) { nodeSelector.Unselect(args.NodeViewModel); return; } else { nodeSelector.UnselectAll(); } } else // Target node is not selected { // Check if Control is pressed if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) { nodeSelector.UnselectAll(); } } } else // Only one node is selected { // Check if the target node is already selected if (nodeSelector.SelectedNode.Equals(args.NodeViewModel)) { nodeSelector.Unselect(nodeSelector.SelectedNode); return; } else // Target node is not selected { // Check if Control is pressed if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) { nodeSelector.Unselect(nodeSelector.SelectedNode); } } } } } // Set the SELECTED state of the clicked node nodeSelector.Select(args.NodeViewModel); } } }
/// <summary> /// Handles the NodeMouseMoveEvent /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseMoveEventHandler(NodeViewModelMouseEventArgs<MouseEventArgs> args) { // If the left mouse button is down while the mouse is being moved // we can assume the user is dragging the node and shouldn't show // the attribute popup if (this.mouseLeftButtonDown) if (IsOpen) IsOpen = false; else this.openTimer.Stop(); }
/// <summary> /// Handles the NodeMouseLeave event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseLeaveEventHandler(NodeViewModelMouseEventArgs <MouseEventArgs> args) { Close(); }