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'd created my own custom node, 1. I wish to achieve an effect of having a 'wireframe' style of my custom node when I dragging the node to another position. Is this achievable? 2. How can I make some of my node to be 'ReadOnly' and not movable?
Thanks. |
|
|
Hello For your first point, do you simply want to change the node style while the node is dragging? or do you want to display the old node position as well as a 'wireframe' of the dragging position? For you second point, There are a couple of ways to do this. Within a custom style applied to the nodes, you could use a trigger to listen to a property and disable the MoveThumb if necessary. You could either use the IsResizable property for this, or create a property on your custom nodes. If you don't need to toggle the 'readOnly' mode of your custom nodes, then you could create a node style that doesn't have a MoveThumb at all, and apply this to the node type that you want to be readonly. Again if you don't need to toggle 'readOnly' mode, you may also be able to simply create a node template that has IsHitTestVisible = true which can cover up the MoveThumb. Let me know if there are questions or issues with implementing any of this. - Jason |
|
|
Hi, For my first point, I wish to display both the old node position as well as a 'wireframe' of the dragging position. But I will be ok as long as I have the 'wireframe' node stick with my cursor when I dragging.
|
|
|
Hello I don't think you will be able to show both the old node position and the wireframe node. Here is how you could create the wireframe effect though: Create a custom node style and add the following rectangle somewhere within the main grid: <Rectangle Name="Wireframe" StrokeThickness="1" Stroke="Black" StrokeDashArray="2,2" Visibility="Collapsed" /> Then use this trigger to listen to if the MoveThumb is dragging to change the appearance:
<DataTrigger Binding="{Binding IsDragging, ElementName=Mover}" Value="true"> - Jason |
|
|
Hi, the dragging is working as expected. thanks. ;) however, I have another issue on "Selected" node which doesn't work quite well. I have defined a DataTemplate for a node using your default styles. I put a textbox inside the data template but I want it to only show up when the user "selected" the node, how can I trigger that behaviour? |
|
|
Hello Try using a DataTrigger like this: <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ms:DiagramNodeElement}}}" Value="True"> - Jason |
|