2016-06-09 185 views

回答

0

我不确定你在问什么。你的问题的文字回答是,你可以从TextBlock得到它的TextBlock.text属性值的文本字符串。

但是您提到TextBlock是可编辑的,因此您可能在编辑期间询问如何获取TextBlock.text的前一个值。

首先,给验证谓词赋予原始字符串以及新建议的字符串:TextBlock.textValidationTextEditingTool.textValidation属性和TextEditingTool.isValidText方法。

二, “TextEdited” DiagramEvent获取原始字符串值作为DiagramEvent.parameterDiagramEvent

0

添加到您的图表的nodeTemplate。这有助于。

$(go.TextBlock,{ 编辑:真 })

myDiagram.nodeTemplate = 

    $(go.Node, "Horizontal", { 
      isTreeExpanded: false, 
      click: showDetail 
     }, 
     $(go.Panel, "Auto", 
      $(go.Shape, "RoundedRectangle", { 
       fill: "#cce6ff", // the default fill, if there is no data-binding 
       stroke: "#6699ff", 
       height: 40, 
       strokeWidth: 2, 
       portId: "", 
       cursor: "pointer", // the Shape is the port, not the whole Node 
      }, new go.Binding("fill", "fill")), 
      $(go.TextBlock, { 
        editable: true 
       }, 
       new go.Binding("text", "text")) 
     ), 
     $("TreeExpanderButton", { alignment: go.Spot.Bottom, alignmentFocus: go.Spot.Top }, { visible: true }) 
    ); 
相关问题