希望我能解釋什麼,我需要和我有以下列表框有什麼問題是清除圖像緩存
<ListBox Margin="0,8,0,0" toolkit:TiltEffect.IsTiltEnabled="True" x:Name="ImageList" ItemsSource="{Binding Images}" HorizontalAlignment="Center" BorderThickness="4">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Background="{Binding imageID, Converter={StaticResource ImageConverter}}" Width="125" Height="125" Margin="6" Tap="list_OnTap">
<TextBlock Name="description" Foreground="{Binding TextColor}" Text="{Binding text}" Visibility="{Binding ShowText, Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="False" Name="deletectx">
<toolkit:MenuItem Header="delete" Click="delete_Click"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
上面的代碼,使圖像的網格我用網格背景來顯示圖像,因爲我需要顯示我的圖像上的文字(不知道是否有任何其他方式做到這一點) 此頁面加載有關使用尺寸爲125x125像素的30張圖像,並約4KB每個。我注意到它消耗了大量的內存。我在這裏有關清除的圖像的緩存中讀取一些帖子,但我不知道我應該怎樣做,與考慮我設置網格背景我的形象不是圖像控件上述代碼。
我也許能夠訪問列表框裏面的網格,但無論我做的話,會被應用到第一圖像不僅沒有休息。我需要在我離開的事件清除圖像緩存。
另一個問題,我也有一些性能問題,進入這個頁面需要一點點時間,我在Windows Phone應用分析器得到低幀率警告,不知道我在做什麼(通過Converter加載圖像for每個列表框項目)是否正確! 如何讓這個更快?
歡迎計算器!爲您的問題選擇標題時,不需要在其中添加標籤。請閱讀http://meta.stackexchange.com/questions/19190進行討論,以及爲什麼他們不需要。此外,最後的問候是不必要的,包括任何問候,而不是你的聯繫卡,它顯示在所有問題的右下角。 – Patrick 2013-03-23 23:20:06