Can now make PDFs again; more UI tweaks

This commit is contained in:
2026-02-16 14:29:26 +09:00
parent 9bae4b49eb
commit bfd90f9cd9
3 changed files with 45 additions and 26 deletions
+10 -3
View File
@@ -34,14 +34,20 @@ class MainViewModel : BaseViewModel, IFontResolver
_baseDir = Path.GetDirectoryName(Environment.ProcessPath) ?? "";
_isCreatingPDF = false;
_createPDFLog = "Ready to create PDF! Choose a folder to begin...";
_reportFiles = new ObservableCollection<ReportFile>();
_workingFolder = "";
_reportFiles = new ObservableCollection<ReportFile>();
_reportFiles.CollectionChanged += ( sender, e ) => { NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled)); };
}
public bool IsCreatingPDF
{
get => _isCreatingPDF;
set { _isCreatingPDF = value; NotifyPropertyChanged(); }
set { _isCreatingPDF = value; NotifyPropertyChanged(); NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled)); }
}
public bool IsCreatePDFButtonEnabled
{
get => !_isCreatingPDF && _reportFiles.Count > 0;
}
public string CreatePDFLog
@@ -121,10 +127,11 @@ class MainViewModel : BaseViewModel, IFontResolver
var result = await DialogHost.Show(new EditFileViewModel(file, ViewModelChanger));
}
private async void BuildPDF()
public async void BuildPDF()
{
try
{
// TODO: use already found files
await Task.Run(() => CreatePDF(_workingFolder));
} catch (Exception e)
{