silverlight wpf DataTemplate Command binding
<Grid x:Name="LayoutRoot" Background="White">
<CommonControl:NoapDataGrid MinHeight="120" Margin="10,0,10,10" HorizontalAlignment="Stretch" AutoGenerateColumns="False" ItemsSource="{Binding FtpFiles}" >
<CommonControl:NoapDataGrid.Columns>
<c1:DataGridTextColumn Header="文件名称" Binding="{Binding FileName}" />
<c1:DataGridTextColumn Header="文件类型" Binding="{Binding FileType}" />
<c1:DataGridTemplateColumn Header="操作">
<c1:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<HyperlinkButton Content="下载" Command="{Binding DataContext.DownloadFtpFileCommand, RelativeSource={RelativeSource AncestorLevel=2,AncestorType=Grid}}"/>
</DataTemplate>
</c1:DataGridTemplateColumn.CellTemplate>
</c1:DataGridTemplateColumn>
</CommonControl:NoapDataGrid.Columns>
</CommonControl:NoapDataGrid>
</Grid>
或者
<c1:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<HyperlinkButton Content="下载" Command="{Binding DataContext.DownloadFtpFileCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}"/>
</DataTemplate>
</c1:DataGridTemplateColumn.CellTemplate>
silverlight wpf DataTemplate Command binding的更多相关文章
- A memory leak issue with WPF Command Binding
Background In our application, we have a screen which hosts several tabs. In each tab, it contains a ...
- WPF Custom Command And Binding
using System; using System.Collections.Generic; using System.Windows.Input; namespace WPF.Commands { ...
- WPF Command Binding
<Window x:Class="WpfTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/200 ...
- WPF MVVM,Prism,Command Binding
1.添加引用Microsoft.Practices.Prism.Mvvm.dll,Microsoft.Practices.Prism.SharedInterfaces.dll: 2.新建文件夹,Vie ...
- 扩展ArcGIS API for Silverlight/WPF 中的TextSymbol支持角度标注
原文 http://blog.csdn.net/esricd/article/details/7587136 在ArcGIS API for Silverlight/WPF中原版的TextSymbol ...
- MVVM Command Binding: InvokeCommandAction v.s. EventToCommand
This gives you the ability to create a trigger on an event and bind it to an ICommand on the view mo ...
- (WPF, MVVM) Slider Binding.
对于Button的Command的绑定可以通过实现ICommand接口来进行,但是Slider并没有Command属性. 另外如果要实现MVVM模式的话,需要将一些Method和Slider的Even ...
- 【转】WPF中的Binding技巧(二)
WPF中的Binding技巧(二) 接上篇, 我们来看一看Elementname,Source,RelativeSource 三种绑定的方式 1.ElementName顾名思义就是根据Ui元素 ...
- WPF 定义Command
直接上代码: public class LoginDelegateCommand : ICommand { private Action _execute; private Predicate< ...
随机推荐
- Linux 程序设计学习笔记----Linux下文件类型和属性管理
转载请注明出处:http://blog.csdn.net/suool/article/details/38318225 部分内容整理自网络,在此感谢各位大神. Linux文件类型和权限 数据表示 文件 ...
- sql不显示反复列
在报表里,基本上都能够把反复的资料不显示,在SQL里怎么才干做到例如以下情况呢? a 10 a 20 b 30 b 40 b 50 显示为: a 10 20 b 30 40 50 SQL 例如以下: ...
- Ubuntu 16.04 安装 Wireshark分析tcpdump的pcap包——sudo apt install wireshark-qt
tcpdump 的抓包保存到文件的命令参数是-w xxx.cap 抓eth1的包 tcpdump -i eth1 -w /tmp/xxx.cap 抓 192.168.1.123的包 tc ...
- HIT Software Construction Lab 3
2019年春季学期 计算机学院<软件构造>课程 Lab 3实验报告 姓名 刘帅 学号 班号 1703008 电子邮件 1609192321@qq.com 手机号码 目录 1 实验目标概 ...
- kubernetes系列:(一)、kubeadm搭建kubernetes(v1.13.1)单节点集群
kubeadm是Kubernetes官方提供的用于快速部署Kubernetes集群的工具,本篇文章使用kubeadm搭建一个单master节点的k8s集群. 节点部署信息 节点主机名 节点IP 节点角 ...
- php基础知识(一)--2017-04-14
1.Php的两种打开方式: 第一种方式:地址栏打开:http://localhost/0414/qq.php 地址栏输入localhost/ 就是phpstudy下的www文件夹 第二种:新 ...
- Makefile经典教程(转)
转自:http://blog.csdn.net/ruglcc/article/details/7814546/ makefile很重要 什么是makefile?或许很多Winodws的程序员都不知道这 ...
- WebApi不支持跨域访问
- android 双击图片变大,缩放功能
package com.example.administrator.myapplicationphotochange; /** * Created by Administrator on 2016/8 ...
- android webview一些注意事项(持续更新)
1.loadUrl() 的参数必须“http://”开头: 2.如果用到内部类获取页面内容,此类不能混淆: 3.2中情况保持不混淆需要将webview所在的包都保持不混淆,常规的保持类不混淆不生效: ...