我对一件事感到困惑。当我(string firstName)从称为ClearText和的方法(或其中一种方法)中删除参数CanClearText时,清除数据后该按钮不会变为禁用状态。你能解释发生了什么吗?这是财产;public string FirstName{ get { return _firstName; } set { _firstName = value; NotifyOfPropertyChange(() => FirstName); }}这些是方法:public bool CanClearText(string firstName){ return !string.IsNullOrWhiteSpace(FirstName);}public void ClearText(string firstName){ FirstName = "";}这是相应的文本框和按钮<TextBox x:Name ="FirstName" MinWidth="100" Grid.Column="1" Grid.Row="2"></TextBox><Button Grid.Row="4" Grid.Column="1" x:Name="ClearText"> Clear Names </Button>
1 回答
- 1 回答
- 0 关注
- 151 浏览
添加回答
举报
0/150
提交
取消