<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的更多相关文章

  1. 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 ...

  2. WPF Custom Command And Binding

    using System; using System.Collections.Generic; using System.Windows.Input; namespace WPF.Commands { ...

  3. WPF Command Binding

    <Window x:Class="WpfTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/200 ...

  4. WPF MVVM,Prism,Command Binding

    1.添加引用Microsoft.Practices.Prism.Mvvm.dll,Microsoft.Practices.Prism.SharedInterfaces.dll: 2.新建文件夹,Vie ...

  5. 扩展ArcGIS API for Silverlight/WPF 中的TextSymbol支持角度标注

    原文 http://blog.csdn.net/esricd/article/details/7587136 在ArcGIS API for Silverlight/WPF中原版的TextSymbol ...

  6. 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 ...

  7. (WPF, MVVM) Slider Binding.

    对于Button的Command的绑定可以通过实现ICommand接口来进行,但是Slider并没有Command属性. 另外如果要实现MVVM模式的话,需要将一些Method和Slider的Even ...

  8. 【转】WPF中的Binding技巧(二)

    WPF中的Binding技巧(二)     接上篇, 我们来看一看Elementname,Source,RelativeSource 三种绑定的方式 1.ElementName顾名思义就是根据Ui元素 ...

  9. WPF 定义Command

    直接上代码: public class LoginDelegateCommand : ICommand { private Action _execute; private Predicate< ...

随机推荐

  1. 为代码减负之&lt;三&gt;视图(SQL)

    在设计数据库时为了降低数据冗余.一般都会依照三范式去设计,但有时我们在查询时须要通过一字段获取跟这 个字段相关联的好几个字段.可是他们又分布在不同的表中,这时候假设依照正常途径走的话须要同一时候查询好 ...

  2. MyEclipse2015安装SVN插件

    一.下载SVN插件subclipse 下载地址:http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240 在打开的网 ...

  3. 英语发音规则---F字母

    英语发音规则---F字母 一.总结 一句话总结: 1.F/FF发[f]音? fly [flaɪ] vi. 飞 fine [faɪn] adj. 好的 float [fləʊt] vt. 使漂浮 fra ...

  4. [IOI 1999] 花店橱窗布置

    [题目链接] https://www.luogu.org/problemnew/show/P1854v [算法] f[i][j]表示放了前i束花,第i束花放在第j个花瓶中,所能获得的最大美学值 由于要 ...

  5. ROS-动态参数

    前言:在节点外部改变参数的方式有:参数服务器.服务.主题以及动态参数. 1.新建cfg文件 在chapter2_tutorials包下新建cfg文件夹,在cfg文件夹下新建chapter2.cfg文件 ...

  6. caffe.bin caffe的框架

    最近打算看一看caffe实现的源码,因为发现好多工作都是基于改动网络来实现自己的的目的.比如变更目标函数以及网络结构,以实现图片风格转化或者达到更好的效果. 深度学习框架 https://mp.wei ...

  7. C#学习小记

    1.C#是由微软推出的,基于.Net Framework的面向对象的高级编程语言. 2.C#代码编辑器为Visual Studio,简称VS. 3.Hello World VS中新建Windows控制 ...

  8. Centos7 minimal 系列之Redis(五)

    一.Redis安装 1.1 .进入/usr/local 创建redis文件夹(mkdir)方便统一管理 1.2.下载redis $ wget http://download.redis.io/rele ...

  9. (转载)Android项目实战(二十八):Zxing二维码实现及优化

    Android项目实战(二十八):Zxing二维码实现及优化   前言: 多年之前接触过zxing实现二维码,没想到今日项目中再此使用竟然使用的还是zxing,百度之,竟是如此牛的玩意. 当然,项目中 ...

  10. gvim74 提示报错 “无法加载库python27.dll”

    官方提供的gvim安装文件默认是支持python和python3两种模式的,编译时带有该选项,但并没有附带对应的运行库和运行环境.所以在本地没有安装python时直接在vim中执行 :py print ...