zoukankan      html  css  js  c++  java
  • WPF DataGridRow Event

    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事件。

  • 相关阅读:
    Azkaban 简介(一)
    大数据平台搭建(Ambari +HDP)
    大数据平台比较-CDH、HDP、CDP
    Kylin 操作使用(六)
    Kylin 安装部署(五)
    Kylin 核心概念(四)
    数据流图
    android:sharedUserId
    Android的uid与UserHandle
    C++ 多态
  • 原文地址:https://www.cnblogs.com/ligl/p/7007489.html
Copyright © 2011-2022 走看看