简体   繁体   中英

DataTemplate show TextBlock on hover?

I'm trying to make an WinRT app.

I have managed to make an ListView with a binding and a custom ItemTemplate.

The ItemTemplate refers to an DataTemplate with 3 textbox's.

What I want to do is to show only the two named "Title" and "Subtitle" as standard, and on hover show "Description" but not "Title" and "Subtitle". How is this done?

You should make your DataTemplate be a UserControl or a templated control so you can handle the pointer events. Then you can change the visual state of the control based on whether a pointer is over the control. Note though that you can't hover with touch input, so you need an alternative for touch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM