C# 崩溃返回(WriteableBitmap无法序列化)windows phone 8

C# 崩溃返回(WriteableBitmap无法序列化)windows phone 8,c#,windows-phone-7,windows-phone-8,C#,Windows Phone 7,Windows Phone 8,当我选择完成第一页照片时 更改到所选照片的第二页将崩溃 我读过这篇文章 但我不知道如何删除BitmapSource属性 这是我的密码 PhotoChooserTask pc; BitmapImage finalImage; pc = new PhotoChooserTask(); pc.Completed += new EventHandler<PhotoResult>(pc_co); public void pc_co(object sender, PhotoResu

当我选择完成第一页照片时 更改到所选照片的第二页将崩溃

我读过这篇文章

但我不知道如何删除BitmapSource属性

这是我的密码

PhotoChooserTask pc;
BitmapImage finalImage;

pc = new  PhotoChooserTask();
pc.Completed += new EventHandler<PhotoResult>(pc_co);


  public void pc_co(object sender, PhotoResult e)
    {


        if (e.TaskResult == TaskResult.OK)
        {

            finalImage = new BitmapImage();
            finalImage.SetSource(e.ChosenPhoto);
            img.Source = finalImage;

        }

    }

同样的症状,同样的原因。您已经在某个位置以电话状态存储了一个图像源(可能是PhoneApplicationService.Current.state或IsolatedStorageSettings.ApplicationSettings)。你必须找到哪里!谢谢你的帮助!!!我找到了
exception  {System.Runtime.Serialization.InvalidDataContractException: Type 'System.Windows.Media.Imaging.WriteableBitmap' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.