I have a button attached to ICommand
<Button Content="Remove" Command="{Binding RemoveCommand}" x:Name="btnRemove" Visibility="Collapsed" />
After completing some tasks, I made the button visible, except that they look disabled until I click something, why? RemoveCommand looks below
public ICommand RemoveCommand { get { if (_removeCommand == null) { _removeCommand = new RelayCommand(() => { if (RemoveRequested != null) RemoveRequested(this, EventArgs.Empty); }, () => { // CanExecute Callback if (Status == WorkStatus.Processing || Status == WorkStatus.Pending) { Debug.WriteLine("Returning False" + Status); return false; } Debug.WriteLine("Returning True"); return true; // After uploads, this returns True, in my Output Window. }); } return _removeCommand; }
after loading, the CanExecute returns True, so the button must be turned on, but it is disabled until I clicked something, why is this happening?
Problem video

c # wpf
Jiew meng
source share