UI Automation for Node template

I am using a DataTemplateDictionary with 2 DataTemplate for showing Default & Shadow Nodes.
Now in UISpy I can see Default nodes but not ShadowNodes. I found out the reason go:Part.LayerName is
set to “Bacnkground” for shadowNodes (as it has be in background for any overlapping of nodes) . If i
change it to “Foreground” (Like the Default node template) I can see shadow nodes, but I can’t do it as shdown node should be in background.

Now can any one help me to see DataTemplate with go:Part.LayerName = Foreground in UISpy?
ShadowNode template looks like

 <DataTemplate x:Key="ShadowNodeTemplate">
                <aut:AutomationGridPanel   AutomationIdPrefix="ShadowNode"
                   go:Part.SelectionAdorned="False" Margin="0"                                           
                   go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"
                   Height="{Binding Data.Height}"  Width="{Binding Data.Width}">
                            <BlurEffect Radius="8"/>
                <TextBlock x:Name="image"  
                                   AutomationProperties.HelpText="{Binding Path=Data.DisplayName}"
                                   Background="{Binding Path=Data.NodeImageBrush}"
                                   AutomationProperties.Name="{Binding Path=Data.MediaId}">
                                <BlurEffect Radius="8"/>                                

Are you saying that the user cannot see nodes that are in the “Background” NodesLayer?

Or are you saying that you the developer cannot see the nodes in UISpy?

Developer can’t see the nodes using UISpy which are placed in background.

One more info , it will happen if nodes are present in 2 different layer , like foreground & background or default or background.

Can you please show me where I can get GoXam source code ? (I am having a goxam license )

Also can I create my custome layer inherited from NodeLayer & inject into DiagramControl?

Sorry, I forgot to come back and answer the second part of your post.

You can add a Layer programmatically by creating a new NodeLayer() and calling myDiagram.Panel.Children.Insert(…). Of course you can also remove or re-order them by manipulating that UIElementCollection.

However I do not see any reason why you would want to subclass NodeLayer or LinkLayer. The layer classes were not designed to be subclassed – they define no virtual or protected members.