You should consider using an MVVM framework if you are doing MVVM.
It would depend on whose responsibility it was to load the XML, but I would suggest the XmlViewModel
, not the MainViewModel
.
In that case the MainViewModel
should just be a conductor of other view models. In your first case, it would instantiate the XmlViewModel
, passing the file path and set it as its current view.
The XmlViewModel
would be responsible for loading and validating the XML. It too could have a child view model which displays the validation errors. It should load the XML asynchronously, with some form of busy notification.
The MainViewModel
is likely to want to conduct many view models, so if you were going to use a framework such as Caliburn.Micro, this would be a conductor type.