Adds graph axes to a Visualization.Wpf.NodeXLControl.
This control wraps a Visualization.Wpf.NodeXLControl in a Grid that also includes Axis controls for the x- and y-axes.

The axes display default ranges. You should call on each of the XAxis and objects to set the range of values being displayed in the Visualization.Wpf.NodeXLControl.

The Axis controls automatically adjust themselves when the graph is zoomed or translated.

Inheritance: System.Windows.Controls.Grid
        CreateNodeXLControl()
        {
            // AssertValid();

            // Control hierarchy:
            //
            // 1. ehElementHost contains a NodeXLWithAxesControl.
            //
            // 2. The NodeXLWithAxesControl contains a NodeXLControl.

            m_oNodeXLControl = new NodeXLControl();

            m_oNodeXLWithAxesControl = new NodeXLWithAxesControl(m_oNodeXLControl);

            // Don't show the axes now.  If they are supposed to be shown, the
            // Ribbon, which is responsible for maintaining the visibility of the
            // axes, will send a NoParamCommand.ShowGraphAxes command to the
            // TaskPane later.

            m_oNodeXLWithAxesControl.ShowAxes = false;

            m_oNodeXLControl.LayingOutGraph += new System.EventHandler(
                this.oNodeXLControl_LayingOutGraph);

            m_oNodeXLControl.GraphLaidOut += new AsyncCompletedEventHandler(
                this.oNodeXLControl_GraphLaidOut);

            ehNodeXLControlHost.Child = m_oNodeXLWithAxesControl;
        }
Esempio n. 2
0
        CreateNodeXLControl()
        {
            m_oNodeXLWithAxesControl             = new NodeXLWithAxesControl();
            m_oNodeXLWithAxesControl.XAxis.Label = "This is the x-axis";
            m_oNodeXLWithAxesControl.YAxis.Label = "This is the y-axis";
            m_oNodeXLControl = m_oNodeXLWithAxesControl.NodeXLControl;

            m_oNodeXLControl.SelectionChanged +=
                new System.EventHandler(this.m_oNodeXLControl_SelectionChanged);

            m_oNodeXLControl.VertexClick +=
                new Smrf.NodeXL.Core.VertexEventHandler(
                    this.m_oNodeXLControl_VertexClick);

            m_oNodeXLControl.VertexDoubleClick +=
                new Smrf.NodeXL.Core.VertexEventHandler(
                    this.m_oNodeXLControl_VertexDoubleClick);

            m_oNodeXLControl.VertexMouseHover +=
                new Smrf.NodeXL.Core.VertexEventHandler(
                    this.m_oNodeXLControl_VertexMouseHover);

            m_oNodeXLControl.VertexMouseLeave +=
                new EventHandler(this.m_oNodeXLControl_VertexMouseLeave);

            m_oNodeXLControl.VerticesMoved +=
                new Smrf.NodeXL.Visualization.Wpf.VerticesMovedEventHandler(
                    this.m_oNodeXLControl_VerticesMoved);

            m_oNodeXLControl.PreviewVertexToolTipShown +=
                new VertexToolTipShownEventHandler(
                    this.m_oNodeXLControl_PreviewVertexToolTipShown);

            m_oNodeXLControl.GraphMouseDown +=
                new Smrf.NodeXL.Visualization.Wpf.GraphMouseButtonEventHandler(
                    this.m_oNodeXLControl_GraphMouseDown);

            m_oNodeXLControl.GraphMouseUp +=
                new Smrf.NodeXL.Visualization.Wpf.GraphMouseButtonEventHandler(
                    this.m_oNodeXLControl_GraphMouseUp);

            m_oNodeXLControl.GraphZoomChanged +=
                new System.EventHandler(this.m_oNodeXLControl_GraphZoomChanged);

            m_oNodeXLControl.LayingOutGraph +=
                new System.EventHandler(this.m_oNodeXLControl_LayingOutGraph);

            m_oNodeXLControl.GraphLaidOut +=
                new AsyncCompletedEventHandler(this.m_oNodeXLControl_GraphLaidOut);

            ehElementHost.Child = m_oNodeXLWithAxesControl;
        }
