コード例 #1
0
        void NodeControl_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            //Logging.Info("NodeControl_PreviewKeyDown");

            if (false)
            {
            }

            else if (Key.Insert == e.Key)
            {
                NodeControl node_control = (NodeControl)sender;

                if (KeyboardTools.IsCTRLDown())
                {
                    object content = new StringNodeContent("Child node");
                    NodeControlAddingByKeyboard.AddChildToNodeControl(node_control, content);
                }
                else
                {
                    NodeControlAddingByKeyboard.AddSiblingToNodeControl(node_control);
                }

                e.Handled = true;
            }
        }
コード例 #2
0
        public StringNodeContentControl(NodeControl node_control, StringNodeContent string_node_content)
        {
            InitializeComponent();

            Focusable = true;

            DataContext = string_node_content.Bindable;

            ExitEditMode();

            MouseDoubleClick += StringNodeContentControl_MouseDoubleClick;
            KeyDown          += StringNodeContentControl_KeyDown;

            TxtEdit.LostFocus      += edit_text_box_LostFocus;
            TxtEdit.PreviewKeyDown += edit_text_box_PreviewKeyDown;

            fader = new BackgroundFader(this);
        }
コード例 #3
0
        public StringNodeContentEditor(NodeControl node_control, StringNodeContent string_node_content)
        {
            InitializeComponent();

            DataContext = string_node_content.Bindable;
        }