在 PhoneNumberResult 之后导航离开
我认为这具体是一个 Caliburn.Micro 问题,因为它与 CB 如何处理 Windows Phone 7 中的导航有关。
我有一个可以选择启动电话号码选择器的视图。结果返回后,我将其存储并导航离开,只有导航不起作用。我认为这是因为 Handle 方法正在处理任务,而不是我的观点。我知道我可以在页面末尾粘贴一个按钮以在句柄完成后进行导航,但我希望在结果返回后发生这种情况。
这就是我正在做的事情。
public void Handle(TaskCompleted<PhoneNumberResult> message)
{
webtext.Recipient = message.Result.PhoneNumber;
webtext.RecipientDisplayName = message.Result.DisplayName;
CommitWebtextToStorage();
events.Unsubscribe(this);
navigationService.UriFor<ComposeViewModel>();
}
这行不通。我也无法调用其中的方法,因为这与我正在做的事情相同。我需要让handle方法退出然后调用导航服务。
This is specifically a Caliburn.Micro question I think, as it has to do with how CB handles navigation in windows phone 7.
I have a view that has the option of launching a phone number chooser. Once the result comes back I store it and navigate away, only the navigation wont work. I assume this is because the Handle method is working with the task and not my view. I know I can stick a button down the end of the page to navigate after the handle is finished but I would like this to happen once the result comes back.
This is what I am doing.
public void Handle(TaskCompleted<PhoneNumberResult> message)
{
webtext.Recipient = message.Result.PhoneNumber;
webtext.RecipientDisplayName = message.Result.DisplayName;
CommitWebtextToStorage();
events.Unsubscribe(this);
navigationService.UriFor<ComposeViewModel>();
}
Which wont work. I also can't call a method inside that as that would be the same as what I am doing. I need to let the handle method exit and then call the navigation service.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,导航应该如下所示:
(注意最终的Navigate 方法)
如果这只是问题中的拼写错误,我想问题可能与时间有关应用程序恢复(当您在选择器任务完成后返回到应用程序时会发生这种情况)。
在这种情况下,您能否为此创建一个问题?
Actually, the navigation should look like:
(note the final
Navigate
method)If it was just a typo in the question, I guess the issue could have to do with the timing of application resuming (which occurs when you return back to the application after the chooser task is completed).
In that case, could you please create an issue for this?