private RelayCommand _myRelay;
/// <summary>
/// Gets the MyRelay.
/// </summary>
public RelayCommand MyRelay
{
get
{
return _myRelay
?? (_myRelay = new RelayCommand(
() =>
{
// I can Run my relay
}, () => CanMyRelayRun));
}
}
private Customer _canMyRelayRun;
public Customer CanMyRelayRun
{
get { return _canMyRelayRun; }
set
{
_canMyRelayRun = value;
RaisePropertyChanged();
}
}
Now if I set the boolean property to true in the code, my button never re enables.. I am using Galasofts MVVM light which I believe is a popular MVVM toolkit. I was wondering if anyone else has encountered this problem? A workaround at the moment is to bind the isenabled property of my button to the boolean CanMyRelayRun. But if I have to do this for every button this could get messy. Is this a problem with forms? Mayb the default binding on the IsEnabled property only being OneWay or something?