zoukankan      html  css  js  c++  java
  • WPF数据绑定(ItemTemplate和DataTemplate)

    <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>

  • 相关阅读:
    scala
    数据结构(01)
    基本算法(07)
    基本算法(06)
    基本算法(05)
    git pull文件时和本地文件冲突的问题
    获取两个日期之间的日期形成一个集合
    lombok的简单介绍(2)
    springboot启动报错
    逆向工程的创建
  • 原文地址:https://www.cnblogs.com/lipf/p/2473853.html
Copyright © 2011-2022 走看看