简体   繁体   中英

Changing the title text dynamically in Windows 8

In the app preview for the Bing Weather app in the Windows 8 release preview, the title text changes automatically when the "view" changes (ie when scrolling).

My app currently has two ListBox items inside a Grid item, wrapped with a ScrollViewer element. I want the title to change according to which of the ListBoxes is currently in view.

Suggestions of different UI elements or layouts are also welcome

What if you try to use Height properties of ListBoxes and ScrollViewer?

I mean you know the height of ScrollViewer. So after scrolling you need to check if ScrollViewer's offset (eg VerticalOffset ) is more than Height (or maybe ActualHeight , it depends on your markup) of, let's say, 1st ListBox.

That way you will know if 1st ListBox is not visible, so the 2nd ListBox is in scope and you can change Title.

I hope my point is clear for you.

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