{"action":"created","issue":{"url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/3065","repository_url":"https://api.github.com/repos/MvvmCross/MvvmCross","labels_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/3065/labels{/name}","comments_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/3065/comments","events_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/3065/events","html_url":"https://github.com/MvvmCross/MvvmCross/issues/3065","id":349967361,"node_id":"MDU6SXNzdWUzNDk5NjczNjE=","number":3065,"title":"NavigationService.Navigate<TResult>() immediately return null on Wpf","user":{"login":"thongdoan","id":5615410,"node_id":"MDQ6VXNlcjU2MTU0MTA=","avatar_url":"https://avatars3.githubusercontent.com/u/5615410?v=4","gravatar_id":"","url":"https://api.github.com/users/thongdoan","html_url":"https://github.com/thongdoan","followers_url":"https://api.github.com/users/thongdoan/followers","following_url":"https://api.github.com/users/thongdoan/following{/other_user}","gists_url":"https://api.github.com/users/thongdoan/gists{/gist_id}","starred_url":"https://api.github.com/users/thongdoan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thongdoan/subscriptions","organizations_url":"https://api.github.com/users/thongdoan/orgs","repos_url":"https://api.github.com/users/thongdoan/repos","events_url":"https://api.github.com/users/thongdoan/events{/privacy}","received_events_url":"https://api.github.com/users/thongdoan/received_events","type":"User","site_admin":false},"labels":[{"id":17655166,"node_id":"MDU6TGFiZWwxNzY1NTE2Ng==","url":"https://api.github.com/repos/MvvmCross/MvvmCross/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":501339031,"node_id":"MDU6TGFiZWw1MDEzMzkwMzE=","url":"https://api.github.com/repos/MvvmCross/MvvmCross/labels/WPF","name":"WPF","color":"006b75","default":false},{"id":283110184,"node_id":"MDU6TGFiZWwyODMxMTAxODQ=","url":"https://api.github.com/repos/MvvmCross/MvvmCross/labels/up-for-grabs","name":"up-for-grabs","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-13T10:11:18Z","updated_at":"2018-08-22T07:17:49Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## 🐛 Bug Report\r\n\r\n<!--- Summary description of the bug --->\r\n\r\n`NavigationService.Navigate<TResult>() `immediately return null on Wpf,\r\n\r\nWe can fix it by move ViewModel?.ViewDestroy() to MvxWpfView_Unloaded instead MvxWpfView_Loaded, it is because MvxViewModelResult<TResult> cancel CloseCompletionSource on ViewDestroy\r\n\r\n```\r\npublic class MvxWpfView : UserControl, IMvxWpfView, IDisposable\r\n    {\r\n\r\n        private void MvxWpfView_Unloaded(object sender, RoutedEventArgs e)\r\n        {\r\n            ViewModel?.ViewDisappearing();\r\n            ViewModel?.ViewDisappeared();\r\n        }\r\n\r\n        private void MvxWpfView_Loaded(object sender, RoutedEventArgs e)\r\n        {\r\n            ViewModel?.ViewAppearing();\r\n            ViewModel?.ViewAppeared();\r\n            ViewModel?.ViewDestroy();\r\n        }\r\n\r\n}\r\n```\r\n\r\n```\r\n    public abstract class MvxViewModelResult<TResult> : MvxViewModel, IMvxViewModelResult<TResult>\r\n    {\r\n        public TaskCompletionSource<object> CloseCompletionSource { get; set; }\r\n\r\n        public override void ViewDestroy(bool viewFinishing = true)\r\n        {\r\n            if (viewFinishing && CloseCompletionSource != null && !CloseCompletionSource.Task.IsCompleted && !CloseCompletionSource.Task.IsFaulted)\r\n                CloseCompletionSource?.TrySetCanceled();\r\n\r\n            base.ViewDestroy(viewFinishing);\r\n        }\r\n    }\r\n```\r\n\r\n\r\n### Expected behavior\r\nDon't always return null\r\n### Reproduction steps\r\n\r\nvar foo = await this.NavigationService.Navigate<Foo>(new FooPickerViewModel());\r\n\r\n### Configuration\r\n\r\n**Version:** 6.1.2\r\n\r\n**Platform:** \r\n- [ ] :iphone: iOS\r\n- [ ] :robot: Android\r\n- [x] 🏁 : WPF\r\n- [ ] :earth_americas: UWP\r\n- [ ] :apple: MacOS\r\n- [ ] :tv: tvOS\r\n- [ ] :monkey: Xamarin.Forms"},"comment":{"url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/comments/414936014","html_url":"https://github.com/MvvmCross/MvvmCross/issues/3065#issuecomment-414936014","issue_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/3065","id":414936014,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDkzNjAxNA==","user":{"login":"thongdoan","id":5615410,"node_id":"MDQ6VXNlcjU2MTU0MTA=","avatar_url":"https://avatars3.githubusercontent.com/u/5615410?v=4","gravatar_id":"","url":"https://api.github.com/users/thongdoan","html_url":"https://github.com/thongdoan","followers_url":"https://api.github.com/users/thongdoan/followers","following_url":"https://api.github.com/users/thongdoan/following{/other_user}","gists_url":"https://api.github.com/users/thongdoan/gists{/gist_id}","starred_url":"https://api.github.com/users/thongdoan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thongdoan/subscriptions","organizations_url":"https://api.github.com/users/thongdoan/orgs","repos_url":"https://api.github.com/users/thongdoan/repos","events_url":"https://api.github.com/users/thongdoan/events{/privacy}","received_events_url":"https://api.github.com/users/thongdoan/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T07:17:49Z","updated_at":"2018-08-22T07:17:49Z","author_association":"CONTRIBUTOR","body":"Hello @Cheesebaron , I created a Pull Request,"}}
{"actor":{"display_login":"thongdoan"}}