Node selection on top

I have a diagram with couple of nodes, I want to make sure the selected node is on top. When we select a node the particular node should be on the top.

Solved using isSelected property.

In case anyone else finds this topic, the typical solution is something like this in the node template(s):

new go.Binding("layerName", "isSelected", function(s) { return s ? "Foreground" : ""; }).ofObject()

This is demonstrated in many of the samples.