{"action":"created","issue":{"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/634","repository_url":"https://api.github.com/repos/xamarin/Xamarin.Forms","labels_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/634/labels{/name}","comments_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/634/comments","events_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/634/events","html_url":"https://github.com/xamarin/Xamarin.Forms/pull/634","id":194788944,"number":634,"title":"[UWP] Fix Navigate/Switch to exist page performance and lost state problem in real phone","user":{"login":"huangjinshe","id":3822799,"avatar_url":"https://avatars.githubusercontent.com/u/3822799?v=3","gravatar_id":"","url":"https://api.github.com/users/huangjinshe","html_url":"https://github.com/huangjinshe","followers_url":"https://api.github.com/users/huangjinshe/followers","following_url":"https://api.github.com/users/huangjinshe/following{/other_user}","gists_url":"https://api.github.com/users/huangjinshe/gists{/gist_id}","starred_url":"https://api.github.com/users/huangjinshe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huangjinshe/subscriptions","organizations_url":"https://api.github.com/users/huangjinshe/orgs","repos_url":"https://api.github.com/users/huangjinshe/repos","events_url":"https://api.github.com/users/huangjinshe/events{/privacy}","received_events_url":"https://api.github.com/users/huangjinshe/received_events","type":"User","site_admin":false},"labels":[{"id":370047470,"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/labels/cla-signed","name":"cla-signed","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-10T19:37:23Z","updated_at":"2016-12-11T07:33:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/pulls/634","html_url":"https://github.com/xamarin/Xamarin.Forms/pull/634","diff_url":"https://github.com/xamarin/Xamarin.Forms/pull/634.diff","patch_url":"https://github.com/xamarin/Xamarin.Forms/pull/634.patch"},"body":"### Description of Change ###\r\n\r\nWhen we navigate to some page and navigate to other page and back or switch exist Details page, or change App.MainPage to exist page, the page last state fill lost, like ScrollViewer position...etc, and also the navigate/switch speed still very slow. This will fix that problem.\r\n(Note: **Navigate animation unable to use currently after apply this**, but I think temporarily it's fine, the navigate animation too ugly, I think no one will use animation for now)\r\n\r\nThe basic idea is that use Canvas, put pages to the canvas, and when navigate to new page, hide the old page, navigate back just show it again. It will  more faster navigate or switch to the exist page now, especially when the page has a a lot of controls or ListView, Because the Phone is using ARM, it would be a big performance problem if every time navigate/switch will unload and load exist page such like a new page. So I just change the idea\r\n\r\nCurrently improved type of pages:\r\n1.App.MainPage\r\n2.NavigationPage\r\n3.MasterDetailPage\r\n\r\n\r\n\r\n### Bugs Fixed ###\r\n\r\nhttps://bugzilla.xamarin.com/show_bug.cgi?id=46856\r\nhttps://bugzilla.xamarin.com/show_bug.cgi?id=48682\r\nhttps://bugzilla.xamarin.com/show_bug.cgi?id=38260\r\n\r\n\r\n### API Changes ###\r\n\r\nNone\r\n\r\nAdded:\r\n - Xamarin.Forms.Platform.UWP.MasterDetailControl Add Detail , its' a  Canvas. also add internal method CheckContentIfExist\r\n - Xamarin.Forms.Platform.UWP.MasterDetailControl Add Detail , its' a  Canvas. also add internal method CheckContentIfExist\r\n - Xamarin.Forms.Platform.WinRT/PageControl.xaml Add Canvas in the content, replace Content and add internal method CheckContentIfExist\r\n\r\n\r\nChanged:\r\n - Xamarin.Forms.Platform.UWP.MasterDetailControl Detail rename to DetailContent\r\n - Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer change logic: do not clear the page every time switch pages(for that manually fire SendDisappearing and SendAppearing)\r\n - Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs change logic: do not clear the page every time switch pages(for that manually fire SendDisappearing and SendAppearing)\r\n - Xamarin.Forms.Platform.WinRT/Platform change logic: do not clear the page every time switch pages\r\n\r\n### Behavioral Changes ###\r\n\r\nIn the original mode: every time when use these:\r\nApp.MainPage = existPage;\r\nNavigationPage.push(existPage) or pop();\r\nMasterDetailPage.Detail = existPage;\r\n\r\nit will always clean and dispose the old page, when user want to switch back the last page, it need to reload all things, that's a really bad design, we should recommend developer use exist page more, because every open or display a page unload and load it will cause to much performance, also last page state will lose(Like ListView or ScrollViever scroll position will reset)\r\n\r\n### PR Checklist ###\r\n\r\n- [x] Has tests (if omitted, state reason in description)\r\n- [ ] Rebased on top of master at time of PR\r\n- [ ] Changes adhere to coding standard\r\n- [ ] Consolidate commits as makes sense\r\n"},"comment":{"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/comments/266268002","html_url":"https://github.com/xamarin/Xamarin.Forms/pull/634#issuecomment-266268002","issue_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/634","id":266268002,"user":{"login":"huangjinshe","id":3822799,"avatar_url":"https://avatars.githubusercontent.com/u/3822799?v=3","gravatar_id":"","url":"https://api.github.com/users/huangjinshe","html_url":"https://github.com/huangjinshe","followers_url":"https://api.github.com/users/huangjinshe/followers","following_url":"https://api.github.com/users/huangjinshe/following{/other_user}","gists_url":"https://api.github.com/users/huangjinshe/gists{/gist_id}","starred_url":"https://api.github.com/users/huangjinshe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huangjinshe/subscriptions","organizations_url":"https://api.github.com/users/huangjinshe/orgs","repos_url":"https://api.github.com/users/huangjinshe/repos","events_url":"https://api.github.com/users/huangjinshe/events{/privacy}","received_events_url":"https://api.github.com/users/huangjinshe/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T07:33:51Z","updated_at":"2016-12-11T07:33:51Z","body":"Also I think maybe this PR will resolve some memory leak problems. before every time navigate to exist page (because original design is unload and reload it again), there is a memory issue, specially there are a ListView, but after we changed now, we don't need unload and load again, it will no more cause that problem(at least the memory leak not so seriously)."}}
{"actor":{"display_login":"huangjinshe"}}