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< ...
随机推荐
- RecyclerView的点击事件
RecyclerView 一.简单介绍 这个是谷歌官方出的控件.使我们能够很easy的做出列表装的一个控件,当然recyclerview的功能不止这些,它还能够做出瀑布流的效果,这是一个很强大的控件, ...
- ftk学习记(首篇)
[ 声明:版权全部,欢迎转载,请勿用于商业用途. 联系信箱:feixiaoxing @163.com] 非常早之前就知道ftk了,当时主要是由于买了李先静的书,所以知道了这么一个项目.由于对这样的g ...
- Hello The World! —— 致我们无悔的IT之旅
感谢IT,让我有了这么可爱活泼的伙伴. 有了KsCla,Coming,lhx_QAQ,tututu,AB_ever,Fat-zhang,wka,lhm这些伙伴神犇的陪伴,我的OI历程不至于那么枯燥无味 ...
- 【BZOJ 2724】 蒲公英
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=2724 [算法] 分块算法在线维护区间众数 分块算法的精髓就在于 : 大段维护,局部朴 ...
- 院校-美国:美国国立卫生研究院(NIH)
ylbtech-院校-美国:美国国立卫生研究院(NIH) 美国国立卫生研究院(简称NIH)位于美国马里兰州贝塞斯达(Bethesda),是美国最高水平的医学与行为学研究机构,初创于1887年,任务是探 ...
- c++面向对象程序设计 谭浩强 第二章答案
类体内定义成员函数 #include <iostream> using namespace std; class Time { public: void set_time(); void ...
- ROS中安装任意版本的OPENCV
转自:http://tieba.baidu.com/p/5023000237 安装 Opencv 3.2 on Ubuntu 16.04 并创建node测试 step 1: 安装一些package s ...
- Spark Streaming概念学习系列之SparkStreaming的高层抽象DStream
不多说,直接上干货! SparkStreaming的高层抽象DStream 为了便于理解,Spark Streaming提出了DStream抽象,代表连续不断的数据流. DStream 是一个持续的R ...
- Spark on YARN运行模式(图文详解)
不多说,直接上干货! 请移步 Spark on YARN简介与运行wordcount(master.slave1和slave2)(博主推荐) Spark on YARN模式的安装(spark-1.6. ...
- 实现SSRS订阅
以前曾经搞过SSRS的订阅,使用的是公司的邮件服务器,最近QQ群中有妹子问到同样的问题,虽然没能帮人家搞定,下面写出自己参考的资料,以供各位参考: 一.订阅前准备工作(转载自http://blog.s ...