On googling a bit i found this post in silverlight fourms which says
"Having the ToolTip not show on a disabled element is by design, and compatible with WPF. We realize that Silverlight lacks other means to provide ToolTips on disabled items (such as ToolTipService.ShowOnDisabled), and will be looking into it." as is.
Here is the workaround which i found while implementing this functionalty.
<Border HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent" > <ToolTipService.ToolTip> <ToolTip Content="Tool Tip"/> </ToolTipService.ToolTip> <Button x:Name="button" Width="75" Content="Button" IsEnabled="False" /> </Border>
My first thought to show the tooltip, was to wrap the control (Button) inside another control (Border) and add the tooltip to the parent (Border) control. As we will enable and disable the child control, parent control displays the tooltip.
[Updating post as some of my friends suggested a better solution, and the good thing was my first thought was not wrong, just making wrapper control (Border) background to transparent is enough.. which works like a charm.. i've updated the code snippet accordingly..]
This was my workaround, If anyone finds a better way please post a comment with that solution. As that may help somebody like me :).
Hope this post helps some one.
Your initial idea would work if you set the wrapper's Background to a non transparent value.
ReplyDeleteThat works if you set the Background="Transparent"
ReplyDeleteThanks a lot Sally and HD, I've updated the post accordingly...
ReplyDelete