开发者

Navigate away after PhoneNumberResult

开发者 https://www.devze.com 2023-03-20 18:26 出处:网络
This is specifically a Caliburn.Micro question I think, as it has to do with how CB handles navigation in windows phone 7.

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. On开发者_JS百科ce 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.


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号