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< ...
随机推荐
- Codeforces Round #234 (Div. 2) A. Inna and Choose Options
A. Inna and Choose Options time limit per test 1 second memory limit per test 256 megabytes input st ...
- Java中使用多线程、curl及代理IP模拟post提交和get訪问
Java中使用多线程.curl及代理IP模拟post提交和get訪问 菜鸟,多线程好玩就写着玩.大神能够路过不吝赐教.小弟在这受教.谢谢! 很多其它分享请关注微信公众号:lvxing1788 ~~~~ ...
- 51nod-1363: 最小公倍数之和
[传送门:51nod-1363] 简要题意: 给出一个数n,求出1到n的数与n的最小公倍数的和 多组数据 题解: 理所当然推柿子 原题相当于求$\sum_{i=1}^{n}\frac{i*n}{gcd ...
- hdoj--5240--Exam()
Exam Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submi ...
- 两个TableView产生联动的一中方法
如何使用两个TableView产生联动:将两个tableView的滚动事件禁止掉,最外层scrollView滚动时将两个TableView跟着滚动,并且更改contentOffset,这样产生效果滚动 ...
- PHP分页组件:Paginator
安装 composer require "jasongrimes/paginator:~1.0" 使用 <?php require '../vendor/autoload.p ...
- Sqlite简单操作
1.student类 public class Student { int id; String name; String sex; String address; int money; public ...
- deploy sql clr
1, create strong signed key file 2, create asymmetric key
- RocketMQ学习笔记(10)----RocketMQ的Producer 事务消息使用
1. 事务消息原理图 RocketMQ除了支持普通消息,顺序消息之外,还支持了事务消息. 1. 什么是分布式事务? 分布式事务就是指事务的参与者.支持事务的服务器.资源服务器以及事务管理器分别位于不同 ...
- Codeforces Round #499 (Div. 2) D. Rocket_交互题_二分
第一次作交互题,有点不习惯. 由于序列是循环的,我们可以将一半的机会用于判断当前是否是在说谎,另一半的机会用于二分的判断. 对于判断是否实在说谎,用1判断即可.因为不可能有比1还小的数. 本题虽然非常 ...