diff --git a/I18N Commander/UI MAUI/Pages/LoadProject.razor b/I18N Commander/UI MAUI/Pages/LoadProject.razor new file mode 100644 index 0000000..50fe756 --- /dev/null +++ b/I18N Commander/UI MAUI/Pages/LoadProject.razor @@ -0,0 +1,37 @@ +@page "/load" + +

Load a Project

+ + + +
+ +
+ + +
+ + +
+ + @if (DeviceInfo.Idiom == DeviceIdiom.Desktop) + { +
+ +
+ + +
+
+ } + + +
\ No newline at end of file diff --git a/I18N Commander/UI MAUI/Pages/LoadProject.razor.cs b/I18N Commander/UI MAUI/Pages/LoadProject.razor.cs new file mode 100644 index 0000000..0dc893f --- /dev/null +++ b/I18N Commander/UI MAUI/Pages/LoadProject.razor.cs @@ -0,0 +1,52 @@ +using System.Text; +using System.Text.Json.Serialization; + +namespace UI_MAUI.Pages; + +public partial class LoadProject +{ + private readonly List recentProjects = new(); + + private string newProjectDestination = string.Empty; + + #region Overrides of ComponentBase + + protected override async Task OnInitializedAsync() + { + await base.OnInitializedAsync(); + await this.LoadRecentProjects(); + } + + #endregion + + private readonly record struct RecentProject(string Path, string Name, bool Available); + + private async Task LoadRecentProjects() + { + var appDataDirectory = FileSystem.Current.AppDataDirectory; + var recentProjectsFile = Path.Join(appDataDirectory, "recentProjects.json"); + if (!File.Exists(recentProjectsFile)) + await File.WriteAllTextAsync(recentProjectsFile, string.Empty, Encoding.UTF8); + + // Read the JSON data from that file & decode it to an array of recent projects: + + } + + private async Task WriteRecentProjects() + { + + } + + private async Task ChooseProjectDestination() + { + var projectDestination = await FilePicker.PickAsync(new PickOptions + { + PickerTitle = "Choose the project destination", + }); + + if(projectDestination is null) + return; + + this.newProjectDestination = projectDestination!.FullPath; + } +} \ No newline at end of file diff --git a/I18N Commander/UI MAUI/UI MAUI.csproj b/I18N Commander/UI MAUI/UI MAUI.csproj index cb87700..6c03386 100644 --- a/I18N Commander/UI MAUI/UI MAUI.csproj +++ b/I18N Commander/UI MAUI/UI MAUI.csproj @@ -62,8 +62,4 @@ - - - -