MillyMonster
MillyMonster

Reputation: 556

Adding a tooltip to text with a textblock

I am trying to implement an app with a glossary which works in the following way. The content is displayed in textblocks and in that content are words that I want to attach a tooltip to so when the user taps on them the definition is shown. I'm not sure how to go about this as everything I've read so far has led me to think that tooltips can only be added to controls. Is this right?

I've also been reading the guidelines about tooltips and I'm not sure if what I want to do fits within those guidelines.

I'd appreciate any advice about this.

Upvotes: 0

Views: 144

Answers (2)

Uthistran Selvaraj
Uthistran Selvaraj

Reputation: 1371

While you are writing the contents in the text blocks. just note down the position of the texts which contains the definition. Then, when the mouse pointer comes over the position, just display the definition in the tooltip using mouse hover event.

This is up to my knowledge...

Upvotes: 1

Johannes Wanzek
Johannes Wanzek

Reputation: 2875

I dont think a tooltip would be a good solution for you in this case. You should probably create an invisible Control inside your Template of each Item containing all the Information you want to show as your 'tooltip'.

Then you grab the Tap Event, or anything else, and toggle the visibility of the 'tooltip' control.

If you are OK with this solution I may give you some sample code when Im at home :)

Upvotes: 1

Related Questions