Bind to a markup externsion property

Posted by user314580 on Stack Overflow See other posts from Stack Overflow or by user314580
Published on 2010-04-12T14:29:55Z Indexed on 2010/04/12 14:33 UTC
Read the original article Hit count: 209

Filed under:
|
|
|

Hi,

I have written a markup extension which stores amongst others a help text. This help text is shown on the right side of the main window. This works fine.

Now, I want to add a tooltip for every control. The content of the tooltip should be same as for the helptext extension.

The XAML code:

<ListView ctrl:ListViewLayoutManager.Enabled="true"
    x:Name="ListViewSources"
    ItemsSource="{Binding SourceItems}" 
    ItemContainerStyle="{DynamicResource ListViewItemStyleAlternate}"
    Height="150"
    MinWidth="350" 
    Helper:HelpExtension.IsControl="true"
    Helper:HelpExtension.HelpText="{x:Static strings:GUIResource.HelpProfilesSourcesDescriptionText}" >
 <ListView.ToolTip>
  <ToolTip Style="{DynamicResource Own_TooltipStyle}"></ToolTip>
 </ListView.ToolTip>

And now the code of the style:

If I run the program I get the binding error:

System.Windows.Data Error: 39 : BindingExpression path error: 'Helper:HelpExtension' property not found on 'object' ''ListView' (Name='ListViewSources')'. BindingExpression:Path=Helper:HelpExtension.HelpText; DataItem='ListView' (Name='ListViewSources'); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')

Does anybody know how I can bind the TextBlock to the content of Helper:HelpExternsion.HelpText?

Thanks Dieter

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf