mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
[Refactor] Replace SaveFileDialog with StorageProvider for file saving
This commit is contained in:
@@ -275,17 +275,16 @@ public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
if(SelectedRomSet == null) return;
|
||||
|
||||
var dlgSave = new SaveFileDialog
|
||||
IStorageFile result = await _view.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
|
||||
{
|
||||
InitialFileName = SelectedRomSet.Filename
|
||||
};
|
||||
|
||||
string result = await dlgSave.ShowAsync(_view);
|
||||
SuggestedFileName = SelectedRomSet.Filename,
|
||||
SuggestedStartLocation = await _view.StorageProvider.TryGetWellKnownFolderAsync(WellKnownFolder.Documents)
|
||||
});
|
||||
|
||||
if(result == null) return;
|
||||
|
||||
var dialog = new ExportDat();
|
||||
var viewModel = new ExportDatViewModel(dialog, SelectedRomSet.Sha384, result);
|
||||
var viewModel = new ExportDatViewModel(dialog, SelectedRomSet.Sha384, result.Path.LocalPath);
|
||||
dialog.DataContext = viewModel;
|
||||
_ = dialog.ShowDialog(_view);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user