Silverlight5中横向显示ListBox

时间:2023-12-22 12:05:32

备忘

<ListBox x:Name="Cpbrow" HorizontalAlignment="Left" Height="153" Margin="0,576,0,0" VerticalAlignment="Top" Width="790" Grid.Column="1" SelectionChanged="Cpbrow_SelectionChanged">
    <ListBox.ItemTemplate>
       <DataTemplate>
                    <StackPanel Width="140" Height="140" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
              <Grid>
                 <TextBlock TextWrapping="Wrap" Text="{Binding cpmz}" VerticalAlignment="Top"  FontSize="16" Margin="0,100,0,0" TextAlignment="Center"/>
                            <Image Margin="30,10,30,50" Source="{Binding cppic}" Stretch="Uniform" Width="80" Height="80"/>
              </Grid>
                    </StackPanel>
       </DataTemplate>
    </ListBox.ItemTemplate>
 </ListBox>