From ec2ac8f2b7c51117e4aeeaa081a16d243ef3354d Mon Sep 17 00:00:00 2001 From: Creeper Lv Date: Thu, 18 Dec 2025 02:17:19 +1100 Subject: [PATCH] Removed an unnecessary log. --- Progrart/Pages/EditorPage.axaml.cs | 12 ++++++++++++ Progrart/Views/MainView.axaml.cs | 9 +-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Progrart/Pages/EditorPage.axaml.cs b/Progrart/Pages/EditorPage.axaml.cs index da04416..6ec8f78 100644 --- a/Progrart/Pages/EditorPage.axaml.cs +++ b/Progrart/Pages/EditorPage.axaml.cs @@ -11,6 +11,8 @@ namespace Progrart.Pages; public partial class EditorPage : UserControl, ITabPage, IEditorPage { + IStorageFile? file = null; + TabButton? btn = null; public EditorPage() { InitializeComponent(); @@ -18,7 +20,12 @@ public partial class EditorPage : UserControl, ITabPage, IEditorPage public void BindButton(TabButton button) { + btn = button; button.Title = "Editor Page"; + if (file is not null) + { + btn.Title = file.Name; + } } public void Execute() @@ -32,6 +39,11 @@ public partial class EditorPage : UserControl, ITabPage, IEditorPage public void LoadDocument(IStorageFile file) { + this.file = file; + if (btn is not null) + { + btn.Title = file.Name; + } Task.Run(async () => { using var stream = await file.OpenReadAsync(); diff --git a/Progrart/Views/MainView.axaml.cs b/Progrart/Views/MainView.axaml.cs index bc2e123..0c726c8 100644 --- a/Progrart/Views/MainView.axaml.cs +++ b/Progrart/Views/MainView.axaml.cs @@ -70,7 +70,6 @@ public partial class MainView : UserControl if (topLevel == null) return; - // Open the folder picker var folders = await topLevel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions { Title = "Select Folder", @@ -79,16 +78,10 @@ public partial class MainView : UserControl if (folders.Count >= 1) { - // Get the first selected folder path - // Note: TryGetLocalPath() returns null if the file isn't on a local disk (e.g., cloud storage) + FileContainer.Children.Clear(); var folderPath = folders[0].TryGetLocalPath(); var folder = folders[0]; FileContainer.Children.Add(new FileItem(folder)); - if (folderPath != null) - { - // Do something with the path - System.Diagnostics.Debug.WriteLine($"Picked: {folderPath}"); - } } }; LeftPanelToggle.IsChecked = true;