Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }