{"action":"created","issue":{"url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1169","repository_url":"https://api.github.com/repos/reactiveui/ReactiveUI","labels_url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1169/labels{/name}","comments_url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1169/comments","events_url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1169/events","html_url":"https://github.com/reactiveui/ReactiveUI/issues/1169","id":179516796,"number":1169,"title":"ViewModelActivator does not work in XamForms","user":{"login":"escamoteur","id":16635729,"avatar_url":"https://avatars.githubusercontent.com/u/16635729?v=3","gravatar_id":"","url":"https://api.github.com/users/escamoteur","html_url":"https://github.com/escamoteur","followers_url":"https://api.github.com/users/escamoteur/followers","following_url":"https://api.github.com/users/escamoteur/following{/other_user}","gists_url":"https://api.github.com/users/escamoteur/gists{/gist_id}","starred_url":"https://api.github.com/users/escamoteur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escamoteur/subscriptions","organizations_url":"https://api.github.com/users/escamoteur/orgs","repos_url":"https://api.github.com/users/escamoteur/repos","events_url":"https://api.github.com/users/escamoteur/events{/privacy}","received_events_url":"https://api.github.com/users/escamoteur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-27T14:54:02Z","updated_at":"2016-09-28T06:41:11Z","closed_at":null,"body":"**Do you want to request a *feature* or report a *bug*?**\r\nBug\r\n\r\n\r\n**What is the current behavior?**\r\nInstead as descibed in https://docs.reactiveui.net/en/user-guide/when-activated/index.html\r\n\r\nthe Action passed to this.WhenActivated does not get called on ViewModels in XamForms. It does work on Views.\r\n\r\nThat's the ViewModel:\r\n\r\n```\r\nnamespace PlaygroundXamForms\r\n{\r\n    public class MainPageViewModel : ReactiveObject, IRoutableViewModel, ISupportsActivation\r\n    {\r\n\r\n        public string UrlPathSegment { get; }\r\n        public IScreen HostScreen { get; }\r\n\r\n\r\n        public MainPageViewModel(IScreen screen = null)\r\n        {\r\n            HostScreen = screen ?? Locator.Current.GetService<IScreen>();\r\n\r\n            SavedGuid = Guid.NewGuid();\r\n\r\n\r\n            this.WhenActivated(d => \r\n            {\r\n                d(NavigateToListView = ReactiveCommand.CreateFromObservable(\r\n                    () => HostScreen.Router.Navigate.Execute(new DemoListViewViewModel(HostScreen))));\r\n            });\r\n\r\n        }\r\n\r\n\r\n        public ReactiveCommand NavigateToListView { get; protected set; }\r\n\r\n\r\n        Guid savedGuid;\r\n        private readonly ViewModelActivator activator = new ViewModelActivator();\r\n\r\n        public Guid SavedGuid {\r\n            get { return savedGuid; }\r\n            set { this.RaiseAndSetIfChanged(ref savedGuid, value); }\r\n        }\r\n\r\n\r\n        ViewModelActivator ISupportsActivation.Activator\r\n        {\r\n            get { return activator; }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nYou can test it using my PR \r\n\r\nhttps://github.com/reactiveui/ReactiveUI/pull/1168\r\n\r\nIn the commited Version in MainPageViewModel.cs the this.WenActived is commented out.\r\n\r\n\r\n**Which versions of ReactiveUI, and which platform / OS are affected by this issue? \r\nV7 XamarinForms Android\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/comments/250084704","html_url":"https://github.com/reactiveui/ReactiveUI/issues/1169#issuecomment-250084704","issue_url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1169","id":250084704,"user":{"login":"escamoteur","id":16635729,"avatar_url":"https://avatars.githubusercontent.com/u/16635729?v=3","gravatar_id":"","url":"https://api.github.com/users/escamoteur","html_url":"https://github.com/escamoteur","followers_url":"https://api.github.com/users/escamoteur/followers","following_url":"https://api.github.com/users/escamoteur/following{/other_user}","gists_url":"https://api.github.com/users/escamoteur/gists{/gist_id}","starred_url":"https://api.github.com/users/escamoteur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escamoteur/subscriptions","organizations_url":"https://api.github.com/users/escamoteur/orgs","repos_url":"https://api.github.com/users/escamoteur/repos","events_url":"https://api.github.com/users/escamoteur/events{/privacy}","received_events_url":"https://api.github.com/users/escamoteur/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T06:41:11Z","updated_at":"2016-09-28T06:41:11Z","body":"I just had a look at ReactiveContentPage, but I don't see a difference to my ViewClass as it implements IViewFor<> too. What does ReactiveContentPage more?"}}
{"actor":{"display_login":"escamoteur"}}