码迷,mamicode.com
首页 > Web开发 > 详细

silverlight wpf DataTemplate Command binding

时间:2014-09-23 13:35:44      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   ar   文件   div   sp   on   c   



<
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

标签:style   blog   color   ar   文件   div   sp   on   c   

原文地址:http://www.cnblogs.com/akiing/p/3987749.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!