MVVM/WPF: Button is not disabled although the CanExecute says return value is FALSE ??

Posted by msfanboy on Stack Overflow See other posts from Stack Overflow or by msfanboy
Published on 2010-05-22T09:09:36Z Indexed on 2010/05/22 9:20 UTC
Read the original article Hit count: 466

Filed under:
|
|

Hello,

I have a detach and attach button with Command="..." bound to my ViewModel.

Although I have only 1 selected pupil but have NOT selected a subject the detach button is not disabled, the attach button is ???

alt text

public RelayCommand AttachdSubjecstCommand
    {
        get { return _attachSubjectsCommand ?? (_attachSubjectsCommand = new RelayCommand(() => AttachSubjects(), () => CanAttachSubjects)); }
    }

    public RelayCommand DetachSubjectsCommand
    {
        get { return _detachSubjectsCommand ?? (_detachSubjectsCommand = new RelayCommand(() => DetachSubjects(), () => CanDetachSubjects)); }
    }

© Stack Overflow or respective owner

Related posts about wpf

Related posts about mvvm