ZIndex problem with MarkerElementPointGraph

Aug 25, 2011 at 11:02 AM

Hi all,

I had a problem while changing ZIndex value in a MarkerElementPointGraph -> It changes, but the visual appearance is the same.

After some debugging, I found that the problem is that this Marker "Element" Point Graph is using a grid to create the items (elements), and adds this auxiliary grid to the main Plotter. Thus, their ZIndex value is not changed when the MarkerElementPointGraph is changed.

To solve this, you should modify ViewportElement2D.cs:

// change (at line 73):
public int ZIndex

// into:
public virtual int ZIndex


Create this override in MarkerElementPointGraph.cs:


public override int ZIndex
        return this.grid != null ? Panel.GetZIndex(this.grid) : base.ZIndex;
        base.ZIndex = value;
        if (this.grid != null)
            Panel.SetZIndex(this.grid, value);

And finally, set the initial ZIndex value when creating the Grid, in MarkerElementPointGraph.cs:

protected override void OnPlotterAttached(Plotter plotter)
    < existing code >
    .... Add this to the bottom ....
    Panel.SetZIndex(grid, base.ZIndex);

I will send a patch and update this post later


Aug 25, 2011 at 11:50 AM

I created the workitem and submitted a patch (http://dynamicdatadisplay.codeplex.com/workitem/16457), just in case someone needs it.