在 PhoneNumberResult 之后导航离开

发布于 2024-11-24 18:53:19 字数 649 浏览 2 评论 0原文

我认为这具体是一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半边脸i 2024-12-01 18:53:19

实际上,导航应该如下所示:

navigationService.UriFor<ComposeViewModel>().Navigate();

(注意最终的Navigate 方法)

如果这只是问题中的拼写错误,我想问题可能与时间有关应用程序恢复(当您在选择器任务完成后返回到应用程序时会发生这种情况)。
在这种情况下,您能否为此创建一个问题

Actually, the navigation should look like:

navigationService.UriFor<ComposeViewModel>().Navigate();

(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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文