I am having some problem on the palette. Basically I want to update the size of the palette whenever I add/remove a node in it. I have a palette in an expander. See hierarchy below:
The palette is based on the controltemplate given here:
But when I load the palette, the height is 0 and no node is shown. but once I collapsed then expand the expander, the content is shown with the correct height. How can I update the size of the palette based on the contents.
As that forum topic mentioned, I think you need to specify the size of the Palette.
If you at least specify a particular initial Width, you could try implementing a Diagram.InitialLayoutCompleted event handler that then sets the Palette’s Width and Height based on the Diagram.Panel.DiagramBounds (perhaps scaled, if desired).
I set the height to Auto so the size will be based on the content but it is not working. I can’t assign a specific height value because the nodes are not static. The user can add/delete node from the palette.
The static palettes are working. But the palette where i can add/remove node, the height is not changed. I want to update the height whenever I add/remove node. How can I achieve this?
I have additional question. As I said, I have a palette where I can add/remove node. Is it possible that the layout should only change when I drop the nodes? How can I do that? The current behavior is that when the node entered the palette, it starts computing for the space for the new nodes.