RxUI-7 : NavigateAndReset not working
Been trying out the new rxui7 bits from myget on an existing 6.5 code base Everything seems to be executing except when I call HostScreen.Router.NavigateAndReset.Execute (new viewmodel()). The viewmodel gets created but then the app just sits there I've checked and the HostScreen.Router.NavigationStack only has the one new viewmodel.
Which platform? Xamarin.Forms?
Hi @kiwipiet
Since RxUI 7, command execution is lazy. You need to subscribe to the return value of Execute in order for the command to actually execute.
@kentcb, I saw that in the tests and was going to give it a try today. Works perfectly now, thank you.
np @kiwipiet. I realised later that I explained incorrectly. The command execution has always been lazy, but in RxUI6 the ICommand interface was implemented implicitly and its Execute method was eager (because it returns void). The ExecuteAsync method was lazy.
In RxUI7 we made ICommand an explicit implementation to encourage people to use the Rx implementation. This allowed us to rename it as well since there was no clash. Hence, it's now called Execute and is still lazy.
Also, there is comprehensive docs on commands here.