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
|
I implemented a MatchinTemplateSelector based on the custom data sample, which worked at one point. However, then I was trying to something a bit more complicated, and it stopped working. The only thing that changed was that I switched the Nodes that I was using from StepNode to my own CustomNode class. So originally my MatchingTemplateSelector resource looked like this.
So when I changed to "CustomNode" I changed it to this:
The problem is that the "Matches" method is never called. Even with StepNode it didn't work the first time, then magically it started working, but I don't really know what happened to make it work. What am I missing? |
|
|
Never mind I think I answered my own question. My CustomNode needs to inherit from ShapeNode not DiagramNode. That was obscure. |
|
|
Hello Eliz The only thing I can think of that prevented it from working, is if your custom node style was not using the specified content template selector. Here is an example of what needs to be put in your custom node style/NodeTemplate in order for it to display content using the selector set in the formatter:
If you did not set a node style for your custom node implementation and just left it to be the default blue rectangle style, this could also explain why it did not work. You could give this a try, but if extending ShapeNode is fine for you (nothing wrong with doing this), then you could leave it with your current solution. -Jason Fauchelle |
|