0
我想通過編輯單元格樣式將事件處理程序添加到DataTable中的單元格。具體來說,我設置System.Windows.FrameworkElement.TargetUpdated =「...」無效。 'TargetUpdated'必須是RoutedEvent
<EventSetter Event="TargetUpdated" Handler="TaskDescription_TextChanged1Event"/>
而這裏的是我得到的錯誤:
System.Windows.FrameworkElement.TargetUpdated="TaskDescription_TextChanged1Event"
is not valid. 'TargetUpdated' must be a RoutedEvent registered with a name that
ends with the keyword "Event".
下面是TaskDescription_TextChanged1Event代碼:
public void TaskDescription_TextChanged1Event(object sender,
RoutedEventArgs e)
{
}
我應該爲此做工作?
謝謝,這工作。但是,如果我以這種方式設置TaskDescription_TextChanged1Event,則永遠不會調用 – 2012-04-12 22:14:15
@ArsenZahray:您是否設置了['NotifyOnTargetUpdated'](http://msdn.microsoft.com/zh-cn/library/system.windows.data.binding.notifyontargetupdated。 aspx)的綁定?另外爲什麼你不使用['TextChanged'](http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.textchanged.aspx)或其他? – 2012-04-12 22:30:11
我很想,但我無法弄清楚如何在ContentPresenter中使用TextChanged – 2012-04-13 06:29:36