您的位置:首页 > 其它

WPF数据绑定(ItemTemplate和DataTemplate)

2012-04-27 17:05 549 查看
<ListBox Name="lb_fileInfo" Grid.Row="1" Grid.ColumnSpan="3" ItemsSource="{Binding}" SelectionMode="Single" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border Margin="3" BorderThickness="1" BorderBrush="SteelBlue" CornerRadius="2">
<StackPanel Margin="3">
<!--<StackPanel.ToolTip>
<Image Margin ="3" HorizontalAlignment="Center" Source="{Binding Path=bigThumbNail}" Stretch="None"></Image>

</StackPanel.ToolTip>-->
<Image Margin ="3" HorizontalAlignment="Center" Source="{Binding Path=thumbNail}" Stretch="None"></Image>

<TextBlock FontWeight="Bold" HorizontalAlignment ="Center" Margin ="3" Text="{Binding Path=name}"></TextBlock>

<ProgressBar Height="10" Name="progressBar1" Width="200" />
<TextBlock FontStyle="Italic" HorizontalAlignment="Center" FontSize="10" Margin ="3" Text="{Binding Path=revitType}"></TextBlock>

</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: