Hello Everyone,
I am trying to create a binding to link the size of a Shape, to the size of a textblock, both are nested within said panel. Can’t figure out how to get it working though.
private getNodeNotesEditor(): Panel {
return GraphObject.make(Panel, Panel.Auto,
new Binding("visible", "Probably under NDA", (note: IGraphNote) => {
"Probably under NDA"
}),
GraphObject.make(Shape, "Rectangle",
{
fill: "Probably under NDA"
isPanelMain: true,
background: "Probably under NDA"
stroke: "Probably under NDA"
}
),
GraphObject.make(Panel, Panel.Table,
/* Notes Text area*/
GraphObject.make(TextBlock,
{
stretch: Panel.Fill,
name: "nodeNotesEditor",
margin: 4,
row: 2,
width: 60,
isMultiline: true,
editable: true,
wrap: TextBlock.None,
overflow: TextBlock.OverflowEllipsis,
background: "Probably under NDA"
stroke: "Probably under NDA"
},
new Binding("text", "",
(node: any): string => { return "Probably under NDA"; }
).makeTwoWay(
(val: string, srcData: any, model: any) => {
"Probably under NDA"
}
),
new Binding("editable",
"Probably under NDA"
}),
new Binding("height", **ShapeHeight?**).makeTwoWay(),
new Binding("width", **ShapeWidth?**).makeTwoWay(),
)
),
)
}
Please note the bottom 2 bindings, i think i might be on the right track, but i am really not sure how to get the shape’s height and width.