I have been working with the Ribbon using the shared PopupButton control. I needed a double line tooltip, and I discovered that this can be done by embedding a StackPanel with two TextBlock controls inside the PopupButton.ToolTip dependency property as follows:
<shared:PopupButton.ToolTip>
<StackPanel Visibility="{Binding Path=...}}">
<TextBlock Text="{Binding Path=...}" />
<TextBlock Text="{Binding Path=...}" />
</StackPanel>
</shared:PopupButton.ToolTip>
The double line tooltip worked perfectly, except when it needs to be collapsed or hidden. If the TextBlock.Text values are empty, then I do not want the tooltip to be shown. I am using a converter that I called "TextToVisibilityConverter" that sets the visibility of the tooltip's StackPanel to collaped when the text values are empty. This does not work because there is still a small square shaped graphic that is displayed even when the tooltip text vales are empty. I then tried a variation on that using a new converter which I called TextToHiddenVisibilityConverter which sets the tooltip's StackPanel to hidden rather than collapsed when the text is empty. In that case the full sized tooltip is shown albeit with no text.
I also tried setting the visibility of the individal TextBlocks inside of the tooltip's StackPanel, but that made no difference at all.
Is there some way I would work around this problem? Shouldn't the tooltip be hidden or collapsed when I so specify?
I suppose a work around would be to always have a tooltip displayed and to not fuss with the visibility of the StackPanel control in the tooltip.
Previously I encountered the same issuue when I used the ribbon PopupButton control. In either case hiding the tooltip does not seem to be possible.