1

I have created a Wizard using Orc.Wizard. My WizardPage has several backing items:

public LoadOptions LoadOpts {get; set;}
public string FolderPath {get; set;}

In my ViewModel I am using the [ViewModelToModel] to expose the classes and the properties of those classes in my WizardPage model using this method.

[ViewModelToModel]
public string FolderPath {get; set;}

[ViewModelToModel]
[Expose("PropertyA")]
[Expose("PropertyB")]
public LoadOptions LoadOpts {get; set; }

Any suggestions would be greatly appreciated. NOTE: All of the example applications I can find just use simple fields like "string", none of them have class in the backing WizardPage.

Michael Wade
  • 205
  • 2
  • 5

1 Answers1

0

In order to expose, you will need to decorate your property with the Model attribute:

[ViewModelToModel(nameof(LoadOpts))]
public string FolderPath {get; set;}

[Model]
[Expose("PropertyA")]
[Expose("PropertyB")]
public LoadOptions LoadOpts {get; set; }
Geert van Horrik
  • 5,689
  • 1
  • 18
  • 32
  • Thanks. In your response you put the [ViewModelToModel(nameof(LoadOpts))] on a different item. If I use the [Model] will that still use the backing WizardPage and map the data to it? – Michael Wade Jun 07 '17 at 12:51