Hi
I want to be able to determine whether a shape added to the diagram is going to have resizing constraints (so that the thumbs are not visible). This can be based on the Key property of the NodeViewModel. The problem that I have is that when I disable resizing for the selector like this (I put it in the constructor of the page containing the diagram):
var selector = (Diagram.SelectedItems as SelectorViewModel);
selector.SelectorConstraints = selector.SelectorConstraints & ~SelectorConstraints.Resizer;
The setting is applied to all nodes in the diagram. When I try to do it per node before the node is added to the diagram, resizing is not allowed, but the thumbs are still visible. Here is how I achieved it:
ObservableCollection<NodeViewModel> nodes = new ObservableCollection<NodeViewModel>();
NodeViewModel node = new NodeViewModel()
{
Constraints = NodeConstraints.Default & ~NodeConstraints.Resizable,
UnitWidth = 50,
UnitHeight = 50,
OffsetX = 100,
OffsetY = 100,
Shape = new RectangleGeometry() { Rect = new Rect(0, 0, 10, 10) },
ShapeStyle = Resources["shapeStyle"] as Style
};
nodes.Add(node);
Diagram.Nodes = nodes;
And when I tried applying the constraints after the node is added to the diagram in the ItemAdded event handler, the constraints have no effect of the node, even though I can see the Constraints property has changed.
Can you advise what the right approach is in order to achieve node-level control so that the resizing thumbs are not visible?