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 guys, I have a couple of questions considering DiagramConnectionElement. First of all - is it possible to make the Content of DiagramConnectionElement 'breakable' with 'enter' button, like it is in DiagramNodeElements? And maybe also selectable with ctrl+A shortcut? Socondly - could you enable to change StrokeDashArray of connections without applying custom styles to them? I tried to apply my own style to connections but I couldn't do it because my application was throwing an exception beacuse of this xaml code: <ContentPresenter Name="DataPresenter" Content="{Binding Connection, RelativeSource={RelativeSource TemplatedParent}}" ContentTemplateSelector="{TemplateBinding ConnectionContentTemplateSelector}"> Without this part of the code my appliaction works but Content of DiagramConnectionElements is not placed where it should be. I would really appreciate your help on this. Cheers, Przemo
|
|
|
Hello I have attached a sample that demonstrates how to do all these things. You can change the stroke dash array by providing a custom connection style without touching the control template. On line 13 of Window1.xaml is a style that sets the stroke dash array for a path. Line 34 has the custom connection style which simple sets the PathStyle property to be the custom path style. A FixedStyleSelector and a DiagramFormatter are then used to apply the custom connection style as normal. The generic connection style takes care of all the control template parts. Lines 43 to 77 has a custom template with a text box for the connection content. On line 61 I have set the AcceptsReturn property to true to allow the 'enter' key to put a line break in the content. Then this custom connection template is applied by setting the ConnectionContentTemplateSelector property of the DiagramFormatter. Let us know how it goes. |
|
|
Everything works prefectly now. Thank you. |
|