I have used the SaveItemDialog with 2 filters.
Whenever I type a name for the file I want to save it never puts the appropriate suffix for the file type I want to save as.
I cannot seem to find anything in the instance of the SaveItemDialog to see what the current filter selected is as there is nothing showing a property to this effect.
Can someone help me understand how I can get the right file suffix on save?
var jsonFilter = BrowseProjectFilter.GetFilter("esri_browseDialogFilters_json_file");
var csvFilter = BrowseProjectFilter.GetFilter("esri_browseDialogFilters_browseFiles");
csvFilter.FileExtension = "csv";
csvFilter.Name = "CSV files (*.csv)|*.csv";
csvFilter.BrowsingFilesMode = true;
BrowseProjectFilter compositeFilter = new BrowseProjectFilter();
compositeFilter.AddFilter(jsonFilter);
compositeFilter.AddFilter(csvFilter);
SaveItemDialog saveDialog = new SaveItemDialog()
{
Title = "Save",
BrowseFilter = compositeFilter,
OverwritePrompt = true
};
bool? result = saveDialog.ShowDialog();
if (result == true)
{
//Get the selected file path
string filePath = saveDialog.FilePath;
//File path is always missing file suffix which is specified in the filter
}