I\'ve been playing with the Caliburn Micro MVVM framework and am having some problems with guard methods.
I have a view model:
public class MyViewModel :
Ok I figured it out. I didn't realise that you have to fire the guard method notification, thought the framework did that, but it makes sense.
So I change my property setter to:
public DateTime? Date
{
get
{
return this.date;
}
set
{
this.date = value;
this.NotifyOfPropertyChange(() => Date);
this.NotifyOfPropertyChange(() => CanCalculate);
}
}
and changed my CanCalculate
method to a property:
public bool CanCalculate
{
get
{
return this.Date.HasValue;
}
}
And all works fine now :)