Self-define Layers

Hi Walter,

I want to create my own layers for myDiagram.panel, and here come with several quesions about self-define layers.
Q1: Should I firstly create new layer class for the layer by using Layer theLayer=new Layer();"L1"; or just give "L1" to node.LayerName without creating new layer.
Q2: I want control Z-Order of each defined layer, let's say, I just created 3 self-define layers - L1,L2 and L3, and I want make L1 on top of L2 and L2 on top of L3. How can make this? I know DiagramPanel has default layers - "Foreground","" and "Background". Does Foreground layer is on top of all self-define layers, and Background is the bottom, but where is "" layer?
Q3: If I want get an IEnumrable of a DiagramPanel, which method should I use?

Q1: No, you need to create each Layer that you might use. If you specify a go:Part.LayerName that does not exist, it uses the Layer with the default name, an empty string.

Q2: The initial set of DiagramPanel.Children is described in the GoXamIntro document or in the documentation for DiagramPanel.InitializeLayers(). You can insert or remove Layers from the DiagramPanel.Children collection as needed. You can even specify the initial set of layers in XAML by customizing the Diagram.Template.

Q3: myDiagram.Panel.Children.OfType()

So, I think I get it now. First, I have to create new layer class, second, need to insert it into myDiagram.Panel.Chidren, and Third, associate the layer with nodes. And I guess first inserted layer is on top the later.

Am I right?
Thanks a lot, Walter!

To be more precise, you want to create an instance of NodeLayer or LinkLayer, as appropriate, and then insert it at the desired Z-order of the myDiagram.Panel.Children.

Your support is very nice, thank you!