我可以在将图像保存到媒体库时显示进度指示器,但我不知道如何IsVisible = false
在图片保存后更改。以下是我用于它的代码 -
async void Save_Click(object sender, EventArgs e)
{
ProgressIndicator progress = new ProgressIndicator();
progress.IsVisible = true;
progress.IsIndeterminate = true;
progress.Text = "saving image...";
//Save a copy of the image
using (MediaLibrary library = new MediaLibrary())
{
var imgStream = (await App.CurrPhoto.RawSession.RenderToJpegAsync()).AsStream();
library.SavePicture(DateTime.UtcNow.Ticks.ToString(), imgStream);
}
SystemTray.SetProgressIndicator(this, progress);
}