I would like to use Caliburn.Micro in my new MVVM projects. After reading the documentation, I understood that Caliburn.Micro takes care of the connection between views and view models on its own (if of course the naming convention is followed).
For example, this works great with "ShellView" and "ShellViewModel":
xaml
<TextBox x:Name="CustomerCode"/>
viewmodel
private string _CustomerCode = "Google";
public string CustomerCode
{
get { return _CustomerCode; }
set
{
_CustomerCode = value;
NotifyOfPropertyChange(() => CustomerCode);
}
}
Now when I add new usercontrols (views) to "ShellView" that have their own ViewModels, it no longer works even though I observe naming convention!
example:
in ShellView xaml
<views:DashboardView x:Name="Dashboard"/>
in DashboardView
<TextBox x:Name="CustomerCode"/>
and in DashboardViewModel
private string _CustomerCode = "Google";
public string CustomerCode
{
get { return _CustomerCode; }
set
{
_CustomerCode = value;
NotifyOfPropertyChange(() => CustomerCode);
}
}
However, the texbox "CustomerCode" remains empty.
What have I forgotten?
Thanks
pc