Windows Phone 8.1 StorageFile 图片访问

network | | 访问(43)
<StackPanel>
    <TextBlock Text="安装包的图片展示:"></TextBlock>
    <Image x:Name="packageImage" Height="200"></Image>
    <TextBlock Text="应用存储的图片展示:"></TextBlock>
    <Image x:Name="appImage" Height="200"></Image>
</StackPanel>
public sealed partial class MainPage: Page {
    public MainPage() {
        this.InitializeComponent();

    }

    protected async override void OnNavigatedTo(NavigationEventArgs e) {
        ApplicationData appData = ApplicationData.Current;
        StorageFile imgFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Logo.scale-240.png"));
        await imgFile.CopyAsync(appData.TemporaryFolder, imgFile.Name, NameCollisionOption.ReplaceExisting);
        appImage.Source = new BitmapImage(new Uri("ms-appdata:///temp/Logo.scale-240.png"));
        packageImage.Source = new BitmapImage(new Uri("ms-appx:///Assets/Logo.scale-240.png"));
    }
}