Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WrapGrid和许多图像_C#_Windows Runtime_Winrt Xaml - Fatal编程技术网

C# WrapGrid和许多图像

C# WrapGrid和许多图像,c#,windows-runtime,winrt-xaml,C#,Windows Runtime,Winrt Xaml,我有GridView,WrapGrid作为ItemTemplate。它看起来像: <GridView ItemsSource={Binding MyItemSource}> <GridView.ItemTemplate> <DataTemplate> <Image Width="250" Height="250"> <Image.Source>

我有GridView,WrapGrid作为ItemTemplate。它看起来像:

<GridView ItemsSource={Binding MyItemSource}>
    <GridView.ItemTemplate>
        <DataTemplate>
             <Image Width="250" Height="250">
                  <Image.Source>
                       <BitmapImage UriSource="{Binding }" DecodePixelWidth=250/>
                  </Image.Source>
             </Image>
        </DataTemplate>
     </GridView.ItemTemplate>

     <GridView.ItemsPanel>
          <ItemsPanelTemplate>
               <WrapGrid/>
           </ItemsPanelTemplate>
     </GridView.ItemsPanel>
</GridView>


MyItemSource包含图像文件的Uri(很多Uri)。得益于虚拟化过程,它可以在没有OutOfMemoryException的情况下工作。然而,当我决定滚动“快且远”时,滚动区域中“介于”之间的图像会有很多不必要的加载工作。(大量不必要的cpu、磁盘和内存使用)我希望在用户不滚动时开始加载过程(当用户停止滚动时,不加载滚动时只会看到片刻的图像)。有可能吗?

如果您使用的是Windows 8.1,则可以点击ContainerContentChanged事件并控制在何时渲染的内容