wp7-如何让线程导航页面
我想每次间隔检查应用程序状态的变化,如果发生变化,打开一个窗口,并给用户 10 秒的时间来按下窗口,如果他确实按下了窗口,则允许他在窗口中自由导航,如果他不按,则返回到之前的窗口。我想用一个在后台运行的线程来实现它,并在我想要的每个时间间隔醒来。也许有更好的方法?
I want to check for changes in the aplication state every time interval, and if it has changed, to open a window, and give the user 10 seconds to press on the window, if he does press on the window, then to allow him to navigate freely in the window, and if he doesn't press, to return back to the window before. I thought to implement it with a thread running in the background and waking up every time interval I want. Maybe there is a better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在我看来,这是一个存在很多潜在问题的场景。
如何阻止“窗口”在用户不方便的时候出现? (例如,当他们正要点击 some.ething 时)
为什么不在状态实际发生变化时发出通知呢?这样你就不需要轮询了。
您显示的“窗口”是什么?它与它要替换的页面有何不同?这是一个弹出窗口还是您实际上正在导航到另一个页面?
正在改变的状态是什么?如果没有用户交互,它会如何变化?
您不能在不潜在地侵入性地显示新“窗口”的情况下通知用户状态更改吗?
This strikes me as a scenario with lots of potential issues.
How do you stop the "window" appearing at an inconvenient time to the user? (e.g. when they were just about to tap on som.ething)
Why not just raise the notification when the state actually changes? This way you wouldn't need to poll.
What is the "Window" you are displaying? How does it differ from the page it is replacing? Is this a popup or are you actually navigating to a different page?
What is the state that's changing? How is it changing without user interaction?
Can't you notify the user of the state change without a potentially intrusive display of a new "window"?
我同意@matt-lacey,这可能很危险,并且可能会导致糟糕的用户体验。
话虽如此,这可能有效
I agree with @matt-lacey, this could be dangerous and might result in a bad user experience.
With that said, this might work
我不知道你可以做一个弹出窗口,你能详细说明一下吗?
我创建了一个在后台运行并进行一些工作的线程,如果它认为有必要进行更改,我想给用户一个机会对其做出反应,或忽略它。
我对此很陌生,所以如果有比导航到不同页面更好的方法,我很想听听。
谢谢。
I didn't know you could do a pop-up window, could you elaborate?
I've made a thread that is running at the background and making some work, if it decides that a change is necessary, I want to give the user a chance to react to it, or ignore it.
I'm pretty new to this, so if there is a better way than to navigate to a different page i would love to hear it.
Thanks.
在我看来,您想通知用户某些事情发生/发生了变化,并让他们可以选择对此进行处理,这正是“toast”通知的全部内容。它们会在屏幕顶部弹出来通知用户,然后用户可以点击该 Toast 来执行某些操作,例如,当 WiFi 网络可用时,您可以点击 Toast 以选择可用的网络。
Silverlight Windows Phone 工具包 包含用于显示 Toast 通知的
ToastRequestTrigger
。模式和示例中的 Windows Phone 开发人员指南实践团队提供了使用ToastRequestTrigger
的示例。您需要在 toast 内容中自行实现点击处理,但这应该足够简单。It sounds to me like you want to notify the user that something has happened/changed and give them the option to do something about it, which is exactly what "toast" notifcations are all about. They pop up at the top of the screen to inform the user, and then the user can tap that toast to do something, e.g. when WiFi networks are available, you tap the toast to select an available network.
The Silverlight Windows Phone Toolkit includes the
ToastRequestTrigger
that you use to display toast notifications. The Windows Phone Developer Guide from the patterns & practices team gives examples of using theToastRequestTrigger
. You will need to implement the tap handling yourself in the toast content, but this should be simple enough.