private async void LittlePhotoButton_Click(object sender, RoutedEventArgs e) { try { StorageFile SF = await StorageFile.GetFileFromPathAsync(filePath); await Windows.System.Launcher.LaunchFileAsync(SF); } catch { } finally { LittlePhotoHide.Begin(); LittlePhotoShow.Stop(); } }
private async void ShareButton_Click(object sender, RoutedEventArgs e) { try { StorageFile SF = await StorageFile.GetFileFromPathAsync(filePath); DataTransferManager.GetForCurrentView().DataRequested += (DataTransferManager s, DataRequestedEventArgs Dataargs) => { Dataargs.Request.Data.Properties.Title = "共享图像"; Dataargs.Request.Data.Properties.Description = "共享以下图片。"; Dataargs.Request.Data.SetBitmap(RandomAccessStreamReference.CreateFromFile(SF)); }; DataTransferManager.ShowShareUI(); } catch { } finally { LittlePhotoHide.Begin(); LittlePhotoShow.Stop(); } }