When you set
in xaml you get the error "Your views must implement IView" even when your view already has IView set.
This can be seen in the BasicMVVMQuickstart_Desktop project in the MainWindow.xaml
This does not prevent you from building nor does it give a error at runtime.
The source of the issue is from ViewModelLocator.AutoWireViewModelChanged
private static void AutoWireViewModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
var view = d as IView;
if (view == null)
// TODO: Improve exception
throw new Exception("Your views must implement IView");
d as IView
It appears that the code behind is not processed during design time when the attached property is evaluated. So if you have
public partial class MyClass: UserControl, IView
and you do
inside AutoWireViewModelChanged you will not get the type
instead and therefor the interface IView will not be found.