0

I noticed that the OnNavigationCompleted event in the Catel's ViewModel overriden method did not fire for the first page. Is this by design?

Is there any way I could execute codes after the page has been loaded, not in the ViewModel's constructor itself?

Thank you!!

DeuS
  • 17
  • 5
  • I've managed to resolve this via EventToCommand, chaining the Loaded event to custom command specified in the ViewModel. But I'm still interested to know why the OnNavigationCompleted event is not fired for the first View/ViewModel. [Reference Catel's EventToCommand][1] [1]: https://catelproject.atlassian.net/wiki/display/CTL/EventToCommand – DeuS Jan 12 '14 at 12:24

1 Answers1

0

You should use the Initialize method. This method is always called when a view is loaded. The first page isn't caused by a navigation, so that's why you don't get a OnNavigationCompleted. The first page should be initialized in the Initialize method.

Geert van Horrik
  • 5,689
  • 1
  • 18
  • 32