Hi Mary,
With regards to Node resizing on its Label changes, this can be achieved by specifying the Size of Node as double.NaN. Node Size will be changed according to its Label size. Please refer to the code Snippet for this. Please refer to the sample which represent your requirement from attachment.
Sample Details:
In that sample, we have created a DirectedTreeLayout. Please Select the Node and Start Editing the provided Text box, it updates the Label of the Selected Node. The Node resizes on its Label changes.
Code Snippet:
//Register the Label changed event
diagarmView.NodeLabelChanged += new LabelChangedEventHandler(diagarmView_NodeLabelChanged);
void diagarmView_NodeLabelChanged(object sender, LabelRoutedEventArgs evtArgs)
{
Node curnode = (evtArgs.Node as Node);
//For resolving the Node resizing on content changes
curnode.Width = double.NaN;
curnode.Height = double.NaN;
curnode.UpdateLayout();
//solution to overcome the restriction of basic operation like Node resizing, rotating, automatic layouts.
curnode.Width = curnode.ActualWidth;
curnode.Height = curnode.ActualHeight;
}
If this response does not satisfy your requirement, please get back us with more details of your expectations.
Please let us know if you have any concerns.
Regards,
Ramya
NodeResizes_45baafbf.zip