This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Sir I want to set the stroke of DiamgramShapes.Rectangle to Red, while keep the stroke of other DiagramShapes the default value. Are there some easy way to do this. Thank you very much!! Andrew |
|
|
Hi Andrew, Sorry this is certainly not obvious. The first thing you'll need to do is create an IValueConverter to convert a DiagramShape into a Style. In the Convert method, check to see if the DiagramShape.Name is "Rectangle", and return the style you want for that shape, otherwise return a Style with the same colors as the default style. Here's an example of creating a Style that the converter would return:
Next, create an instance of this converter in xaml, and use it to set the ShapeTool.ShapePathStyle attached-property within a custom DiagramNodeElement Style. Use this Style to set the DefaultStyle property of a ShapeNodeStyleSelector, which will get used as the NodeStyleSelector of a DiagramFormatter. Here is an example of all of this:
I know this is not trivial, so please let me know if you have trouble with any of this. -Jason fauchelle |
|