Silverlight 想要用图像制作一个网格,并从Uri';s

Silverlight 想要用图像制作一个网格,并从Uri';s,silverlight,image,windows-phone-7,Silverlight,Image,Windows Phone 7,我正在制作一个Windows Phone应用程序,遇到了一些问题 在应用程序中,我想要一个从Flickr获得的foto的FotoWall。我得到了数据部分,现在,我创建了一个包含两种Url的UrlTumb(用于Tumbnail)和UrlFull(用于原始图像)的列表 现在,我想填充/创建一个由4×4个图像组成的网格,并用我的UrlTumb Url填充它们 这就是我的问题:我如何创建一个可以用列表中的数据填充的图像网格? 网格将由4幅宽4幅高的图像组成,每幅图像为100px x 100px。您可以

我正在制作一个Windows Phone应用程序,遇到了一些问题

在应用程序中,我想要一个从Flickr获得的foto的FotoWall。我得到了数据部分,现在,我创建了一个包含两种Url的UrlTumb(用于Tumbnail)和UrlFull(用于原始图像)的列表

现在,我想填充/创建一个由4×4个图像组成的网格,并用我的UrlTumb Url填充它们

这就是我的问题:我如何创建一个可以用列表中的数据填充的图像网格?
网格将由4幅宽4幅高的图像组成,每幅图像为100px x 100px。

您可以创建一个列表框控件,并从Silverlight for Windows Phone工具包中将ItemsPanel更改为一个包裹面板:-

然后可以将ItemTemplate设置为图像控件,如果图像大小正确,则可以实现4x4图像网格

    <ListBox.ItemsPanel>
    <ItemsPanelTemplate>
        <toolkit:WrapPanel />
    </ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
    <DataTemplate>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Image Source="{Binding ThumbNailImage}"
                    Margin="0"
                    Height="110"
                    Width="110"
                    CacheMode="BitMapCache"
                    Stretch="UniformToFill"
                    Grid.Row="0" />
        </Grid>
    </DataTemplate>
</ListBox.ItemTemplate>


希望这能帮上忙。

谢谢:它完全帮了我的忙^^