Hello,
I know it is a wpf question, but maybe have you an idea.
The aim of my code is to decide what color used for border and first gradientstop of the background of my node between predefined option colors and data override color.
When I use this code on “go:NodeShape” object, all is ok
but on “Border”, at the first time loading the UserControl, the border is not setted. I’ve made some trace and I’ve seen that the binding for border is called twice (and the last call, with Options.Color unset… )
Well, that’s puzzling, because, when I add a new node (from palette), the borderbrush is at this time well defined !
Thanks
Aurore
(ps: delete my message if it is not a GoDiagram framework)
This one work as expected:
<go:SpotPanel Style="{StaticResource SpotPanelStyle}"
Name="oNodeBorder"
go:Part.DropOntoBehavior="AddsLinkFromNode"
Background="{Binding Path=Part.IsDropOntoAccepted,
Converter={StaticResource convBoolBrush}}">
<go:NodeShape go:NodePanel.Figure="Dodecagon"
StrokeThickness="1">
<go:NodeShape.Stroke>
<SolidColorBrush>
<SolidColorBrush.Color>
<MultiBinding Converter="{StaticResource convQDColor}">
<tools:ParentDataBinding AncestorType="{x:Type v6Concept:MC_QDiagram}"
Path="Options.ColorPart" />
<Binding Path="Data.Item.Color" Converter="{StaticResource convDrawingMediaColor}" />
</MultiBinding>
</SolidColorBrush.Color>
</SolidColorBrush>
</go:NodeShape.Stroke>
<go:NodeShape.Fill>
<LinearGradientBrush StartPoint="0,0.5"
EndPoint="1,0.5">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0" >
<GradientStop.Color >
<MultiBinding Converter="{StaticResource convQDColor}">
<tools:ParentDataBinding AncestorType="{x:Type v6Concept:MC_QDiagram}" Path="Options.ColorPart" />
<Binding Path="Data.Item.Color" Converter="{StaticResource convDrawingMediaColor}"/>
</MultiBinding>
</GradientStop.Color>
</GradientStop>
<GradientStop Offset="1.00"
Color="#ffffffff" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</go:NodeShape.Fill>
</go:NodeShape>
...
</go:SpotPanel>
This one doens’t work :
<go:SpotPanel Style="{StaticResource SpotPanelStyle}"
Name="oNodeBorder"
go:Part.DropOntoBehavior="AddsLinkFromNode"
Background="{Binding Path=Part.IsDropOntoAccepted,
Converter={StaticResource convBoolBrush}}">
<Border CornerRadius="15"
BorderThickness="1"
HorizontalAlignment="Stretch">
<Border.BorderBrush>
<SolidColorBrush>
<SolidColorBrush.Color>
<MultiBinding Converter="{StaticResource convQDColor}">
<tools:ParentDataBinding AncestorType="{x:Type v6Concept:MC_QDiagram}"
Path="Options.ColorGroup" />
<Binding Path="Data.Item.Color"
Converter="{StaticResource convDrawingMediaColor}"/>
</MultiBinding>
</SolidColorBrush.Color>
</SolidColorBrush>
</Border.BorderBrush>
<Border.Background>
<LinearGradientBrush StartPoint="0,0.5"
EndPoint="1,0.5">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0" >
<GradientStop.Color>
<MultiBinding Converter="{StaticResource convQDColor}">
<tools:ParentDataBinding AncestorType="{x:Type v6Concept:MC_QDiagram}" Path="Options.ColorGroup" />
<Binding Path="Data.Item.Color" Converter="{StaticResource convDrawingMediaColor}"/>
</MultiBinding>
</GradientStop.Color>
</GradientStop>
<GradientStop Offset="1.00"
Color="#ffffffff" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
...
</Border>
</go:SpotPanel>