<ListBox Name="lbLogInfo">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.RowSpan="" MinWidth="" Text="{Binding Path=State,
Converter={StaticResource DisplayConverter}}"/>
<TextBlock Grid.Column="" Text="{Binding Path=FileName}"/>
<TextBlock Grid.Row="" Grid.Column="" Margin="0,2" Text="{Binding Path=ModifiedDate}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

WPF ListBox的DataTemplate例子的更多相关文章

  1. 【WPF】ListBox使用DataTemplate 以及默认选中第一项Item

    ListBox中DataTemplate的用法如下 . <ListBox x:Name="areaLB" ItemsSource="{Binding AreaNum ...

  2. Wpf ListBox数据绑定实例1--绑定字典集合

    1.使用ListBox绑定Dictionary字典数据 ListBox常用事件SelectionChanged private void bindListBox() { Dictionary<s ...

  3. WPF ListBox数据绑定

    本文来源 http://wshoufeng1989.blog.163.com/blog/static/202047033201282911633670/  风随影动的博客 使用数据库AllData , ...

  4. WPF : ListBox的几种Template属性

    原文:WPF : ListBox的几种Template属性 属性名 属性的类名 功能 示例 Template ControlTemplate 定义控件自身的外观.其子元素的布局可以自定义,也可以由It ...

  5. 自定义WPF ListBox的选中项样式

    首先介绍一种简单地方法:就是通过自定义SystemColors类的参数来自定义WPF ListBox选择颜色的,SystemColors的HighlightBrushKey和HighlightText ...

  6. wpf ListBox或ListView等数据控件 绑定数据,最简单的方式

    在网上很难找最简单的案例,都是一大片,看着都头疼: 试试举一反三,如果把结果赋给DataContext这个属性,那就前台需要绑定ItemsSource="{Binding}",请注 ...

  7. WPF listbox实现多列显示数据

    一.每行显示固定列数 <ListBox ItemsSource="{Binding DataList}" Style="{DynamicResource ListB ...

  8. WPF 动态创建 DataTemplate 及数据绑定

    WPF 动态创建 DataTemplate 及数据绑定 运行环境:Window7 64bit,.NetFramework4.61,C# 6.0: 编者:乌龙哈里 2017-02-22 参考: star ...

  9. 自定义WPF ListBox的选择样式

    (下图:进行多项选择的ListBox) 首先介绍一种简单地方法:就是通过自定义SystemColors类的参数来自定义WPF ListBox选择颜色的,SystemColors的HighlightBr ...

随机推荐

  1. Python 字典排序

    思路是把字典转为列表后再排序 d={'z':1,'y':2,'x':3} # 字典 s=d.items() # [('y', 2), ('x', 3), ('z', 1)] 列表 s.sort() # ...

  2. [转]HTML accesskey 属性

    本文转自:http://www.dreamdu.com/xhtml/attribute_accesskey/ 17.2. HTML accesskey 属性 accesskey 属性  --  代表链 ...

  3. hdu3584 树状数组

    思路:从一维扩展到三维.可以看看poj2155的解法. #include<iostream> #include<cstring> #include<algorithm&g ...

  4. css3 盒模型记

    css3 盒模型 css假定每个元素都会生成一个或多个矩形框,这称为元素框.各元素框中心有一个内容区.这个内容区周围有可选的内边距,边框和外边距.这些项之所以被认为是可选的,原因是它们的宽度可以设置为 ...

  5. Jersey(1.19.1) - Root Resource Classes

    Root resource classes are POJOs (Plain Old Java Objects) that are annotated with @Path have at least ...

  6. NUI相关术语

    分享一下微软资深企业架构师.应用开发专家余涛先生书中所谈到的相关术语,以便查阅,部分术语根据个人理解加入了细化内容: 1.波束形成算法(BeamformingAlgorithm) 基于现行阵列的阵列信 ...

  7. linux学习书籍推荐linux学习书籍推荐

    引用地址:http://www.cnblogs.com/notepi/archive/2013/06/15/3137103.html Linux 学习书目推荐 Linux基础 1.<Linux与 ...

  8. Agile.Net 组件式开发平台 - 服务器端部署

    应用服务器: 操作系统要求推荐Windows Server 2008,服务器硬件如果支持64位建议安装64位操作系统产品以最大化发挥服务器性能. 安装操作系统Windows Server 2008,其 ...

  9. C# Winform AutoScaleMode属性

    属性的用法: None : 禁用自动缩放.(默认时) Font :根据类使用的字体(通常为系统字体)的维度控制缩放. Dpi : 根据显示分辨率控制缩放.常用分辨率为 96 和 120 DPI. In ...

  10. Oracle学习第二天---Profile的使用

    环境:Oracle 11g 一.权限的传递 1.如果传递的是对象权限,就在后面加入with grant option: eg:system用户有张temp的表,只想usertest用户拥有查询的权限, ...