Browse Source

Add suggested types for export dialog

pull/165/head
Ionite 1 year ago
parent
commit
a2cf576088
No known key found for this signature in database
  1. 13
      StabilityMatrix.Avalonia/ViewModels/Inference/ImageFolderCardViewModel.cs

13
StabilityMatrix.Avalonia/ViewModels/Inference/ImageFolderCardViewModel.cs

@ -216,12 +216,23 @@ public partial class ImageFolderCardViewModel : ViewModelBase
var sourceFile = new FilePath(sourcePath);
var formatName = format.ToString();
var storageFile = await App.StorageProvider.SaveFilePickerAsync(
new FilePickerSaveOptions
{
Title = "Export Image",
ShowOverwritePrompt = true,
SuggestedFileName = item.FileName
SuggestedFileName = item.FileNameWithoutExtension,
DefaultExtension = formatName.ToLowerInvariant(),
FileTypeChoices = new FilePickerFileType[]
{
new(formatName)
{
Patterns = new[] { $"*.{formatName.ToLowerInvariant()}" },
MimeTypes = new[] { $"image/{formatName.ToLowerInvariant()}" }
}
}
}
);

Loading…
Cancel
Save