Fill binding color is not updated

I have this datatemplate:

<go:SpotPanel Style="{StaticResource SpotPanelStyle}"
go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}">
<go:NodePanel Sizing=“Auto” go:SpotPanel.Main=“True” MouseDown=“MyNode_MouseDown”>
<go:NodeShape x:Name=“Shape” Style="{StaticResource NodeShapeStyle}"
go:Node.PortId="" go:Node.LinkableTo=“True” go:Node.LinkableFrom=“True”
go:NodePanel.Figure="{Binding Path=Data.Figure}" Cursor=“Hand”
Fill="{Binding Path=Data.sColor, Mode=TwoWay}"/>
<TextBlock Style="{StaticResource TextBlockStyle}"
Text="{Binding Path=Data.Text, Mode=TwoWay}"/>
</go:NodePanel>
</go:SpotPanel>


Please notice that Binding for NodeShape Fill property is twoway, TextBlock Text is also twoway.

In the code, when I click the node, I tried to update the Data.sColor and Data.Text, only Text got updated, the sColor doesn’t. If I define the color in the palette, it takes the color. What did I do wrong?

Is “sColor” a string? If so, maybe the problem is that there’s no automatic conversion from Brush to String.

Why do you have it defined as a TwoWay Binding? Wouldn’t it be better to modify the model data directly?

“sColor” is a string. I actually hardcoded different color strings in wish to see the click function will change the node color. I created a ColortoBrushConverter to convert the string to Brush. I digged into it, the converter only called once when I set up the palette for the model node, not called at all when I updated data.sColor. I can update Figure and Text, from this, I think I got the correct node.

I checked the “NodeShapeStyle” and made sure the Fill setter is commented out although it doesn’t matter.