Diagram for .NET / About Nevron Diagram for .NET / Porting From Older Versions / Porting from Q4 2007 to Q1 2008

In This Topic
    Porting from Q4 2007 to Q1 2008
    In This Topic
     AJAX Mouse Events

    The following properties of the NDrawingView object were removed:

     

    NDrawingView.AsyncClickEventEnabled

    NDrawingView.AsyncDoubleClickEventEnabled

    NDrawingView.AsyncMouseMoveEventEnabled

    NDrawingView.AsyncMouseUpEventEnabled

    NDrawingView.AsyncMouseDownEventEnabled

     

    The following properties and events of the NDrawingView object were added instead:

     

    NDrawingView.AjaxTools

    NDrawingView.QueryAjaxTools

     

    The former mouse event handling and routing mechanism was replaced by a client side controller architecture. Pairs of client side tool class and server side tool definition class were added for all types of mouse events. To enable a callback mouse event, the corresponding tool definition must be added to the diagram control’s AjaxToolscollection property. Tools must be added to the AjaxTools collection from a handler of the new QueryAjaxTools event. Adding tools from another code point will produce unpredictable results. Here is an example on how to enable the mouse click callback event:

    C#
    Copy Code
    protected void NDrawingView1_QueryAjaxTools(object sender, EventArgs e)
    {
        NDrawingView1.AjaxTools.Add(new NAjaxMouseClickCallbackTool(true));
    }
    
    Visual Basic
    Copy Code
    Protected Sub NDrawingView1_QueryAjaxTools(ByVal sender As Object, ByVal e As EventArgs)
        NDrawingView1.AjaxTools.Add(New NAjaxMouseClickCallbackTool(True))
    End Sub
    

    If no interactive areas are defined, the click callback tool, as initialized above, will cause mouse clicks to be processed for the whole diagram image. To define interactive areas of the control, add interactivity styles to the diagram elements in your Form_Load page method, like this:

    C#
    Copy Code
    myShape.Style.InteractivityStyle = new NInteractivityStyle(true);
    
    Visual Basic
    Copy Code
    myShape.Style.InteractivityStyle = New NInteractivityStyle(True)
    

    To optimize the mouse move event handling the new AsyncMouseOver and AsyncMouseOut events can be used instead of the AsyncMouseMove event.

     

    For more details, see the documentation on NInteractivityStyle and the web examples that are installed on your machine.