Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Diagram Shape determined by object
posted

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

Parents
No Data
Reply
  • 1935
    Verified Answer
    posted

    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.

    XamDiagram_ViewModel_ShapeType.zip
Children