I have recently parametrized my ViewModel's contructor. Before that, I was doing this in my window:
<Window.DataContext>
<vm:MyViewModel />
</Window.DataContext>
The framework instantiated the ViewModel for me.
I know I can set DataContext in code but I would prefer a XAML way so designer can display my test data when designing.
Is this possible?
I have no idea how to pass a contructor-parameter, I think it can't be done (but it would be nice if someone proved me wrong).
What you can do is set properties on your ViewModel, as in
Use an ObjectDataProvider if you want to specify constructor parameters: