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< ...
随机推荐
- Sqoop_具体总结 使用Sqoop将HDFS/Hive/HBase与MySQL/Oracle中的数据相互导入、导出
一.使用Sqoop将MySQL中的数据导入到HDFS/Hive/HBase watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYWFyb25oYWRvb3A=/ ...
- 2015.03.16,外语,读书笔记-《Word Power Made Easy》 00 “如何最大限度的利用本书”学习笔记
备注:蓝色表明是自己学习或笔记的部分,红色表明特别的地方,例如自己不理解或需要重点关注的地方.加粗单词表明是要加入生词库学习的词语.单词后面括号中的蓝色部分,是单词的解释和音标. 1.this is ...
- ubuntu解压命令全览(rar)
sudo apt-get install p7zip-full Ubuntu下解压rar文件的方法 2010-05-13 12:47 一般通过默认安装的ubuntu是不能解压rar文件的,只有在安装了 ...
- 多年iOS开发经验总结(一)
总结了几个月的东西终于能和大家分享了,不多说,直接看东西! 1.禁止手机睡眠 1 [UIApplication sharedApplication].idleTimerDisabled = YES; ...
- JavaScript学习笔记——对象的创建
对象是JavaScript基本数据类型,在JavaScript中除了Undefined.Null.布尔型(ture.false).字符串和数字之外,其他的都属于对象. 在JavaScript中,一个对 ...
- 什么是CNN--Convolutional Neural Networks
是近些年在机器视觉领域很火的模型,最先由 Yan Lecun 提出. 如果想学细节可以看 Andrej Karpathy 的 cs231n . How does it work? 给一张图片,每个圆负 ...
- Android实现图片相似度
Android实现图片相似度 最近公司有一个需求,就是希望能判断用户提交的照片是否是身份证的正面或者反面.可以通过预设一张拍摄清晰的身份证正面或者反面,来对比是否相似,那么问题就转化为如何计算两张图片 ...
- ScrollView和ListView滑动冲突问题
1.在ScrollView里面嵌套ListView时,ListView的滑动事件无法响应. 先看下事件分发的过程: 由父View层的 onInterceptTouchEvent 到中间层的on ...
- Prototype-based programming
Prototype-based programming is a style of object-oriented programming in which behaviour reuse (know ...
- JAVA 静态内部类--转自http://bbs.csdn.net/topics/350021609
内部类其实并不是非要声明成static的..主要还是要看实际情况决定..静态和非静态有不同的作用.. 引用一篇文章给楼主参考下吧. 在一个类中创建另外一个类,叫做成员内部类.这个成员内部类可以静态的( ...