diff --git a/src/MayShow.Shared/App.axaml b/src/MayShow.Shared/App.axaml index 1d86e47..784dfeb 100644 --- a/src/MayShow.Shared/App.axaml +++ b/src/MayShow.Shared/App.axaml @@ -109,6 +109,9 @@ + + + diff --git a/src/MayShow.Shared/Assets/MayShowIcon.png b/src/MayShow.Shared/Assets/MayShowIcon.png new file mode 100644 index 0000000..33fca3f Binary files /dev/null and b/src/MayShow.Shared/Assets/MayShowIcon.png differ diff --git a/src/MayShow.Shared/MayShow.Shared.csproj b/src/MayShow.Shared/MayShow.Shared.csproj index c7be25a..89731c0 100644 --- a/src/MayShow.Shared/MayShow.Shared.csproj +++ b/src/MayShow.Shared/MayShow.Shared.csproj @@ -60,7 +60,7 @@ All - + diff --git a/src/MayShow.Shared/ViewModels/MainViewModel.cs b/src/MayShow.Shared/ViewModels/MainViewModel.cs index 994f928..774dad6 100644 --- a/src/MayShow.Shared/ViewModels/MainViewModel.cs +++ b/src/MayShow.Shared/ViewModels/MainViewModel.cs @@ -12,7 +12,7 @@ class MainViewModel : ChangeNotifier, IChangeViewModel public MainViewModel(ITopLevelGrabber topLevelGrabber) { _viewModels = new Stack(); - var initialViewModel = new CreatePDFReportViewModel(this) + var initialViewModel = new StartNewChooseReportViewModel(this) { TopLevelGrabber = topLevelGrabber }; diff --git a/src/MayShow.Shared/ViewModels/StartNewChooseReportViewModel.cs b/src/MayShow.Shared/ViewModels/StartNewChooseReportViewModel.cs new file mode 100644 index 0000000..ce3c663 --- /dev/null +++ b/src/MayShow.Shared/ViewModels/StartNewChooseReportViewModel.cs @@ -0,0 +1,77 @@ +#nullable enable + +using System; +using System.Collections.ObjectModel; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Avalonia.Platform.Storage; +using Avalonia.Themes.Fluent; +using DialogHostAvalonia; +using ImageMagick; +using MigraDoc.DocumentObjectModel; +using MigraDoc.Rendering; +using PdfSharp.Fonts; +using PdfSharp.Pdf.IO; +using PdfSharp.Snippets.Font; +using MayShow.Interfaces; +using MayShow.Models; +using MayShow.Helpers; + +namespace MayShow.ViewModels; + +class StartNewChooseReportViewModel : BaseViewModel +{ + private string _creatingReportTitle; + private ObservableCollection _savedReports; + + public StartNewChooseReportViewModel(IChangeViewModel viewModelChanger) : base(viewModelChanger) + { + _creatingReportTitle = ""; + // TODO: load existing reports + _savedReports = []; + for (var i = 1; i <= 100; i++) + { + _savedReports.Add("Report " + i); + } + } + + public string Version + { + get => Constants.AppVersion; + } + + public string CreatingReportTitle + { + get => _creatingReportTitle; + set { _creatingReportTitle = value; NotifyPropertyChanged(); } + } + + public ObservableCollection SavedReports + { + get => _savedReports; + set { _savedReports = value; NotifyPropertyChanged(); } + } + + public void StartReport() + { + // TODO: make sure there is a folder and everything set up for this report + ViewModelChanger.PushViewModel(new CreatePDFReportViewModel(ViewModelChanger) + { + ReportTitle = CreatingReportTitle + }); + CreatingReportTitle = ""; // when user comes back they can start another new report + // TODO: add to existing reports list + } + + public void LoadExistingReport() + { + // TODO: load data and send to create PDF report view model + } + + public void DeleteExistingReport() + { + // TODO: warn user, delete if they want to proceed + } +} \ No newline at end of file diff --git a/src/MayShow.Shared/Views/StartNewChooseReport.axaml b/src/MayShow.Shared/Views/StartNewChooseReport.axaml new file mode 100644 index 0000000..950d649 --- /dev/null +++ b/src/MayShow.Shared/Views/StartNewChooseReport.axaml @@ -0,0 +1,82 @@ + + + + MayShow + + + + \ No newline at end of file diff --git a/src/MayShow.Shared/Views/StartNewChooseReport.axaml.cs b/src/MayShow.Shared/Views/StartNewChooseReport.axaml.cs new file mode 100644 index 0000000..272e849 --- /dev/null +++ b/src/MayShow.Shared/Views/StartNewChooseReport.axaml.cs @@ -0,0 +1,14 @@ +using System; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace MayShow.Views; + +public partial class StartNewChooseReport : UserControl +{ + public StartNewChooseReport() + { + this.InitializeComponent(); + } +}