【发布时间】:2014-02-19 09:03:47
【问题描述】:
所以我试图使用Items.Clear() 在翻转视图中清除我的项目。但是在尝试清除项目时,错误总是显示“System.Exception”。这是我的代码:
openPicker.FileTypeFilter.Clear();
openPicker.FileTypeFilter.Add(".bmp");
openPicker.FileTypeFilter.Add(".png");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".jpg");
var files = await openPicker.PickMultipleFilesAsync();
if (files != null)
{
//foreach (StorageFile Images in files)
foreach (var file in files)
{
Windows.Storage.Streams.IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
//Some imagedecoder here
BitmapImage img = new BitmapImage();
img.SetSource(outStream);
}
}
flpcakeimages.Items.Clear(); //System.Exception error here it says'Catastrophic error'
flpCakeImages.ItemsSource = images;
这是更新翻转视图的正确方法吗?我用了.UpdateLayout,但还是不行,请大家帮帮我好吗?
【问题讨论】:
标签: c# windows windows-runtime microsoft-metro