How to specify a ToolTip for a control in a Style from XAML?

后端 未结 6 1735
面向向阳花
面向向阳花 2021-02-13 09:44

I\'m using a the WPF datagrid from the Microsoft CodePlex project. I have a custom control that I want to databind to a field from the row of the datagrid. I can\'t for the life

6条回答
  •  孤独总比滥情好
    2021-02-13 10:20

    Figured it out... took me about 6 hours...

    For some reason, I can't set the value directly using Value.Setter. If I define the content for the tooltip as a static resource though, and then set it in the Style property of the DataGrid.RowStyle it works.

    So, the datagrid row style looks like:

                
    
            
    

    And the resource is

    
        
            f1
            f2>
        
    
    

    Thanks!

提交回复
热议问题