WPF Binding to Tooltip

前端 未结 4 1338
误落风尘
误落风尘 2021-02-13 01:37

Not sure whats doing here, but the binding works for the label in the data template but not the tool tip. Any help will be appreciated.

                    

        
4条回答
  •  别跟我提以往
    2021-02-13 02:00

    If this DataTemplate is the ItemTemplate for a ListView like you state, then you shouldn't need to set the DataContext on the ToolTip nor have a RelativeSource BindingExpression in your Label.Content binding. The DataContext should already be set by the ListView. That's why we use the DataTemplate.

    Try just a regular binding for each:

    
        
            
                
                    
                
            
            
            
    
    

提交回复
热议问题