tags:

views:

17

answers:

1

The following code:

    <TextBlock Name="foo"></TextBlock>
    <Label Target="foo">_Delta pressure</Label>

Generates the following design time error:

Error 1 Value 'foo' cannot be assigned to property 'Target'. Property 'Target' of type 'UIElement' cannot be specified as a string. C:\Programming\WpfCustomPlot\SPT.Olga.Plot.Custom\PumpCurves\View\RatedValuesView.xaml 65 45 SPT.Olga.Plot.Custom

And the following runtime error:

'UIElement' type does not have a public TypeConverter class. Error at Line 65 Position 45.

What am I doing wrong?

+2  A: 

The Target property takes the element itself, not a string, so you want:

<TextBlock Name="foo"></TextBlock>
<Label Target="{Binding ElementName=foo}">_Delta pressure</Label>

HTH,
Kent

Kent Boogaart