I'm trying to open a RadWindow in my Caliburn.Micro project, but I'm having trouble tying the dialog's View to the ViewModel.
In my ViewModel I open the dialog using:
The RadWindow is opened, but in it is displayed: "Cannot find view for MyNameSpace.MyViewModel.
Alternatively, when I set RadWindow.Content the following way:
then I see the correct View, but the View's DataContext is never set.
Does anyone know what I'm doing wrong?
In my ViewModel I open the dialog using:
var radWindowViewModel =
new
MyViewModel();
var radWindow =
new
RadWindow
{
Width = 400,
Height = 150,
Content = ViewLocator.LocateForModelType(
typeof
(MyViewModel),
null
, radWindowViewModel)
};
radWindow.ShowDialog();
The RadWindow is opened, but in it is displayed: "Cannot find view for MyNameSpace.MyViewModel.
Alternatively, when I set RadWindow.Content the following way:
Content = ViewLocator.LocateForModel(radWindowViewModel,
null
,
null
)
then I see the correct View, but the View's DataContext is never set.
Does anyone know what I'm doing wrong?