Hi,
On a button click i want to change the text of the attached issue but again the clipping issue is coming.
private void btnCnhgText_Click(object sender, RoutedEventArgs e)
{
foreach (ShapeNode node in diagram.Nodes)
{
if (node.SubordinateGroup != null && node.SubordinateGroup.AttachedNodes[0] != null)
{
((ShapeNode)node.SubordinateGroup.AttachedNodes[0]).Text = "Long text string given";
}
}
}
Upon using this code the text definitely changes but the string assigned is not displayed completely. Only "Long text" is visible.
Please suggest how to resolve this issue.
Consider following code:
ShapeNode mainNode = diagram.Factory.CreateShapeNode(
new Point(100, 100), new Size(45, 45));
node.EnabledHandles = AdjustmentHandles.Move;
node.HandlesStyle = HandlesStyle.MoveOnly;
Uri uri = new Uri(@"..\..\Test.png", UriKind.RelativeOrAbsolute);
mainNode.Image = new BitmapImage(uri);
mainNode.ImageAlign = ImageAlign.Center;
mainNode.Shape = Shapes.Decision;
labelNode = diagram.Factory.CreateShapeNode(
mainNode.Bounds.X, mainNode.Bounds.Y + mainNode.Bounds.Height,
mainNode.Bounds.Width, 20);
labelNode.AttachTo(mainNode, AttachToNode.BottomCenter);
labelNode.Locked = true;
labelNode.Transparent = true;
labelNode.Text = device.Name;
labelNode.Shape = Shapes.Rectangle;
labelNode.TextFormat.Alignment = StringAlignment.Center;
labelNode.TextFormat.LineAlignment = StringAlignment.Center;
labelNode.ResizeToFitText(FitSize.KeepHeight);
mainNode.SubordinateGroup.AutoDeleteItems = true;
Thanks,
Anurodh