fix: binding errors in xaml

This commit is contained in:
leo 2024-06-01 12:13:57 +08:00
parent b74bd997fe
commit 1257234712
10 changed files with 38 additions and 39 deletions

View file

@ -15,11 +15,12 @@ namespace SourceGit.Views
{
var options = new FolderPickerOpenOptions() { AllowMultiple = false };
var toplevel = TopLevel.GetTopLevel(this);
if (toplevel == null)
return;
var selected = await toplevel.StorageProvider.OpenFolderPickerAsync(options);
if (selected.Count == 1)
{
txtParentFolder.Text = selected[0].Path.LocalPath;
}
TxtParentFolder.Text = selected[0].Path.LocalPath;
e.Handled = true;
}
@ -28,11 +29,12 @@ namespace SourceGit.Views
{
var options = new FilePickerOpenOptions() { AllowMultiple = false, FileTypeFilter = [new FilePickerFileType("SSHKey") { Patterns = ["*.*"] }] };
var toplevel = TopLevel.GetTopLevel(this);
if (toplevel == null)
return;
var selected = await toplevel.StorageProvider.OpenFilePickerAsync(options);
if (selected.Count == 1)
{
txtSSHKey.Text = selected[0].Path.LocalPath;
}
TxtSshKey.Text = selected[0].Path.LocalPath;
e.Handled = true;
}