Hi-- I'm using Model-View-ViewModel as the architectual pattern for a WPF app, including its wizards. That means each wizard has its own ViewModel, and the wizard's controls are bound directly to ICommands in the ViewModel. This approach eliminates most code-behind.
Here's my problem: I have a process that I want to have execute automatically when a wizard page is opened. For example, in a Restore File Wizard, an interior page gets file paths from the user, then instructs 'Click Next to begin the restore'. The user clicks, and when the next page opens, the restore operation should begin automatically.
I know I can use the WizardPage.Selected event to trigger the action I want. But I'd like to bind to a command, MMVM-style, if that can be done. Since the WizardPage object doesn't have a Command property, it looks like I won't be able to do that. So my question is, is there any other trick that will let me call a property or method on my ViewModel class from XAML when a WizardPage is selected? Thanks.
Here's my problem: I have a process that I want to have execute automatically when a wizard page is opened. For example, in a Restore File Wizard, an interior page gets file paths from the user, then instructs 'Click Next to begin the restore'. The user clicks, and when the next page opens, the restore operation should begin automatically.
I know I can use the WizardPage.Selected event to trigger the action I want. But I'd like to bind to a command, MMVM-style, if that can be done. Since the WizardPage object doesn't have a Command property, it looks like I won't be able to do that. So my question is, is there any other trick that will let me call a property or method on my ViewModel class from XAML when a WizardPage is selected? Thanks.