Esempio n. 3
0
    CreateNodeXLControl()
    {
        m_oNodeXLWithAxesControl = new NodeXLWithAxesControl();
        m_oNodeXLWithAxesControl.XAxis.Label = "This is the x-axis";
        m_oNodeXLWithAxesControl.YAxis.Label = "This is the y-axis";
        m_oNodeXLControl = m_oNodeXLWithAxesControl.NodeXLControl;

        m_oNodeXLControl.SelectionChanged +=
            new System.EventHandler(this.m_oNodeXLControl_SelectionChanged);

        m_oNodeXLControl.VertexClick +=
            new Smrf.NodeXL.Core.VertexEventHandler(
            this.m_oNodeXLControl_VertexClick);

        m_oNodeXLControl.VertexDoubleClick +=
            new Smrf.NodeXL.Core.VertexEventHandler(
            this.m_oNodeXLControl_VertexDoubleClick);

        m_oNodeXLControl.VertexMouseHover +=
            new Smrf.NodeXL.Core.VertexEventHandler(
            this.m_oNodeXLControl_VertexMouseHover);

        m_oNodeXLControl.VertexMouseLeave +=
            new EventHandler(this.m_oNodeXLControl_VertexMouseLeave);

        m_oNodeXLControl.VerticesMoved +=
            new Smrf.NodeXL.Visualization.Wpf.VerticesMovedEventHandler(
            this.m_oNodeXLControl_VerticesMoved);

        m_oNodeXLControl.PreviewVertexToolTipShown +=
            new VertexToolTipShownEventHandler(
                this.m_oNodeXLControl_PreviewVertexToolTipShown);

        m_oNodeXLControl.GraphMouseDown +=
            new Smrf.NodeXL.Visualization.Wpf.GraphMouseButtonEventHandler(
            this.m_oNodeXLControl_GraphMouseDown);

        m_oNodeXLControl.GraphMouseUp +=
            new Smrf.NodeXL.Visualization.Wpf.GraphMouseButtonEventHandler(
            this.m_oNodeXLControl_GraphMouseUp);

        m_oNodeXLControl.GraphZoomChanged +=
            new System.EventHandler(this.m_oNodeXLControl_GraphZoomChanged);

        m_oNodeXLControl.LayingOutGraph +=
            new System.EventHandler(this.m_oNodeXLControl_LayingOutGraph);

        m_oNodeXLControl.GraphLaidOut +=
            new AsyncCompletedEventHandler(this.m_oNodeXLControl_GraphLaidOut);

        ehElementHost.Child = m_oNodeXLWithAxesControl;
    }
Esempio n. 4
0
    CreateNodeXLControl()
    {
        // AssertValid();

        // Control hierarchy:
        //
        // 1. ehElementHost contains a NodeXLWithAxesControl.
        //
        // 2. The NodeXLWithAxesControl contains a NodeXLControl.

        oNodeXLControl = new NodeXLControl();

        m_oNodeXLWithAxesControl = new NodeXLWithAxesControl(oNodeXLControl);

        // Don't show the axes now.  If they are supposed to be shown, the
        // Ribbon, which is responsible for maintaining the visibility of the
        // axes, will send a NoParamCommand.ShowGraphAxes command to the
        // TaskPane later.

        m_oNodeXLWithAxesControl.ShowAxes = false;

        oNodeXLControl.SelectionChanged +=
            new System.EventHandler(this.oNodeXLControl_SelectionChanged);

        oNodeXLControl.VerticesMoved += new VerticesMovedEventHandler(
            this.oNodeXLControl_VerticesMoved);

        oNodeXLControl.GraphMouseUp += new GraphMouseButtonEventHandler(
            this.oNodeXLControl_GraphMouseUp);

        oNodeXLControl.LayingOutGraph += new System.EventHandler(
            this.oNodeXLControl_LayingOutGraph);

        oNodeXLControl.GraphLaidOut += new AsyncCompletedEventHandler(
            this.oNodeXLControl_GraphLaidOut);

        oNodeXLControl.KeyDown += new System.Windows.Input.KeyEventHandler(
            this.oNodeXLControl_KeyDown);

        ehNodeXLControlHost.Child = m_oNodeXLWithAxesControl;
    }
    TransferToNodeXLWithAxesControl
    (
        NodeXLWithAxesControl nodeXLWithAxesControl
    )
    {
        Debug.Assert(nodeXLWithAxesControl != null);
        AssertValid();

        Font oAxisFont = this.AxisFont;

        nodeXLWithAxesControl.SetFont(
            WpfGraphicsUtil.FontToTypeface(oAxisFont),

            WpfGraphicsUtil.SystemDrawingFontSizeToWpfFontSize(
                oAxisFont.Size) );

        TransferToNodeXLControl(nodeXLWithAxesControl.NodeXLControl);
    }