我有许多由代码动态创建的文本框。
我想要为所有文本框分配一个通用的事件处理程序,用于文本更改事件,然后在处理程序中确定哪个文本框触发了该事件。
我目前拥有的代码是:
txtStringProperty.TextChanged += TextBoxValueChanged;
private void TextBoxValueChanged(object sender, RoutedEventArgs e)
{
string propertyName = // I would like the name attribute of the textbox here
}
如果您需要更多信息,请告知。