当前位置: 首页 > news >正文

WPF 绑定 DataGrid 里面 Button点击事件 TextBlock 双击事件

TextBlock双击事件

<DataGridTemplateColumn Width="*" Header="内标"><DataGridTemplateColumn.CellTemplate><DataTemplate><Grid><TextBlockBackground="Transparent"Tag="{Binding InternalId}"Text="{Binding InternalId}"><TextBlock.InputBindings><MouseBindingCommand="{Binding DataContext.InternalClickCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}"CommandParameter="{Binding}"MouseAction="LeftDoubleClick" /></TextBlock.InputBindings></TextBlock></Grid></DataTemplate></DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

Button点击事件

<DataGridTemplateColumn Width="*" Header="内标"><DataGridTemplateColumn.CellTemplate><DataTemplate><Grid><ButtonBackground="Transparent"BorderBrush="Transparent"Command="{Binding Path=DataContext.InternalClickCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}"Content="{Binding InternalId}"Tag="{Binding InternalId}" /></Grid></DataTemplate></DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
 [RelayCommand]private void InternalClick(GuantifyCompound guantifyCompound){MessageBox.Show("=InternalClick=" + guantifyCompound.LeftWidth);}
http://www.lryc.cn/news/445851.html

相关文章:

  • 828华为云征文|华为云Flexus云服务器X实例Windows系统部署一键短视频生成AI工具moneyprinter
  • 非标精密五金加工的技术要求
  • 新手小白怎么通过云服务器跑pytorch?
  • Spring 全家桶使用教程
  • Spark SQL性能优化高频面试题及答案
  • 云原生链路观测平台 openobserve + fluent-bit,日志收集
  • Android 车载应用开发指南 - CarService 详解(下)
  • 【Linux网络 —— 网络基础概念】
  • el-form动态标题和输入值,并且最后一个输入框不校验
  • 一,初始 MyBatis-Plus
  • 安卓13删除下拉栏中的关机按钮版本2 android13删除下拉栏关机按钮
  • 快递物流单号识别API接口代码
  • AI时代的程序员:如何保持和提升核心竞争力
  • Oracle 数据库常用命令与操作指南
  • spring boot项目对接人大金仓
  • 《操作系统 - 清华大学》1 -2:操作系统概述 —— 什么是操作系统
  • power bi制作各季度收入累加柱状图——日期表、calculate、datesytd
  • OceanBase 3.X 高可用 (一)
  • CSR、SSR、SSG
  • linux -L16-linux 查看应用占用的资源top
  • QT——多线程操作
  • 理解C语言之深入理解指针(三)
  • 「芯片知识」MP3解码ic方案,音乐芯片在数字音频中的作用
  • MyBatis与 Springboot 的集成
  • 迁移学习和外推关系
  • 小程序-生命周期与WXS脚本
  • 828华为云征文 | 云服务器Flexus X实例,Docker集成搭建FC-web模拟器
  • _RET_IP_ 和_THIS_IP_ 作用
  • Spring Boot 点餐系统:高效餐饮服务
  • RtspServer:轻量级RTSP服务器和推流器