{"action":"created","issue":{"url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/issues/361","repository_url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro","labels_url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/issues/361/labels{/name}","comments_url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/issues/361/comments","events_url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/issues/361/events","html_url":"https://github.com/Caliburn-Micro/Caliburn.Micro/issues/361","id":173291282,"number":361,"title":"Old Non-Garbage Collected Views Still Getting Notified?","user":{"login":"mattjacobi","id":21248185,"avatar_url":"https://avatars.githubusercontent.com/u/21248185?v=3","gravatar_id":"","url":"https://api.github.com/users/mattjacobi","html_url":"https://github.com/mattjacobi","followers_url":"https://api.github.com/users/mattjacobi/followers","following_url":"https://api.github.com/users/mattjacobi/following{/other_user}","gists_url":"https://api.github.com/users/mattjacobi/gists{/gist_id}","starred_url":"https://api.github.com/users/mattjacobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattjacobi/subscriptions","organizations_url":"https://api.github.com/users/mattjacobi/orgs","repos_url":"https://api.github.com/users/mattjacobi/repos","events_url":"https://api.github.com/users/mattjacobi/events{/privacy}","received_events_url":"https://api.github.com/users/mattjacobi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/milestones/4","html_url":"https://github.com/Caliburn-Micro/Caliburn.Micro/milestones/v3.1.0","labels_url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/milestones/4/labels","id":1475273,"number":4,"title":"v3.1.0","description":"","creator":{"login":"nigel-sampson","id":1256017,"avatar_url":"https://avatars.githubusercontent.com/u/1256017?v=3","gravatar_id":"","url":"https://api.github.com/users/nigel-sampson","html_url":"https://github.com/nigel-sampson","followers_url":"https://api.github.com/users/nigel-sampson/followers","following_url":"https://api.github.com/users/nigel-sampson/following{/other_user}","gists_url":"https://api.github.com/users/nigel-sampson/gists{/gist_id}","starred_url":"https://api.github.com/users/nigel-sampson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nigel-sampson/subscriptions","organizations_url":"https://api.github.com/users/nigel-sampson/orgs","repos_url":"https://api.github.com/users/nigel-sampson/repos","events_url":"https://api.github.com/users/nigel-sampson/events{/privacy}","received_events_url":"https://api.github.com/users/nigel-sampson/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":0,"state":"open","created_at":"2015-12-27T21:04:07Z","updated_at":"2016-09-01T10:02:03Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-08-25T19:40:26Z","updated_at":"2016-09-01T17:03:32Z","closed_at":null,"body":"I am seeing an odd behavior with Caliburn.Micro 2.0.1 on .NET 4.5. I am curious if I am doing something wrong or if there is perhaps a bug. I've attached a sample project that reproduces the issue I am seeing.\r\n\r\nIn my sample, I have a `Conductor` and two `Screen`. Each time you click one of two the main buttons, it switches the `ActiveItem`. Each time the view model is displayed, the view locator instantiates a new view. However, it appears that all of the old views (until they get garbage collected) are still getting notified when a property changes on the view model.\r\n\r\nTo reproduce the issue, alternate clicks on the two buttons numerous times and look at the Output window in Visual Studio. You will see that when a property changes, one or more old views are getting notified (in addition to the current view). I would expect the old views to be unbound from the view model when they are removed from the view model's `Views` collection.\r\n\r\nThis behavior can get weird when a binding update ends up resulting in a callback from the view into the view model. The view model's method will get called multiple times then (once from each still alive view). Thoughts?\r\n\r\n[OldViewsProblem.zip](https://github.com/Caliburn-Micro/Caliburn.Micro/files/437886/OldViewsProblem.zip)"},"comment":{"url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/issues/comments/244144607","html_url":"https://github.com/Caliburn-Micro/Caliburn.Micro/issues/361#issuecomment-244144607","issue_url":"https://api.github.com/repos/Caliburn-Micro/Caliburn.Micro/issues/361","id":244144607,"user":{"login":"mattjacobi","id":21248185,"avatar_url":"https://avatars.githubusercontent.com/u/21248185?v=3","gravatar_id":"","url":"https://api.github.com/users/mattjacobi","html_url":"https://github.com/mattjacobi","followers_url":"https://api.github.com/users/mattjacobi/followers","following_url":"https://api.github.com/users/mattjacobi/following{/other_user}","gists_url":"https://api.github.com/users/mattjacobi/gists{/gist_id}","starred_url":"https://api.github.com/users/mattjacobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattjacobi/subscriptions","organizations_url":"https://api.github.com/users/mattjacobi/orgs","repos_url":"https://api.github.com/users/mattjacobi/repos","events_url":"https://api.github.com/users/mattjacobi/events{/privacy}","received_events_url":"https://api.github.com/users/mattjacobi/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T17:03:31Z","updated_at":"2016-09-01T17:03:31Z","body":"Thanks for the reply. I get what you are saying. We have a few conductors in our application where we retain view models like this. Actually, in the particular scenario where we noticed this issue, some of the view models are retained and some are not, so always _not_ closing doesn't seem ideal. Maybe we could call `DeactivateItem` with the appropriate bool before calling activate item? A nice solution might be having `ActivateItem` (the above code) dynamically call close with true/false based on a property on the view model that is being closed."}}
{"actor":{"display_login":"mattjacobi"}}