-
Notifications
You must be signed in to change notification settings - Fork 394
Expand file tree
/
Copy pathArchive.axaml.cs
More file actions
33 lines (28 loc) · 897 Bytes
/
Archive.axaml.cs
File metadata and controls
33 lines (28 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Platform.Storage;
namespace SourceGit.Views
{
public partial class Archive : UserControl
{
public Archive()
{
InitializeComponent();
}
private async void SelectOutputFile(object _, RoutedEventArgs e)
{
var toplevel = TopLevel.GetTopLevel(this);
if (toplevel == null)
return;
var options = new FilePickerSaveOptions()
{
DefaultExtension = ".zip",
FileTypeChoices = [new FilePickerFileType("ZIP") { Patterns = ["*.zip"] }]
};
var selected = await toplevel.StorageProvider.SaveFilePickerAsync(options);
if (selected != null)
TxtSaveFile.Text = selected.Path.LocalPath;
e.Handled = true;
}
}
}