Hide tooltip if binding is null

后端 未结 6 692
情深已故
情深已故 2021-02-01 14:33

Currently i\'ve got the following code to show a tooltip.



        
6条回答
  •  甜味超标
    2021-02-01 15:25

    This is a WPF answer (haven't tried it in Silverlight).

    Use ToolTipService.IsEnabled, and bind it to the tooltip property. Then use a converter to convert the tooltip string to a bool.

    For example, I have the following:

    
    ...
    
    

    Or in code-behind

    ToolTipService.SetIsEnabled(textBlock, false);
    

提交回复
热议问题