views:

248

answers:

2

I can't scroll to my scrollviewer, it disappear when I move the mouse. Was it because it was just a tooltip? If yes, is there a way to scroll the text in my tooltip?

<TextBlock TextWrapping="Wrap" Style="{StaticResource TextBlockWidthStyle}" 
                                   Text="{Binding ExtendedDescription}"
                                   TextTrimming="WordEllipsis">
                                <ToolTipService.ToolTip>
                                    <ScrollViewer Width="310" VerticalScrollBarVisibility="Auto">
                                        <TextBlock Text="{Binding ExtendedDescription}"
                                                   Width="300"
                                                   TextWrapping="Wrap"/>    
                                    </ScrollViewer>
                                </ToolTipService.ToolTip>
                            </TextBlock>
A: 

If you can, use line breaks to break up the description instead of having user to scroll on a tooltip!

VoodooChild
How does using line breaks differ from specifying a fixed width and TextWrapping="Wrap"?
AnthonyWJones
+1 Actually now that I think about it, it doesn't. Hmmm, thanks for the swift kick in the arse
VoodooChild
+2  A: 

I think you are stretching the ToolTip usage outside of what it expected. Its disappearing because that is its design. Its not expected to contain any content with which the user has to interact such as a scrollbar.

I would suggest that you implement this functionality using a Popup instead. Wrap it all upt in a UserControl or a templated custom control.

AnthonyWJones