Sizing a Label Node

I have a node type that is just a label that looks like this:


<DataTemplate x:Key="Label">        
        <go:NodePanel Sizing="Auto"
                      go:Part.Resizable="True"
                      go:Part.ResizeElementName="LabelText"
                      go:Part.Rotatable="True"
                      go:Node.RotationAngle="{Binding Path=Data.Angle, Mode=TwoWay}"
                      go:Part.SelectionAdorned="True"
                      go:Part.SelectionElementName="LabelText"
                      go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"
                      go:Node.LocationSpot="Center"                      
                      Cursor="SizeAll">

            <TextBox Name="LabelText"
                     IsEnabled="False"
                     AcceptsReturn="True"
                     Text="{Binding Path=Data.Text, Mode=TwoWay}"
                     TextAlignment="Center"
                     Padding="5"/>
        </go:NodePanel>
</DataTemplate>

The node resizes itself as the TextBox’s size changes (which is what we are looking for), but once the node has been manually resized it no longer automatically resizes when the TextBox grows larger than the container. Any suggestions on how to achieve this behavior after the node has been manually resized?

Thanks
Ryan

Why are you using a go:NodePanel at all? Just move all of those attributes onto the TextBox. (Other than Sizing, of course.)

You might need to implement a Diagram.TextEdited event handler to clear the Width and Height properties under the conditions you determine.