WPF DataGridRow Event
生活随笔
收集整理的這篇文章主要介紹了
WPF DataGridRow Event
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
CM(Caliburn.Micro)框架綁定DataGridRow事件
1 <DataGrid.ItemContainerStyle> 2 <Style TargetType="DataGridRow"> 3 <Setter Property="cm:Message.Attach" 4 Value="[Event MouseLeftButtonUp] = [Action RowCheckSetting_MouseLeftButtonUp($source,$eventArgs)];[Event KeyUp] = [Action RowCheckSetting_KeyUp($eventArgs)]" /> 5 </Style> 6 </DataGrid.ItemContainerStyle> public void RowCheckSetting_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
//todo
}
EventSetter事件方式處理
<DataGrid.ItemContainerStyle><Style TargetType="DataGridRow"><EventSetter Event="MouseDoubleClick"Handler="DataGrid_MouseDoubleClick"></EventSetter><Setter Property="cm:Message.Attach"Value="[Event MouseDoubleClick] = [Action OnSummaryDataGridMouseDoubleClick($source)]" /></Style></DataGrid.ItemContainerStyle>Handler對應的事件
private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e){}上面代碼使用CM框架和EventSetter方式處理DataGridRow的雙擊事件,當然也可以使用其他的Click事件。
?
轉載于:https://www.cnblogs.com/ligl/p/7007489.html
《新程序員》:云原生和全面數(shù)字化實踐50位技術專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的WPF DataGridRow Event的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: scrapy-splash抓取动态数据例
- 下一篇: ssh-keys git