diff --git a/App.axaml b/App.axaml index 3f67de4..d16c885 100644 --- a/App.axaml +++ b/App.axaml @@ -97,6 +97,9 @@ + + + diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index e95676f..7bbd1e5 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -206,23 +206,30 @@ class MainViewModel : BaseViewModel, IFontResolver public async void BuildPDF() { - try + if (string.IsNullOrWhiteSpace(ReportTitle)) { - // TODO: use already found files and information - await Task.Run(() => CreatePDF(_workingFolder)); - } catch (Exception e) + await DialogHost.Show(new WarningViewModel("You must provide a report title!")); + } + else { - LogInfo("PDF process failed! Reason: " + e.Message); - if (e.StackTrace != null) + try { - LogInfo(e.StackTrace); - } - if (e.InnerException != null) + // TODO: use already found files and information + await Task.Run(() => CreatePDF(_workingFolder)); + } catch (Exception e) { - LogInfo("Inner exception: " + e.InnerException.Message); - if (e.InnerException.StackTrace != null) + LogInfo("PDF process failed! Reason: " + e.Message); + if (e.StackTrace != null) { - LogInfo(e.InnerException.StackTrace); + LogInfo(e.StackTrace); + } + if (e.InnerException != null) + { + LogInfo("Inner exception: " + e.InnerException.Message); + if (e.InnerException.StackTrace != null) + { + LogInfo(e.InnerException.StackTrace); + } } } } diff --git a/Views/WarningView.axaml b/Views/WarningView.axaml index cf0a3ca..a284774 100644 --- a/Views/WarningView.axaml +++ b/Views/WarningView.axaml @@ -10,16 +10,20 @@ x:DataType="vm:WarningViewModel"> +