{"action":"created","issue":{"url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/2577","repository_url":"https://api.github.com/repos/MvvmCross/MvvmCross","labels_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/2577/labels{/name}","comments_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/2577/comments","events_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/2577/events","html_url":"https://github.com/MvvmCross/MvvmCross/issues/2577","id":293618155,"number":2577,"title":"MvvmCross.Forms cannot replace app's MainPage","user":{"login":"vkonst86","id":17501718,"avatar_url":"https://avatars0.githubusercontent.com/u/17501718?v=4","gravatar_id":"","url":"https://api.github.com/users/vkonst86","html_url":"https://github.com/vkonst86","followers_url":"https://api.github.com/users/vkonst86/followers","following_url":"https://api.github.com/users/vkonst86/following{/other_user}","gists_url":"https://api.github.com/users/vkonst86/gists{/gist_id}","starred_url":"https://api.github.com/users/vkonst86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkonst86/subscriptions","organizations_url":"https://api.github.com/users/vkonst86/orgs","repos_url":"https://api.github.com/users/vkonst86/repos","events_url":"https://api.github.com/users/vkonst86/events{/privacy}","received_events_url":"https://api.github.com/users/vkonst86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-01T17:29:03Z","updated_at":"2018-02-16T05:21:26Z","closed_at":null,"author_association":"NONE","body":"<!--- To help us fix your issue, please provide the information in the below template. -->\r\n<!--- Note: There is often little we can do without a minimal reproducible sample of the issue, so please provide that in a **standalone git repository** and link it here. -->\r\n<!---  Please only file bugs verified on latest version of MvvmCross and STABLE Xamarin tools --> \r\n\r\n### Steps to reproduce :scroll:\r\n\r\n1. Create an app with root page that  is content or navigation page. Add additional page to project with type of MvxTabbedPage and attribute [MvxTabbedPagePresentation(Position = TabbedPosition.Root, WrapInNavigationPage = false)]\r\n2. When root view is loaded try navigate to tabbed page using IMvxNavigatingService.Navigate and await the call, app will crash with exception \"Cannot replace MainPage\".\r\n\r\n3. The reason of the crash is that MvxFormsApplicationDelegate method FinishedLaunching is not calling base.FinishedLaunching, so FormsApplicationDelegate private field \"_window\" is not initialised, and app crashes at method UpdateMainPage of FormsApplicationDelegate.\r\n\r\n\r\n### Expected behavior :thinking:\r\nMainPage gets replaced\r\n\r\n### Actual behavior :bug:\r\nApp crash\r\n\r\n### Configuration :wrench:\r\n\r\n**Version:** 5.6.x\r\n\r\n**Platform:** \r\n- [x] :iphone: iOS\r\n- [ ] :robot: Android\r\n- [ ] :checkered_flag: WPF\r\n- [ ] :earth_americas: UWP\r\n- [ ] :apple: MacOS\r\n- [ ] :tv: tvOS\r\n- [x] :monkey: Xamarin.Forms\r\n"},"comment":{"url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/comments/366146835","html_url":"https://github.com/MvvmCross/MvvmCross/issues/2577#issuecomment-366146835","issue_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/2577","id":366146835,"user":{"login":"vkonst86","id":17501718,"avatar_url":"https://avatars0.githubusercontent.com/u/17501718?v=4","gravatar_id":"","url":"https://api.github.com/users/vkonst86","html_url":"https://github.com/vkonst86","followers_url":"https://api.github.com/users/vkonst86/followers","following_url":"https://api.github.com/users/vkonst86/following{/other_user}","gists_url":"https://api.github.com/users/vkonst86/gists{/gist_id}","starred_url":"https://api.github.com/users/vkonst86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkonst86/subscriptions","organizations_url":"https://api.github.com/users/vkonst86/orgs","repos_url":"https://api.github.com/users/vkonst86/repos","events_url":"https://api.github.com/users/vkonst86/events{/privacy}","received_events_url":"https://api.github.com/users/vkonst86/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T05:21:26Z","updated_at":"2018-02-16T05:21:26Z","author_association":"NONE","body":"I'm using workaround for now.\r\n`private void InitializeInternalWindow(UIWindow window)\r\n        {\r\n            var windowField = typeof(FormsApplicationDelegate).GetField(\"_window\", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);\r\n            windowField.SetValue(this, window);\r\n        }`\r\nCall this method in FinishedLaunching after you created UIWindow, and pass it there."}}
{"actor":{"display_login":"vkonst86"}}