From ef68062a7344a85eb7043449bae5e056d4f97e08 Mon Sep 17 00:00:00 2001 From: Michael Babienco Date: Mon, 16 Feb 2026 15:56:31 +0900 Subject: [PATCH] Add report title box --- ViewModels/MainViewModel.cs | 16 +++++++++++++++- Views/MainView.axaml | 14 ++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index 7096f92..f0e3bb0 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -27,6 +27,7 @@ class MainViewModel : BaseViewModel, IFontResolver private string _createPDFLog; private string _workingFolder; + private string _reportTitle; private ObservableCollection _reportFiles; public MainViewModel(IChangeViewModel viewModelChanger) : base(viewModelChanger) @@ -37,6 +38,18 @@ class MainViewModel : BaseViewModel, IFontResolver _workingFolder = ""; _reportFiles = new ObservableCollection(); _reportFiles.CollectionChanged += ( sender, e ) => { NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled)); }; + _reportTitle = ""; + } + + public string ReportTitle + { + get => _reportTitle; + set { _reportTitle = value; NotifyPropertyChanged(); NotifyPropertyChanged(nameof(IsTitleBoxVisible)); } + } + + public bool IsTitleBoxVisible + { + get => !string.IsNullOrWhiteSpace(_workingFolder); } public bool IsCreatingPDF @@ -86,6 +99,7 @@ class MainViewModel : BaseViewModel, IFontResolver if (Directory.Exists(folder.Path.LocalPath)) { _workingFolder = folder.Path.LocalPath; + NotifyPropertyChanged(nameof(IsTitleBoxVisible)); // TODO: Scan folder for saved info from previous reports and reload if needed // Scan folder for files and display in DataGrid var filePaths = Directory.GetFiles(_workingFolder); @@ -137,7 +151,7 @@ class MainViewModel : BaseViewModel, IFontResolver { try { - // TODO: use already found files + // TODO: use already found files and information await Task.Run(() => CreatePDF(_workingFolder)); } catch (Exception e) { diff --git a/Views/MainView.axaml b/Views/MainView.axaml index c5e4594..4f92f49 100644 --- a/Views/MainView.axaml +++ b/Views/MainView.axaml @@ -12,14 +12,20 @@ + Spacing="2">