原创 用WrapPanel为ItemsControl绑定数据

2011-8-12 22:04 1492 2 2 分类: FPGA/CPLD

 <Grid x:Name="LayoutRoot" Background="White">
        <ListBox  x:Name="myListBox">
            <ListBox.Template>
                <ControlTemplate TargetType="ListBox">
                    <Grid>
                        <ItemsPresenter />
                    </Grid>
                </ControlTemplate>
            </ListBox.Template>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <toolkit:WrapPanel Orientation="Horizontal" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="0,0,0,26">
                        <Image Source="{Binding 姓名}" Height="47" HorizontalAlignment="Left" VerticalAlignment="Top" Width="59"/>
                        <TextBlock Text="{Binding 挪动电话1}" TextWrapping="Wrap" Height="13" VerticalAlignment="Top" Margin="0,46,0,0" HorizontalAlignment="Left" Width="59"/>
                        <TextBlock Text="{Binding 性别}" Height="13" HorizontalAlignment="Left" Margin="47,0,0,0" VerticalAlignment="Top" Width="12" TextWrapping="Wrap"/>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <toolkit:BusyIndicator x:Name="busyd" BusyContent="读数据" DisplayAfter="0" />

 

 

    </Grid>


PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
2
关闭 站长推荐上一条 /3 下一条