{"action":"created","issue":{"url":"https://api.github.com/repos/OkraFramework/Okra.Core/issues/80","labels_url":"https://api.github.com/repos/OkraFramework/Okra.Core/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/OkraFramework/Okra.Core/issues/80/comments","events_url":"https://api.github.com/repos/OkraFramework/Okra.Core/issues/80/events","html_url":"https://github.com/OkraFramework/Okra.Core/issues/80","id":95742536,"number":80,"title":"Memory usage","user":{"login":"bregol","id":13386408,"avatar_url":"https://avatars.githubusercontent.com/u/13386408?v=3","gravatar_id":"","url":"https://api.github.com/users/bregol","html_url":"https://github.com/bregol","followers_url":"https://api.github.com/users/bregol/followers","following_url":"https://api.github.com/users/bregol/following{/other_user}","gists_url":"https://api.github.com/users/bregol/gists{/gist_id}","starred_url":"https://api.github.com/users/bregol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bregol/subscriptions","organizations_url":"https://api.github.com/users/bregol/orgs","repos_url":"https://api.github.com/users/bregol/repos","events_url":"https://api.github.com/users/bregol/events{/privacy}","received_events_url":"https://api.github.com/users/bregol/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OkraFramework/Okra.Core/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"Andy-Wilkinson","id":7702119,"avatar_url":"https://avatars.githubusercontent.com/u/7702119?v=3","gravatar_id":"","url":"https://api.github.com/users/Andy-Wilkinson","html_url":"https://github.com/Andy-Wilkinson","followers_url":"https://api.github.com/users/Andy-Wilkinson/followers","following_url":"https://api.github.com/users/Andy-Wilkinson/following{/other_user}","gists_url":"https://api.github.com/users/Andy-Wilkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/Andy-Wilkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andy-Wilkinson/subscriptions","organizations_url":"https://api.github.com/users/Andy-Wilkinson/orgs","repos_url":"https://api.github.com/users/Andy-Wilkinson/repos","events_url":"https://api.github.com/users/Andy-Wilkinson/events{/privacy}","received_events_url":"https://api.github.com/users/Andy-Wilkinson/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-07-17T20:52:29Z","updated_at":"2015-07-26T09:23:18Z","closed_at":null,"body":"Is there a way with Okra to either mark a view/viewmodel as shared, or to dispose of view/viewmodel to keep MEF from retaining several copies.  I have an app using Okra where the user goes from home page to details page several times, and each time the details page is loaded, it is a new object in memory.  This is a problem when each copy takes up a bit of memory.  Is there a way with Okra to either release the memory when the details page navigates back to the home page, or to share the viewmodel so all details pages recycle the same object, to prevent this?"},"comment":{"url":"https://api.github.com/repos/OkraFramework/Okra.Core/issues/comments/124963442","html_url":"https://github.com/OkraFramework/Okra.Core/issues/80#issuecomment-124963442","issue_url":"https://api.github.com/repos/OkraFramework/Okra.Core/issues/80","id":124963442,"user":{"login":"Andy-Wilkinson","id":7702119,"avatar_url":"https://avatars.githubusercontent.com/u/7702119?v=3","gravatar_id":"","url":"https://api.github.com/users/Andy-Wilkinson","html_url":"https://github.com/Andy-Wilkinson","followers_url":"https://api.github.com/users/Andy-Wilkinson/followers","following_url":"https://api.github.com/users/Andy-Wilkinson/following{/other_user}","gists_url":"https://api.github.com/users/Andy-Wilkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/Andy-Wilkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andy-Wilkinson/subscriptions","organizations_url":"https://api.github.com/users/Andy-Wilkinson/orgs","repos_url":"https://api.github.com/users/Andy-Wilkinson/repos","events_url":"https://api.github.com/users/Andy-Wilkinson/events{/privacy}","received_events_url":"https://api.github.com/users/Andy-Wilkinson/received_events","type":"User","site_admin":false},"created_at":"2015-07-26T09:23:18Z","updated_at":"2015-07-26T09:23:18Z","body":"Good to hear that you got your original issue solved - event handlers in view-models are always a bit tricky. One alternative that you might want to consider is to move the network state handling into a service, and import that into the view-model via the IoC container. A single service can then run in the background and be shared by all pages - very much depends on your use-case if this works, or you just end up with different event handlers to release.\r\n\r\nRegarding the issues with the settings flyouts - I never really had a good model for navigation awareness for them. I'll have a look and see if I can come up with something. It may be rare that users go to the settings pane, but it's still a memory leak.\r\n\r\nAndy"}}