/// <summary>
        /// Creates a viewer input mode with a custom additional input mode that
        /// handles cursor changes for  <see cref="IClickHandler"/>s.
        /// </summary>
        private static IInputMode CreateInputMode()
        {
            var gvim = new GraphViewerInputMode {
                SelectableItems = GraphItemTypes.None,
                FocusableItems  = GraphItemTypes.None
            };

            // Add our own input mode that handles cursor changes
            var clickHandlerMode = new ClickHandlerHoverInputMode();

            gvim.Add(clickHandlerMode);

            return(gvim);
        }
예제 #2
0
        private async void GraphSourceWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            // create new input mode
            GraphViewerInputMode inputMode = new GraphViewerInputMode {
                SelectableItems = GraphItemTypes.None
            };

            // add a custom input mode that allows dragging nodes from the graph to the lists
            inputMode.Add(new NodeDragInputMode {
                Priority = -1
            });
            graphControl.InputMode = inputMode;

            graphControl.FocusIndicatorManager.ShowFocusPolicy = ShowFocusPolicy.Always;

            graphSource             = ((AdjacentNodesGraphSource)Application.Current.MainWindow.Resources["GraphSource"]);
            graphSource.NodesSource = CreateInitialBusinessData();

            await ApplyLayout(false);
        }