Hi Rodrigue,
Thanks for contacting Syncfusion support.
Requirement: How to dynamically change the node size according to the space needed by a custom UserControl?
We have analyzed your requirement. In General, if we want to change the node size then we have to change the node size through any of the changed event. For example if you use textbox then using the TextChanged event of the TextBox to change the node size. For this example please find the code example below.
Code example:
|
private void UserTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
TextBox textbox = sender as TextBox;
double textboxwidth = textbox.Text.Length * (textbox.FontSize * .50);
// For this we need to set the Content of the node as node like below.
// node.Content = node;
(textbox.DataContext as NodeViewModel).UnitWidth = textboxwidth;
}
|
Regards,
Karkuvel Rajan S