views:

33

answers:

0

Hello everybody,

i have a xaml resource file with some definitions of datatemplates. In one datatemplate i have a border background bound to a property of its dataobject.

I also have a colorpicker user control which is part of the contextmenu of the border.

Now i'm trying to bind the dependency property "CustomColor" of the colorpicker to the color/background property of the border. How to do this?

Do i have to bind to the "Background" property of the border or to the "Color" property of my dataobject?

 < Border x:Name="projectRect" Grid.Column="1" Grid.ColumnSpan="1"   HorizontalAlignment="Right"
          **Background**="{Binding Path=**Color**, Converter={StaticResource colorConverter}}"
          BorderBrush="#737377" BorderThickness="1" CornerRadius="4" IsHitTestVisible="True">
            < TextBlock Text="{Binding Path=ProjectId}" VerticalAlignment="Center" Margin="4"/>
            < Border.ContextMenu >
                < ContextMenu Name="colorPopup" StaysOpen="True" Style="{StaticResource ColorPickerContextMenuStyle}" >
                    < Border Background="GhostWhite" >
                        < local:CustomColorPicker x:Name="cp" 
                            **CustomColor**="{Binding Path=**Color**, Converter={StaticResource colorConv}}"
                            diag:PresentationTraceSources.TraceLevel="High" />
                    < /Border>
                < /ContextMenu>
            < /Border.ContextMenu>
        < /Border>

Thanks for your replies.

Karsten