WPF ListBox的DataTemplate例子_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > WPF ListBox的DataTemplate例子

WPF ListBox的DataTemplate例子

 2013/8/14 16:21:11  Vimana  博客园  我要评论(0)
  • 摘要:1<ListBoxName="lbLogInfo">2<ListBox.ItemTemplate>3<DataTemplate>4<GridMargin="2">5<Grid.RowDefinitions>6<RowDefinition/>7<RowDefinition/>8</Grid.RowDefinitions>9<Grid.ColumnDefinitions>10<
  • 标签:list 例子

 

class="code_img_closed" src="/Upload/Images/2013081416/0015B68B3C38AA5B.gif" alt="" />logs_code_hide('b058b1c0-1e04-4439-b814-b6ca599514d4',event)" src="/Upload/Images/2013081416/2B1B950FA3DF188F.gif" alt="" />
 1 <ListBox Name="lbLogInfo">
 2     <ListBox.ItemTemplate>
 3         <DataTemplate>
 4             <Grid Margin="2">
 5                 <Grid.RowDefinitions>
 6                     <RowDefinition/>
 7                     <RowDefinition/>
 8                 </Grid.RowDefinitions>
 9                 <Grid.ColumnDefinitions>
10                     <ColumnDefinition/>
11                     <ColumnDefinition/>
12                 </Grid.ColumnDefinitions>
13                 <TextBlock Grid.RowSpan="2" MinWidth="80" Text="{Binding Path=State,
14                      Converter={StaticResource DisplayConverter}}"/>
15                 <TextBlock Grid.Column="1" Text="{Binding Path=FileName}"/>
16                 <TextBlock Grid.Row="1" Grid.Column="1" Margin="0,2" Text="{Binding Path=ModifiedDate}"/>
17             </Grid>
18         </DataTemplate>
19     </ListBox.ItemTemplate>
20 </ListBox>
View Code

 

发表评论
用户名: 匿名