1

I have created a Wizard with 4 pages using Orc.Wizard. When I attempt to navigate to the 2'nd page the viewModelLocator in the WizardPageSelectionBehavior is not able to resolve the ViewModel that is associated with the WizardPage.

I have named all of my Wizard ViewModels, Wizard Pages and Wizard Views the same way:

Page 0 is using the following classes:

DatConfigWizardPageViewModel DatConfigWizardPageView DatConfigWizardPage

Page 1:

LoadOptionsWizardPageViewModel LoadOptionsWizardPageView LoadOptionsWizardPage

I have 2 other pages, but it is only the 2'nd page that it fails to resolve the ViewModel associated with the Wizard Page. Does anybody have any suggestions on how to determine why this is happening and how to resolve it?

Michael Wade
  • 205
  • 2
  • 5

1 Answers1

0

You can enable debug logging for Catel at your app startup:

LogManager.AddDebugLogListener();

Then you have extremely detailed info why the type cannot be resolved and/or constructed.

A few possible options:

  1. Make sure the constructor is public (will be shown in the debug logging if this is not the case)
  2. Make sure the injected types inside the constructor are registered in the ServiceLocator (will be shown in the debug logging if this is not the case)
  3. There might be a typo (casing) somewhere, but I double checked your names in this ticket and they seem correct.
Geert van Horrik
  • 5,689
  • 1
  • 18
  • 32
  • Thanks. I have added the call to LogManager.AddDebugLogListener(); However, I am getting only abbreviated logging from the components in the Orc.Wizard library. Here is a shot of what that is looking like. 09:07:38:769 => [DEBUG] [Orc.Wizard.WizardBase] [8] Adding page 'DesktopTool.Wizards.Models.DatFileConfigWizardPage' to index '0' 09:07:38:952 => [DEBUG] [Orc.Wizard.WizardBase] [8] Adding page 'DesktopTool.Wizards.Models.OptsWizardPage' to index '1' – Michael Wade Jun 02 '17 at 13:09
  • Make sure to set "ignoreCatelLogging" to *false* – Geert van Horrik Jun 02 '17 at 17:31
  • 1
    Yep, did that. I have resolved the issue but I still don't really understand why (didn't trace through the catel code enough to figure it out yet). I just created NEW classes and named them OptsWizardPage OptsWizardPageView OptsWizardPageViewModel The view models resolve properly now. I will trace with the old names but looking at the naming conventions I couldn't see any obvious reason it wasn't working. BTW, Catel really has some nice features. Really nice job with it overall. – Michael Wade Jun 04 '17 at 02:30
  • 1
    Finally found the actual issue. I had accidentally had a sub-namespace in my class declaration so the Assembly Name lookup was something like: "App.Wizards.ViewModel.App.Wizards.ViewModel" which caused the lookup to fail in the type cache for this ViewModel. – Michael Wade Jun 06 '17 at 12:19