UserControl.xaml canot be edited in Design view (MVVM)

93 Views Asked by At

I'm learning the MVVM pattern coming from regular WPF. A large part of my work is interface based. I love the design view in visual studio and blend so I can quickly position controls to my liking. I'm interested in learning MVVM but when I bind view UserControl to the MainWindow, I'm unable to see the design. I've dug through the settings and cannot find an option that will fix it. Is there a way to view a UserControl in design view?

Any help is greatly appreciated!

1

There are 1 best solutions below

0
On

A usercontrol just works in design view.
You double click the XAML file and it opens in the designer.
If it's entirely constructed from templating which is reliant on viewmodel data then you'd need to provide a viewmodel with that data somehow OR a designer viewmodel.
There are various ways to approach that.
Since you've shown us absolutely no code, it's guess work as to what you've done or what the best route would be to take from there to wherever you want to head.

"quickly position controls to my liking"
That sounds like you're maybe dragging in the designer.
When working with the designer, imo it is a mistake to drag things about on the design surface. You very quickly get something that will only work on your display settings and is a nightmare to troubleshoot layout issues. Instead, edit the XAML and see what you get in the designer.