Do you think you are entering your view in the ViewModel using an interface to maintain separation? I know this violates MVVM, but I have successfully used this in a number of WPF projects. I call it MiVVM or ModelModel to view the ViewModel of the model .
The template is simple. Your Usercontrol should have an interface, name it IView. Then in ViewModel you have a property with an installer of type IMyView, say
public IMyView InjectedView { set { _injectedView = value; } }
Then, a dependency property called This is created in the view.
public MyUserControl : IMyView
{
public static readonly DependencyProperty ThisProperty =
DependencyProperty.Register("This", typeof(IMyView), typeof(MyUserControl));
public MyUserControl()
{
SetValue(ThisProperty, this);
}
public IMyView This { get { return GetValue(ThisProperty); } set { } }
}
Finally, in Xaml, you can enter a view directly in the ViewModel using the binding
<MyUserControl This="{Binding InjectedView, Mode=OneWayToSource}"/>
! , , . , (Viewmodel , IView ), . , . , ?
, . Attached Property MiVVM, .