Get way further

This commit is contained in:
2025-10-22 17:31:32 -05:00
parent 7c4f85ec21
commit 27f301fe48
39 changed files with 2028 additions and 123 deletions

View File

@@ -1,8 +1,10 @@
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Threading.Tasks;
using Avalonia.Markup.Xaml.Templates;
using Avalonia.Media;
using Avalonia.Platform.Storage;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
@@ -85,6 +87,20 @@ public partial class NewProjectDialogViewModel : ViewModelBase
}
}
}
[RelayCommand]
public async Task BrowseAsync()
{
var window = await WeakReferenceMessenger.Default.Send<GetWindowMessage>();
var res = await window.StorageProvider.OpenFolderPickerAsync(new Avalonia.Platform.Storage.FolderPickerOpenOptions() { Title = "Pick Project Parent Folder" });
if (res.Count != 0)
{
string? path = res[0].TryGetLocalPath();
if(!string.IsNullOrWhiteSpace(path))
this.ParentDirectory = path;
}
}
[RelayCommand]
private void OK()
@@ -111,7 +127,7 @@ public partial class CrossLangTemplate(string name,CrossLangFile file) : Observa
{
[ObservableProperty]
private string _name = file.GetTemplatePrettyName();
private string _name = file.GetPrettyName();
[ObservableProperty]
private IImage _icon = file.GetIcon(64);