How can I set different Tooltip text for each item in a listbox?

前端 未结 7 1182
情话喂你
情话喂你 2020-12-01 07:57

I have a listbox that is databound to a Collection of objects. The listbox is configured to display an identifier property of each object. I would like to show a tooltip w

7条回答
  •  Happy的楠姐
    2020-12-01 08:24

    I think the best option, since your databinding your listbox to objects, would be to use a datatemplate. So you could do something like this:

    
        
            
                
            
         
    
    

    Of course you'd replace the ItemsSource binding with whatever your binding source is, and the binding Path parts with whatever public property of the objects in the list you actually want to display. More details available on msdn

提交回复
热议问题