Ok,
Wanting to MVVM an existing app.
The code behind contains the following:
private void UploadClick(object sender, RoutedEventArgs e)
{
/*
* 1. Clear Messages (ObservableCollection)
*
* 2. Create new OpenFileDialog
* 3. if(ofd returns ok)
* Pass file to Interpreter
*/
}
Basically, what I’d like to know is, how would I ‘Commandise’ this?
Should I use an OpenFileDialog in my command in the VM? – This seems wrong as the OFD is a way of passing in a file that is specific to the view.
But how would I do it?
If I hook into the Click event, then call the VM, I’m not using commands…
??
prob the best person to answer this question would be sasha barber (one of the WPF disiples) so here is a link to an article covering just this topic.