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 want to show the text in the bottom of the Node like the image attatched. Could you tell me how should I do? Thank you very much! |
|
|
Hello, There are a few ways to do this depending on how your node is styled: If you are using instances of our ShapeNode in your diagram, then you can override the ShapeLayout to specify your own ContentMargin. Below is a simple example. To use this code, you simply need to copy it into a ResourceDictionary of your application. In this example, I am using the "Process" shape. Make sure to change this to the type of shape you want to apply this margin to, such as "Rectangle" which is the default. I've set the ContentMargin to auto size on the left, top and right, but be always 10 pixels on the bottom.
If you are not using ShapeNode, then another option is to provide a node content template. Here's example code that again can be added to a ResourceDictionary. You'd also need to set the NodeContentTemplateSelector of the DiagramFormatter that you're using to be the NodeContentTemplateSelector in the code below. This simplistic sample will apply the same template to all node content displays. If you want to apply different templates (perhaps with different alignments) you'd need to use a different template selector with the logic you need, rather than the fixed-template-selector in the code below.
If this does not work, then you probably have, or will need to have your own custom node template. Within the node template you'll have your own way to display the content (such as a TextBox) and you can simply control the alignment on that. Examples of providing custom node templates can be found in the Activity Diagram sample. Please let me know if you need further help with any of this. -Jason Fauchelle |
|
|
It works! Thank you very much! Andy |
|