ReactiveUI icon indicating copy to clipboard operation
ReactiveUI copied to clipboard

RxUI-7 : NavigateAndReset not working

Open kiwipiet opened this issue 10 years ago • 5 comments

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.

kiwipiet avatar Jun 29 '16 09:06 kiwipiet

Which platform? Xamarin.Forms?

ghuntley avatar Jun 29 '16 10:06 ghuntley

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 avatar Jun 29 '16 11:06 kentcb

@kentcb, I saw that in the tests and was going to give it a try today. Works perfectly now, thank you.

kiwipiet avatar Jun 29 '16 17:06 kiwipiet

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.

kentcb avatar Jun 29 '16 22:06 kentcb

Also, there is comprehensive docs on commands here.

kentcb avatar Jun 29 '16 23:06 kentcb