I have a number of objects in a view model that I'm passing to the ItemsSource of my XamDiagram. I'd like to have the Shape value determined by something in the object before the diagram is rendered. For example, if my object contains two fields (Name and Type, both strings), how can I set the Shape type to be a Rectangle if the Type=="A", but a Circle if the Type=="B"?
Thank you.
Scott
Hello Scott Seitz,
What you could do is to add a NodeDefinition's NodeStyle and bind the DiagramNode's ShapeType property to your custom view model's Type property. In addition, you need to create a converter class that converts the Type value to ShapeType value as per your custom logic.
Please take a look at the attached sample and let me now if you have any other questions on this matter.
Perfect - thank you. I was close, but I didn't include the Relative Source={Relative Source Self}. Thanks for the quick response.