make save file dialog actually work.
MODIFY
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooser.xaml
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooser.xaml
<TextBlock Grid.Column="6" Text="Type" />
<TextBlock Grid.Column="8" Text="Size" />
</Grid>
+ <TextBox Text="{Binding FileName}" Watermark="File name" DockPanel.Dock="Bottom" />
<ListBox x:Name="Files"
VirtualizationMode="Simple"
Items="{Binding Items}"

MODIFY
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooserViewModel.cs
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooserViewModel.cs
@@ -31,9 +31,11 @@ namespace WalletWasabi.Gui.ManagedDialogs
new AvaloniaList<ManagedFileChooserItemViewModel>();
string _location;
+ string _fileName;
private bool _showHiddenFiles;
private ManagedFileChooserFilterViewModel _selectedFilter;
private bool _selectingDirectory;
+ private bool _savingFile;
private bool _scheduledSelectionValidation;
public string Location
@@ -42,6 +44,12 @@ namespace WalletWasabi.Gui.ManagedDialogs
private set => this.RaiseAndSetIfChanged(ref _location, value);
}
+ public string FileName
+ {
+ get => _fileName;
+ private set => this.RaiseAndSetIfChanged(ref _fileName, value);
+ }
+
public bool ShowFilters { get; }
public SelectionMode SelectionMode { get; }
public string Title { get; }
@@ -126,6 +134,7 @@ namespace WalletWasabi.Gui.ManagedDialogs
}
_selectingDirectory = dialog is OpenFolderDialog;
+ _savingFile = dialog is SaveFileDialog;
Navigate(directory, (dialog as FileDialog)?.InitialFileName);
SelectedItems.CollectionChanged += OnSelectionChangedAsync;
@@ -166,6 +175,11 @@ namespace WalletWasabi.Gui.ManagedDialogs
{
SelectedItems.Remove(item);
}
+
+ if(!_selectingDirectory)
+ {
+ FileName = SelectedItems.FirstOrDefault()?.DisplayName;
+ }
}
}
finally
@@ -286,6 +300,10 @@ namespace WalletWasabi.Gui.ManagedDialogs
{
CompleteRequested?.Invoke(new[] { Location });
}
+ else if(_savingFile)
+ {
+ CompleteRequested?.Invoke(new[] { Path.Combine(Location, FileName) });
+ }
else
{
CompleteRequested?.Invoke(SelectedItems.Select(i => i.Path).ToArray());

MODIFY
WalletWasabi.Gui/Program.cs
WalletWasabi.Gui/Program.cs
@@ -99,7 +99,7 @@ namespace WalletWasabi.Gui
{
result
.UseWin32()
- .UseSkia();
+ .UseSkia().UseManagedSystemDialogs();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{

make save file dialog actually work.