mirror of
https://onedev.site.tesses.net/crosslang/crosslangdevstudio
synced 2026-02-08 09:15:45 +00:00
Get way further
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user