这是我想做的。我在 XAML 代码中创建了一个 ImageList
<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" />`
现在我正在尝试使用来自 MediaLibrary 的图片来填充上面的列表,如下所示
ImageList.ItemsSource = mediaLib.Pictures;
我看不到来自 mediaLibrary 的图片。有什么我做错了吗。以前我使用静态值填充列表,如下所示。
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" };