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, I have a question about DiagramConnectionElement. I want to modify (shape, color) of Connection Points Thumbs on it (on connection path). I would also highlight it all time path is selected. It's possible? I will be grateful for your help. LP |
|
|
Hi LP, I've attached a file containing xaml code that can be used to customize the styling of connections how ever you want. Note that I think you're talking about the thumbs that appear at each end of a connection when you hover the mouse over them. Let me know if you're referring to something else. The code I've attached can be used by pasting it into a resource dictionary used in your app. The resource labelled "ConnectionPointMover" (Type ConnectionRelocatorThumb) controls the look of the thumbs that appear at each end of a connection. I've changed the color to green to give an example of customizing it, and so that it stands out when you first try out the code. The resource named "FullDiagramConnectionTemplate" (Type DiagramConnectionElement) controls the behaviour of displaying the sub controls. To this template, I've add the following trigger which will cause the thumbs at each end of the connection to always be visible when the connection is selected.
That should give you a place to start. Please let me know if you have further questions about any of this and I'll help you out. -Jason Fauchelle |
|
|
Thanks, it works perfectly :) But in next step I want something more - if no path is selected I want highlight every path on MouseOver, but if I select path (IsSelect=true) I want highlight only it (all time it is selected). It is possible? LP |
|
|
Hi LP, I'm not sure I understand all of the behavior you have described, but the main thing you'll need to know is if a path is selected. I haven't tried this from within a connection style, but I'd recommend trying a DataTrigger that binds to the SelectedItem property of the DiagramSurface (try using an ancestor type binding). You'd then want to implement a converter for the binding that returns a boolean depending on if the SelectedItem is an IDiagramConnection. Hope that helps. Let me know how it goes. -Jason Fauchelle |
|
|
Thanks, it almost works :) I've implemented converter and I've added trigger in ConnectionPointThumb style for DiagramNodeElement:
Everything works well, converter executes, but I found errors in console:
Similar code for paths works without any errors. I don't know what I did wrong... Could You help me ? |
|
|
Hi LP, I can't see anything that you're doing wrong - the binding looks fine. If everything is functioning correctly, then these kind of errors can be safely ignored. I know they can be annoying though. Unfortunately I haven't been able to see how this can be resolved. If you are able to send a simple repro project demonstrating this issue, then I could look into it a bit further. Sorry I couldn't be more helpful here. -Jason Fauchelle |
|