开发者

Populating Images from WP7 Gallery to ImageList with Collection Flow

Here is what I wanted to do . I have created an ImageList in XAML code

<local:CollectionFlow x:Name="ImageList" ItemTemplate="{StaticResource DataTemplate1}"
       ItemsPanel="{StaticResource ItemsPanelTemplate1}"/>
<Image Source="Images/imgBack.png" Width="48" Height="48" HorizontalAlignment="Left"
       VerticalAlignment="Center" Margin="15,0,0,0" MouseLeftButtonDown="Left"/>
<Image Source="Images/imgfORWARD.png" Width="48" Height="48" HorizontalAlignment="Right"
       VerticalAlignment="Center" Margin="0,0,15,0" MouseLeftButtonDown="Right" />`

Now I m trying to populate the above list using pictures from MediaLibrary like this

ImageList.ItemsSo开发者_开发知识库urce = mediaLib.Pictures;

I cannot see the pictures from mediaLibrary. Is there something I'm doing wrong . Previously I populated the list using static values like below which works.

ImageList.ItemsSource = new string[] { "SampleImages/1.png", "SampleImages/2.png", "SampleImages/3.png", "SampleImages/4.png", "SampleImages/5.png", "SampleImages/6.png", "SampleImages/7.png", "SampleImages/8.png", "SampleImages/9.png", "SampleImages/10.png", "SampleImages/11.png", "SampleImages/12.png" };


A PictureCollection is not just an array of strings it is an enumerable of Picture objects.
Also note that you cannot get the path to images in the medialibrary only streams.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