CommandBinding question. How to enable command button
My code is here>> public class Player:INotifyPropertyChanging { string addressBar; public string Url { get { return addressBar; } set { addressBar = value; OnPropertyChanged("Url"); } } public Regex regVillage = new Regex(@"\?doc=\d+&sys=[a-zA-Z0-9]{2}"); RelayCommand _AddAttackTask; public ICommand AddAttackTask { get { if (_AddAttackTask == null) { _AddAttackTask = new RelayCommand(param => { }, param => this.CanAttack); } return _AddAttackTask; } } public Boolean CanAttack { get{ if (Url == null) return false; return regVillage.IsMatch(Url); } } } On the xaml, i have textbox and button.