简体   繁体   中英

WP7 updating UI dynamically without blocking thread

I am making sort of a karaoke app, where I need to tie in timestamped text-data with audio data. I have 2 lists to indicate start and end of audio timespans and text string indices. The issue that I am facing is I don't know how to update the highlighted text based on current media element's POSITION property.

WP7 doesn't have the Marker reached event ( which silverlight has ). So I was considering use of a DispatcherTimer . the issue with this is that the ticks that I want are non-uniform, and if I update the interval property every tick, the accuracy of the timer will fall greatly, as the media element's position and timer's tick will fall out of sync pretty easily.

Any idea how I get create my event similar to MarkerReached event of the Media element ? Thank you-Egon

我假设您有某种形式的数据结构可以告诉您标记在音频流中的位置,那么为什么不使用具有固定间隔 (例如500毫秒)的DispatcherTimer ,只需检查此数据结构以查看是否已到达一个标记?

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