This question is not related to the MediaElement
—pertaining to this, I’ve read both MediaElement.play() from within ViewModel and MVVM pattern violation: MediaElement.Play(), and I agree with both of them.
But say that we’re using instead a third-party assembly such as NAudio. We don’t have to find a way of plugging an existing XAML media control’s interactive features into our ViewModel. Instead, we can simply use, e.g., InteractionTrigger
s in our View, subscribe to it in our ViewModel, and invoke the play command on a given media file.
Now my question is: is this still something that fits, within the MVVM pattern, into the ViewModel? Or should we rather hand this down to the Model and play the file from there?