diff --git a/.idea/.idea.TheXamlGuy/.idea/.gitignore b/.idea/.idea.TheXamlGuy/.idea/.gitignore new file mode 100644 index 0000000..b44fce1 --- /dev/null +++ b/.idea/.idea.TheXamlGuy/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +/.idea.TheXamlGuy.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.TheXamlGuy/.idea/encodings.xml b/.idea/.idea.TheXamlGuy/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.TheXamlGuy/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.TheXamlGuy/.idea/indexLayout.xml b/.idea/.idea.TheXamlGuy/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.TheXamlGuy/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/App/WeddingBooth/App.xaml b/App/WeddingBooth/App.xaml new file mode 100644 index 0000000..7cb3f71 --- /dev/null +++ b/App/WeddingBooth/App.xaml @@ -0,0 +1,84 @@ + + + + Segoe UI Variable Display + Signature Collection + Segoe UI Variable Display Semil + + 12 + 14 + 20 + 28 + 40 + 68 + 120 + + + + + + + + + + + + + + + + + + diff --git a/App/WeddingBooth/App.xaml.cs b/App/WeddingBooth/App.xaml.cs new file mode 100644 index 0000000..ae7ae15 --- /dev/null +++ b/App/WeddingBooth/App.xaml.cs @@ -0,0 +1,79 @@ +using System.Windows; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using TheXamlGuy.Framework.WPF; +using WeddingBooth.Views; +using System.Reflection; +using System; +using System.IO; +using TheXamlGuy.Framework.Core; +using TheXamlGuy.Framework.Microcontroller; +using TheXamlGuy.Framework.Serial; +using TheXamlGuy.Framework.Camera; +using WeddingBooth.LifeCycles; + +namespace TheXamlGuy.App.WeddingDisplay +{ + public partial class App : Application + { + protected override async void OnStartup(StartupEventArgs args) + { + base.OnStartup(args); + + IHost? host = new HostBuilder() + .UseContentRoot(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "WeddingBooth"), true) + .ConfigureAppConfiguration((context, configuration) => + { + configuration.AddWritableJsonFile("Settings.json", false, true, writableConfiguration => + { + writableConfiguration.AddDefaultFileStream(Assembly.GetExecutingAssembly().ExtractResource("Settings.json")!) + .AddDefaultConfiguration("Startup") + .AddDefaultConfiguration("Navigation") + .AddDefaultConfiguration("Microcontroller") + .AddDefaultConfiguration("RemoteCamera"); + }); + }) + .ConfigureMicrocontrollers((context, builder) => + { + builder.Add(context.Configuration.GetSection("Microcontroller")) + .AddModule(); + }) + .ConfigureEvents(configuration => + { + configuration.Add>().WithHandler(args => args); + configuration.Add>().WithHandler(args => args); + configuration.Add().WithHandler(args => args); + }) + .ConfigureTemplates(configuration => + { + configuration.Add("Navigation"); + configuration.Add("Welcome"); + configuration.Add("Seatings"); + configuration.Add("Camera"); + configuration.Add("Gallery"); + }) + .ConfigureCamera((context, builder) => + { + builder.Add(context.Configuration.GetSection("RemoteCamera")); + }) + .ConfigureServices(ConfigureServices) + .Build(); + + await host.RunAsync(); + } + + private void ConfigureServices(HostBuilderContext context, IServiceCollection services) + { + services.AddReqiredCore() + .AddRequiredWpf() + .AddHostedService() + .AddSingleton() + .AddSingleton() + .AddConfiguration(context.Configuration.GetSection("Startup")) + .AddConfiguration(context.Configuration.GetSection("Navigation")) + .AddConfiguration(context.Configuration.GetSection("Microcontroller")) + .AddConfiguration(context.Configuration.GetSection("RemoteCamera")) + .RegisterHandlers(); + } + } +} diff --git a/App/WeddingBooth/LifeCycles/CapturedHandler.cs b/App/WeddingBooth/LifeCycles/CapturedHandler.cs new file mode 100644 index 0000000..87cd2c1 --- /dev/null +++ b/App/WeddingBooth/LifeCycles/CapturedHandler.cs @@ -0,0 +1,35 @@ +using Microsoft.Extensions.Hosting; +using System; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Linq; +using TheXamlGuy.Framework.Camera; +using TheXamlGuy.Framework.Core; + +namespace WeddingBooth.LifeCycles +{ + public class CapturedHandler : IMediatorHandler + { + private readonly IHostEnvironment hostEnvironment; + + public CapturedHandler(IHostEnvironment hostEnvironment) + { + this.hostEnvironment = hostEnvironment; + } + + public void Handle(Captured request) + { + if (request.Photo is Bitmap bitmap) + { + using Bitmap writableBitmap = new(bitmap); + string directory = Path.Combine(hostEnvironment.ContentRootPath, "Photos"); + Directory.CreateDirectory(directory); + + ImageCodecInfo encoder = ImageCodecInfo.GetImageEncoders().First(x => x.FormatID == ImageFormat.Jpeg.Guid); + EncoderParameters encoderParameters = new() { Param = new[] { new EncoderParameter(Encoder.Quality, 100L) } }; + writableBitmap.Save($"{directory}\\{DateTime.Now:MMddyyyy-HHmmss}.jpg", encoder, encoderParameters); + } + } + } +} diff --git a/App/WeddingBooth/LifeCycles/NavigationConfiguration.cs b/App/WeddingBooth/LifeCycles/NavigationConfiguration.cs new file mode 100644 index 0000000..cc40b0d --- /dev/null +++ b/App/WeddingBooth/LifeCycles/NavigationConfiguration.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace WeddingBooth.LifeCycles +{ + public class NavigationConfiguration : List + { + + } +} diff --git a/App/WeddingBooth/LifeCycles/NavigationConfigurationHandler.cs b/App/WeddingBooth/LifeCycles/NavigationConfigurationHandler.cs new file mode 100644 index 0000000..f4419f2 --- /dev/null +++ b/App/WeddingBooth/LifeCycles/NavigationConfigurationHandler.cs @@ -0,0 +1,39 @@ +using TheXamlGuy.Framework.Core; +using TheXamlGuy.Framework.WPF; +using WeddingBooth.Views; + +namespace WeddingBooth.LifeCycles +{ + + public class NavigationNavigatedHandler : IMediatorHandler> + { + private readonly NavigationConfiguration configuration; + + public NavigationNavigatedHandler(NavigationConfiguration configuration) + { + this.configuration = configuration; + } + + public void Handle(Navigated request) + { + foreach (string navigation in configuration) + { + switch (navigation) + { + case "Welcome": + request.DataContext?.Add(); + break; + case "SeatingChart": + request.DataContext?.Add(); + break; + case "Camera": + request.DataContext?.Add(); + break; + case "Gallery": + request.DataContext?.Add(); + break; + } + } + } + } +} diff --git a/App/WeddingBooth/LifeCycles/StartedHandler.cs b/App/WeddingBooth/LifeCycles/StartedHandler.cs new file mode 100644 index 0000000..de4acad --- /dev/null +++ b/App/WeddingBooth/LifeCycles/StartedHandler.cs @@ -0,0 +1,47 @@ +using System.Linq; +using System.Windows; +using TheXamlGuy.Framework.Core; +using WeddingBooth.Views; +using WpfScreenHelper; + +namespace WeddingBooth.LifeCycles +{ + public class StartedHandler : IMediatorHandler + { + private readonly StartupConfiguration configuration; + private readonly MainWindow window; + private readonly MainWindowViewModel viewModel; + + public StartedHandler(StartupConfiguration configuration, + MainWindow window, + MainWindowViewModel viewModel) + { + this.configuration = configuration; + this.window = window; + this.viewModel = viewModel; + } + + public void Handle(Started request) + { + window.DataContext = viewModel; + window.Show(); + + if (configuration.Display is string display) + { + Screen? screen = Screen.AllScreens.FirstOrDefault(x => x.DeviceName.Contains(display, System.StringComparison.InvariantCultureIgnoreCase)) ?? Screen.AllScreens.FirstOrDefault(); + if (screen is not null) + { + window.Left = screen.Bounds.Left; + window.Top = screen.Bounds.Top; + window.Width = screen.Bounds.Width; + window.Height = screen.Bounds.Height; + } + + if (configuration.FullScreen) + { + window.WindowState = WindowState.Maximized; + } + } + } + } +} diff --git a/App/WeddingBooth/LifeCycles/StartupConfiguration.cs b/App/WeddingBooth/LifeCycles/StartupConfiguration.cs new file mode 100644 index 0000000..3718f99 --- /dev/null +++ b/App/WeddingBooth/LifeCycles/StartupConfiguration.cs @@ -0,0 +1,10 @@ +namespace WeddingBooth.LifeCycles +{ + public class StartupConfiguration + { + public bool FullScreen { get; set; } + + public string? Display { get; set; } + + } +} diff --git a/App/WeddingBooth/LifeCycles/Table.cs b/App/WeddingBooth/LifeCycles/Table.cs new file mode 100644 index 0000000..d4f59e2 --- /dev/null +++ b/App/WeddingBooth/LifeCycles/Table.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace WeddingBooth.LifeCycles +{ + public class Table + { + public string? Name { get; set; } + + public List Guests { get; set; } = new List(); + } +} diff --git a/App/WeddingBooth/Markups/CapturedConverter.cs b/App/WeddingBooth/Markups/CapturedConverter.cs new file mode 100644 index 0000000..0bf4ef0 --- /dev/null +++ b/App/WeddingBooth/Markups/CapturedConverter.cs @@ -0,0 +1,32 @@ +using System; +using System.Drawing; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Windows; +using System.Windows.Interop; +using System.Windows.Media.Imaging; +using TheXamlGuy.Framework.Camera; +using TheXamlGuy.UI.WPF; + +namespace WeddingBooth.Markups +{ + public class CapturedConverter : ValueConverter + { + [DllImport("gdi32.dll")] + private static extern bool DeleteObject(IntPtr hObject); + + protected override BitmapSource? ConvertTo(Captured value, Type? targetType, object? parameter, CultureInfo? culture) + { + if (value.Photo is Bitmap bitmap) + { + IntPtr handle = bitmap.GetHbitmap(); + BitmapSource image = Imaging.CreateBitmapSourceFromHBitmap(handle, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromWidthAndHeight(value.Width, value.Height)); + + DeleteObject(handle); + return image; + } + + return default; + } + } +} diff --git a/App/WeddingBooth/Properties/AssemblyInfo.cs b/App/WeddingBooth/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..76af59d --- /dev/null +++ b/App/WeddingBooth/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Windows; + +[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] diff --git a/App/WeddingBooth/Settings.json b/App/WeddingBooth/Settings.json new file mode 100644 index 0000000..e6a4bbb --- /dev/null +++ b/App/WeddingBooth/Settings.json @@ -0,0 +1,140 @@ +{ + "Startup": { + "Display": "DISPLAY2", + "FullScreen": true + }, + "Navigation": [ + "Welcome", + "Camera" + ], + "Microcontroller": { + "PortName": "COM7", + "BaudRate": 9600 + }, + "RemoteCamera": { + "Name": "Test" + }, + "SeatingChart": [ + { + "Name": "one", + "Guests": [ + "Lynne Lamb", + "Peter Lamb", + "Liam Lamb", + "Ryan Lamb", + "Mabel Lamb", + "Hayley Lamb", + "Nikki Rushton", + "John Clark", + "Rebecca Days" + ] + }, + { + "Name": "two", + "Guests": [ + "Pauline Clough", + "John Clough", + "Ava Lamb-Clark", + "Nathan Clark", + "Emma Cunnington", + "George Clough", + "Vera Clough", + "Margaret Clayton" + ] + }, + { + "Name": "three", + "Guests": [ + "Alex Clark", + "Anita Chan", + "Trevor Million", + "Lisa Iveson", + "Brian Clark", + "Brian Clark", + "Emma Lee", + "Lisa Clark", + "Siân Laura Davies" + ] + }, + { + "Name": "four", + "Guests": [ + "Michael Lamb", + "Lesley Lamb", + "Ken Clough", + "Kathryn Dodds", + "Patricia Clough", + "Ann Peck", + "Greg Peck" + ] + }, + { + "Name": "five", + "Guests": [ + "Olive Shorten", + "Lynne Shorten", + "Joyce Clark", + "Alison Clarke", + "Jim Clarke", + "Scott Thirlaway", + "Kevin McVittie", + "Katharyn Church", + "Eve Clark", + "Grace Clark" + ] + }, + { + "Name": "six", + "Guests": [ + "Tom Parker", + "Amy Parker", + "Stephen Coates", + "Ashley Coates", + "Callie Coates", + "Ellie Coates", + "Colin Armstrong", + "Kelly Shearsmith", + "Jay Evans" + ] + }, + { + "Name": "seven", + "Guests": [ + "Kelly Taylor", + "Phillip Taylor", + "Lucas Taylor", + "Lana Taylor", + "Christopher Lamb", + "Emma Hunter", + "Tommy", + "Livinya" + ] + }, + { + "Name": "eight", + "Guests": [ + "Harry Clough", + "Jack Clough", + "Corey Derbyshire", + "Shauna Gallon", + "Lora Johnstone", + "Steven Clark", + "Michael Clarke", + "Nicole Wright" + ] + }, + { + "Name": "nine", + "Guests": [ + "Vikki Finnigan", + "Logan Finnigan", + "Gemma Carr", + "Alysha Carr", + "Ross Finnigan", + "Jemma Clark", + "Lily-Rose Goddard", + "David Ford" + ] + } + ] +} \ No newline at end of file diff --git a/App/WeddingBooth/Views/CameraView.xaml b/App/WeddingBooth/Views/CameraView.xaml new file mode 100644 index 0000000..0498496 --- /dev/null +++ b/App/WeddingBooth/Views/CameraView.xaml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/WeddingBooth/Views/CameraView.xaml.cs b/App/WeddingBooth/Views/CameraView.xaml.cs new file mode 100644 index 0000000..92a415f --- /dev/null +++ b/App/WeddingBooth/Views/CameraView.xaml.cs @@ -0,0 +1,16 @@ + +namespace WeddingBooth.Views; + +public partial class CameraView +{ + public CameraView() + { + InitializeComponent(); + Loaded += CameraView_Loaded; + } + + private void CameraView_Loaded(object sender, System.Windows.RoutedEventArgs e) + { + CameraPreview.StartAsync(); + } +} diff --git a/App/WeddingBooth/Views/CameraViewModel.cs b/App/WeddingBooth/Views/CameraViewModel.cs new file mode 100644 index 0000000..becdf34 --- /dev/null +++ b/App/WeddingBooth/Views/CameraViewModel.cs @@ -0,0 +1,22 @@ +using System; +using TheXamlGuy.Framework.Camera; +using TheXamlGuy.Framework.Core; + +namespace WeddingBooth.Views; + +public class CameraViewModel : ObservableViewModel +{ + public CameraViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + } + + public bool CanCapture { get; set; } = true; + + public void Capture() + { + EventAggregator.Publish(); + } +} diff --git a/App/WeddingBooth/Views/GalleryView.xaml b/App/WeddingBooth/Views/GalleryView.xaml new file mode 100644 index 0000000..7363bb6 --- /dev/null +++ b/App/WeddingBooth/Views/GalleryView.xaml @@ -0,0 +1,14 @@ + + + diff --git a/App/WeddingBooth/Views/GalleryView.xaml.cs b/App/WeddingBooth/Views/GalleryView.xaml.cs new file mode 100644 index 0000000..6f633ad --- /dev/null +++ b/App/WeddingBooth/Views/GalleryView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace WeddingBooth.Views +{ + /// + /// Interaction logic for GalleryView.xaml + /// + public partial class GalleryView : UserControl + { + public GalleryView() + { + InitializeComponent(); + } + } +} diff --git a/App/WeddingBooth/Views/GalleryViewModel.cs b/App/WeddingBooth/Views/GalleryViewModel.cs new file mode 100644 index 0000000..f7a5caf --- /dev/null +++ b/App/WeddingBooth/Views/GalleryViewModel.cs @@ -0,0 +1,14 @@ +using TheXamlGuy.Framework.Core; + +namespace WeddingBooth.Views; + +public class GalleryViewModel : ObservableViewModel +{ + public GalleryViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + + } +} diff --git a/App/WeddingBooth/Views/GuestViewModel.cs b/App/WeddingBooth/Views/GuestViewModel.cs new file mode 100644 index 0000000..5828bb4 --- /dev/null +++ b/App/WeddingBooth/Views/GuestViewModel.cs @@ -0,0 +1,17 @@ +using TheXamlGuy.Framework.Core; + +namespace WeddingBooth.Views; + +public class GuestViewModel : ObservableViewModel +{ + public GuestViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + string name) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + Name = name; + } + + public string Name { get; } +} diff --git a/App/WeddingBooth/Views/MainWindow.xaml b/App/WeddingBooth/Views/MainWindow.xaml new file mode 100644 index 0000000..fa59ce8 --- /dev/null +++ b/App/WeddingBooth/Views/MainWindow.xaml @@ -0,0 +1,10 @@ + diff --git a/App/WeddingBooth/Views/MainWindow.xaml.cs b/App/WeddingBooth/Views/MainWindow.xaml.cs new file mode 100644 index 0000000..89e2d3b --- /dev/null +++ b/App/WeddingBooth/Views/MainWindow.xaml.cs @@ -0,0 +1,23 @@ +using System.Linq; + +namespace WeddingBooth.Views; + +public partial class MainWindow +{ + public MainWindow() + { + InitializeComponent(); + + //var DeviceManager = new CameraDeviceManager(); + //DeviceManager.ConnectToCamera(); + + //DeviceManager.AddDevice(d[3].Connect("192.168.1.1")); + + //DeviceManager.CameraConnected += DeviceManager_CameraConnected; + + //DeviceManager.SelectedCameraDevice.PhotoCaptured += SelectedCameraDevice_PhotoCaptured; + + //DeviceManager.SelectedCameraDevice.CapturePhoto(); + + } +} diff --git a/App/WeddingBooth/Views/MainWindowViewModel.cs b/App/WeddingBooth/Views/MainWindowViewModel.cs new file mode 100644 index 0000000..0f35b8e --- /dev/null +++ b/App/WeddingBooth/Views/MainWindowViewModel.cs @@ -0,0 +1,18 @@ +using TheXamlGuy.Framework.Core; +using TheXamlGuy.Framework.WPF; + +namespace WeddingBooth.Views; + +public class MainWindowViewModel : ObservableViewModel +{ + public MainWindowViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + IRoute route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + Route = route; + } + + public IRoute Route { get; } +} diff --git a/App/WeddingBooth/Views/NavigationView.xaml b/App/WeddingBooth/Views/NavigationView.xaml new file mode 100644 index 0000000..7e12049 --- /dev/null +++ b/App/WeddingBooth/Views/NavigationView.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + diff --git a/App/WeddingBooth/Views/NavigationView.xaml.cs b/App/WeddingBooth/Views/NavigationView.xaml.cs new file mode 100644 index 0000000..4978ae8 --- /dev/null +++ b/App/WeddingBooth/Views/NavigationView.xaml.cs @@ -0,0 +1,9 @@ +namespace WeddingBooth.Views; + +public partial class NavigationView +{ + public NavigationView() + { + InitializeComponent(); + } +} diff --git a/App/WeddingBooth/Views/NavigationViewModel.cs b/App/WeddingBooth/Views/NavigationViewModel.cs new file mode 100644 index 0000000..5c04b65 --- /dev/null +++ b/App/WeddingBooth/Views/NavigationViewModel.cs @@ -0,0 +1,17 @@ +using TheXamlGuy.Framework.Core; + +namespace WeddingBooth.Views; + +public class NavigationViewModel : ObservableViewModelCollection +{ + public NavigationViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + ITemplateSelector templateSelector) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + TemplateSelector = templateSelector; + } + + public ITemplateSelector TemplateSelector { get; } +} diff --git a/App/WeddingBooth/Views/SeatingChartConfiguration.cs b/App/WeddingBooth/Views/SeatingChartConfiguration.cs new file mode 100644 index 0000000..93c7203 --- /dev/null +++ b/App/WeddingBooth/Views/SeatingChartConfiguration.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace WeddingBooth.LifeCycles +{ + public class SeatingChartConfiguration : List + { + + } +} diff --git a/App/WeddingBooth/Views/SeatingChartNavigatedHandler.cs b/App/WeddingBooth/Views/SeatingChartNavigatedHandler.cs new file mode 100644 index 0000000..7f961ad --- /dev/null +++ b/App/WeddingBooth/Views/SeatingChartNavigatedHandler.cs @@ -0,0 +1,30 @@ +using TheXamlGuy.Framework.Core; +using TheXamlGuy.Framework.WPF; +using WeddingBooth.Views; + +namespace WeddingBooth.LifeCycles +{ + public class SeatingChartNavigatedHandler : IMediatorHandler> + { + private readonly SeatingChartConfiguration configuration; + + public SeatingChartNavigatedHandler(SeatingChartConfiguration configuration) + { + this.configuration = configuration; + } + + public void Handle(Navigated request) + { + foreach (Table table in configuration) + { + if(request.DataContext?.Add(table.Name) is TableViewModel tableViewModel) + { + foreach (string guest in table.Guests) + { + tableViewModel.Add(guest); + } + } + } + } + } +} diff --git a/App/WeddingBooth/Views/SeatingChartView.xaml b/App/WeddingBooth/Views/SeatingChartView.xaml new file mode 100644 index 0000000..9a194fc --- /dev/null +++ b/App/WeddingBooth/Views/SeatingChartView.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + diff --git a/App/WeddingBooth/Views/SeatingChartView.xaml.cs b/App/WeddingBooth/Views/SeatingChartView.xaml.cs new file mode 100644 index 0000000..9cbd158 --- /dev/null +++ b/App/WeddingBooth/Views/SeatingChartView.xaml.cs @@ -0,0 +1,11 @@ +using System.Windows.Controls; + +namespace WeddingBooth.Views; + +public partial class SeatingChartView : UserControl +{ + public SeatingChartView() + { + InitializeComponent(); + } +} diff --git a/App/WeddingBooth/Views/SeatingChartViewModel.cs b/App/WeddingBooth/Views/SeatingChartViewModel.cs new file mode 100644 index 0000000..c71a3da --- /dev/null +++ b/App/WeddingBooth/Views/SeatingChartViewModel.cs @@ -0,0 +1,17 @@ +using TheXamlGuy.Framework.Core; + +namespace WeddingBooth.Views; + +public class SeatingChartViewModel : ObservableViewModelCollection +{ + public SeatingChartViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + ITemplateSelector templateSelector) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + TemplateSelector = templateSelector; + } + + public ITemplateSelector TemplateSelector { get; } +} diff --git a/App/WeddingBooth/Views/TableView.xaml b/App/WeddingBooth/Views/TableView.xaml new file mode 100644 index 0000000..7c244d5 --- /dev/null +++ b/App/WeddingBooth/Views/TableView.xaml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/WeddingBooth/Views/TableView.xaml.cs b/App/WeddingBooth/Views/TableView.xaml.cs new file mode 100644 index 0000000..5f68108 --- /dev/null +++ b/App/WeddingBooth/Views/TableView.xaml.cs @@ -0,0 +1,9 @@ +namespace WeddingBooth.Views; + +public partial class TableView +{ + public TableView() + { + InitializeComponent(); + } +} diff --git a/App/WeddingBooth/Views/TableViewModel.cs b/App/WeddingBooth/Views/TableViewModel.cs new file mode 100644 index 0000000..5d4d3ff --- /dev/null +++ b/App/WeddingBooth/Views/TableViewModel.cs @@ -0,0 +1,17 @@ +using TheXamlGuy.Framework.Core; + +namespace WeddingBooth.Views; + +public class TableViewModel : ObservableViewModelCollection +{ + public TableViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + string name) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + Name = name; + } + + public string Name { get; } +} diff --git a/App/WeddingBooth/Views/WelcomeView.xaml b/App/WeddingBooth/Views/WelcomeView.xaml new file mode 100644 index 0000000..baf3d7a --- /dev/null +++ b/App/WeddingBooth/Views/WelcomeView.xaml @@ -0,0 +1,40 @@ + + + + + + + + + diff --git a/App/WeddingBooth/Views/WelcomeView.xaml.cs b/App/WeddingBooth/Views/WelcomeView.xaml.cs new file mode 100644 index 0000000..f634635 --- /dev/null +++ b/App/WeddingBooth/Views/WelcomeView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace WeddingBooth.Views +{ + /// + /// Interaction logic for WelcomeView.xaml + /// + public partial class WelcomeView : UserControl + { + public WelcomeView() + { + InitializeComponent(); + } + } +} diff --git a/App/WeddingBooth/Views/WelcomeViewModel.cs b/App/WeddingBooth/Views/WelcomeViewModel.cs new file mode 100644 index 0000000..ba83946 --- /dev/null +++ b/App/WeddingBooth/Views/WelcomeViewModel.cs @@ -0,0 +1,15 @@ +using TheXamlGuy.Framework.Core; + +namespace WeddingBooth.Views; + +public class WelcomeViewModel : ObservableViewModel +{ + public WelcomeViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + + } + +} diff --git a/App/WeddingBooth/WeddingBooth.csproj b/App/WeddingBooth/WeddingBooth.csproj new file mode 100644 index 0000000..d1fa0e4 --- /dev/null +++ b/App/WeddingBooth/WeddingBooth.csproj @@ -0,0 +1,29 @@ + + + WinExe + net6.0-windows10.0.18362.0 + enable + true + AnyCPU;x64 + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/WeddingBuilder/.gitignore b/App/WeddingBuilder/.gitignore new file mode 100644 index 0000000..8afdcb6 --- /dev/null +++ b/App/WeddingBuilder/.gitignore @@ -0,0 +1,454 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# JetBrains Rider +.idea/ +*.sln.iml + +## +## Visual Studio Code +## +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json diff --git a/App/WeddingBuilder/App.axaml b/App/WeddingBuilder/App.axaml new file mode 100644 index 0000000..1218238 --- /dev/null +++ b/App/WeddingBuilder/App.axaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + diff --git a/App/WeddingBuilder/App.axaml.cs b/App/WeddingBuilder/App.axaml.cs new file mode 100644 index 0000000..3b4e3a7 --- /dev/null +++ b/App/WeddingBuilder/App.axaml.cs @@ -0,0 +1,53 @@ +using Avalonia; +using Avalonia.Markup.Xaml; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using PropertyChanged; +using System; +using System.IO; +using TheXamlGuy.Framework.Avalonia; +using TheXamlGuy.Framework.Core; + +namespace Builder +{ + [DoNotNotify] + public partial class App : Application + { + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override async void OnFrameworkInitializationCompleted() + { + IHost? host = new HostBuilder() + .UseContentRoot(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Builder"), true) + .ConfigureTemplates(configuration => + { + configuration.Add(); + configuration.Add("Main"); + configuration.Add("ProjectConfiguration"); + configuration.Add("StartProjectConfiguration"); + configuration.Add("CreateProjectConfiguration"); + configuration.Add("ExistingProjectConfiguration"); + configuration.Add("Project"); + configuration.Add("PageDesigner"); + configuration.Add("Pages"); + configuration.Add("AddPage"); + }) + .ConfigureServices(ConfigureServices) + .Build(); + + await host.RunAsync(); + base.OnFrameworkInitializationCompleted(); + } + + private void ConfigureServices(HostBuilderContext context, IServiceCollection services) + { + services.AddReqiredCore() + .AddRequiredAvalonia() + .AddHostedService() + .RegisterHandlers(); + } + } +} diff --git a/App/WeddingBuilder/Builder.csproj b/App/WeddingBuilder/Builder.csproj new file mode 100644 index 0000000..64641fb --- /dev/null +++ b/App/WeddingBuilder/Builder.csproj @@ -0,0 +1,43 @@ + + + WinExe + net6.0 + enable + copyused + true + + + + + + + + + + + + + + + + + + + + + + + + + ..\..\Framework\Avalonia\References\FluentAvalonia.dll + + + + + StartProjectConfigurationView.axaml + + + ProjectView.axaml + + + diff --git a/App/WeddingBuilder/FodyWeavers.xml b/App/WeddingBuilder/FodyWeavers.xml new file mode 100644 index 0000000..d5abfed --- /dev/null +++ b/App/WeddingBuilder/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/App/WeddingBuilder/LifeCycles/AddPage.cs b/App/WeddingBuilder/LifeCycles/AddPage.cs new file mode 100644 index 0000000..9c349d9 --- /dev/null +++ b/App/WeddingBuilder/LifeCycles/AddPage.cs @@ -0,0 +1,3 @@ +namespace Builder.LifeCycles; + +public record AddPage(string Name); diff --git a/App/WeddingBuilder/LifeCycles/AddPageHandler.cs b/App/WeddingBuilder/LifeCycles/AddPageHandler.cs new file mode 100644 index 0000000..a099e4e --- /dev/null +++ b/App/WeddingBuilder/LifeCycles/AddPageHandler.cs @@ -0,0 +1,18 @@ +using TheXamlGuy.Framework.Core; + +namespace Builder.LifeCycles; + +public class AddPageHandler : IMediatorHandler +{ + private readonly IProjectContext context; + + public AddPageHandler(IProjectContext context) + { + this.context = context; + } + + public void Handle(AddPage request) + { + context.Pages.Add(new Page(request.Name)); + } +} diff --git a/App/WeddingBuilder/LifeCycles/IProjectContext.cs b/App/WeddingBuilder/LifeCycles/IProjectContext.cs new file mode 100644 index 0000000..c271d3d --- /dev/null +++ b/App/WeddingBuilder/LifeCycles/IProjectContext.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace Builder.LifeCycles +{ + public interface IProjectContext + { + ICollection Pages { get; } + } +} \ No newline at end of file diff --git a/App/WeddingBuilder/LifeCycles/Page.cs b/App/WeddingBuilder/LifeCycles/Page.cs new file mode 100644 index 0000000..40eec4a --- /dev/null +++ b/App/WeddingBuilder/LifeCycles/Page.cs @@ -0,0 +1,4 @@ +namespace Builder.LifeCycles +{ + public record Page(string Name); +} diff --git a/App/WeddingBuilder/LifeCycles/ProjectConfiguration.cs b/App/WeddingBuilder/LifeCycles/ProjectConfiguration.cs new file mode 100644 index 0000000..d7e044a --- /dev/null +++ b/App/WeddingBuilder/LifeCycles/ProjectConfiguration.cs @@ -0,0 +1,7 @@ +namespace Builder.LifeCycles +{ + public class ProjectConfiguration + { + + } +} diff --git a/App/WeddingBuilder/LifeCycles/ProjectContext.cs b/App/WeddingBuilder/LifeCycles/ProjectContext.cs new file mode 100644 index 0000000..0b9a811 --- /dev/null +++ b/App/WeddingBuilder/LifeCycles/ProjectContext.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace Builder.LifeCycles +{ + public class ProjectContext : IProjectContext + { + public ICollection Pages => new List(); + } + + public interface IProjectScope + { + + } +} diff --git a/App/WeddingBuilder/LifeCycles/StartedHandler.cs b/App/WeddingBuilder/LifeCycles/StartedHandler.cs new file mode 100644 index 0000000..3caa2e9 --- /dev/null +++ b/App/WeddingBuilder/LifeCycles/StartedHandler.cs @@ -0,0 +1,27 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using TheXamlGuy.Framework.Core; + +namespace Builder; + +public class StartedHandler : IMediatorHandler +{ + private readonly MainWindow window; + private readonly MainWindowViewModel viewModel; + + public StartedHandler(MainWindow window, + MainWindowViewModel viewModel) + { + this.window = window; + this.viewModel = viewModel; + } + + public void Handle(Started request) + { + window.DataContext = viewModel; + if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = window; + } + } +} diff --git a/App/WeddingBuilder/Program.cs b/App/WeddingBuilder/Program.cs new file mode 100644 index 0000000..3884319 --- /dev/null +++ b/App/WeddingBuilder/Program.cs @@ -0,0 +1,20 @@ +using Avalonia; +using System; + +namespace Builder; + +internal class Program +{ + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .With(new Win32PlatformOptions + { + UseCompositor = false + }) + .LogToTrace(); +} diff --git a/App/WeddingBuilder/Properties/Assembly.cs b/App/WeddingBuilder/Properties/Assembly.cs new file mode 100644 index 0000000..e814e0f --- /dev/null +++ b/App/WeddingBuilder/Properties/Assembly.cs @@ -0,0 +1,3 @@ +using Avalonia.Metadata; + +[assembly: XmlnsDefinition("https://github.com/avaloniaui", "FluentAvalonia.UI.Controls")] \ No newline at end of file diff --git a/App/WeddingBuilder/Views/AddPageView.axaml b/App/WeddingBuilder/Views/AddPageView.axaml new file mode 100644 index 0000000..6396238 --- /dev/null +++ b/App/WeddingBuilder/Views/AddPageView.axaml @@ -0,0 +1,16 @@ + + + diff --git a/App/WeddingBuilder/Views/AddPageView.axaml.cs b/App/WeddingBuilder/Views/AddPageView.axaml.cs new file mode 100644 index 0000000..69a5984 --- /dev/null +++ b/App/WeddingBuilder/Views/AddPageView.axaml.cs @@ -0,0 +1,17 @@ +using Avalonia.Styling; +using FluentAvalonia.UI.Controls; +using PropertyChanged; +using System; + +namespace Builder; + +[DoNotNotify] +public partial class AddPageView : ContentDialog, IStyleable +{ + public AddPageView() + { + InitializeComponent(); + } + + Type IStyleable.StyleKey => typeof(ContentDialog); +} diff --git a/App/WeddingBuilder/Views/AddPageViewModel.cs b/App/WeddingBuilder/Views/AddPageViewModel.cs new file mode 100644 index 0000000..af6cb87 --- /dev/null +++ b/App/WeddingBuilder/Views/AddPageViewModel.cs @@ -0,0 +1,22 @@ +using Builder.LifeCycles; +using TheXamlGuy.Framework.Core; + +namespace Builder; + +public class AddPageViewModel : ObservableViewModel +{ + public AddPageViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + + } + + public string? Name { get; set; } + + public void Add() + { + EventAggregator.Publish(new AddPage(Name)); + } +} \ No newline at end of file diff --git a/App/WeddingBuilder/Views/CreateProjectConfigurationView.axaml b/App/WeddingBuilder/Views/CreateProjectConfigurationView.axaml new file mode 100644 index 0000000..9b02d23 --- /dev/null +++ b/App/WeddingBuilder/Views/CreateProjectConfigurationView.axaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/App/WeddingBuilder/Views/PageCollectionView.axaml.cs b/App/WeddingBuilder/Views/PageCollectionView.axaml.cs new file mode 100644 index 0000000..3312d5c --- /dev/null +++ b/App/WeddingBuilder/Views/PageCollectionView.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia.Controls; +using PropertyChanged; + +namespace Builder; + +[DoNotNotify] +public partial class PageCollectionView : UserControl +{ + public PageCollectionView() + { + InitializeComponent(); + } +} diff --git a/App/WeddingBuilder/Views/PageCollectionViewModel.cs b/App/WeddingBuilder/Views/PageCollectionViewModel.cs new file mode 100644 index 0000000..da4d5a8 --- /dev/null +++ b/App/WeddingBuilder/Views/PageCollectionViewModel.cs @@ -0,0 +1,22 @@ +using TheXamlGuy.Framework.Avalonia; +using TheXamlGuy.Framework.Core; + +namespace Builder; + +public class PageCollectionViewModel : ObservableViewModelCollection +{ + public PageCollectionViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + ITemplateSelector templateSelector, + IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + TemplateSelector = templateSelector; + Route = route; + } + + public ITemplateSelector TemplateSelector { get; } + + public IRouter Route { get; } +} \ No newline at end of file diff --git a/App/WeddingBuilder/Views/PageDesignerView.axaml b/App/WeddingBuilder/Views/PageDesignerView.axaml new file mode 100644 index 0000000..fdf4493 --- /dev/null +++ b/App/WeddingBuilder/Views/PageDesignerView.axaml @@ -0,0 +1,9 @@ + + + diff --git a/App/WeddingBuilder/Views/PageDesignerView.axaml.cs b/App/WeddingBuilder/Views/PageDesignerView.axaml.cs new file mode 100644 index 0000000..3022af0 --- /dev/null +++ b/App/WeddingBuilder/Views/PageDesignerView.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia.Controls; +using PropertyChanged; + +namespace Builder; + +[DoNotNotify] +public partial class PageDesignerView : UserControl +{ + public PageDesignerView() + { + InitializeComponent(); + } +} diff --git a/App/WeddingBuilder/Views/PageDesignerViewModel.cs b/App/WeddingBuilder/Views/PageDesignerViewModel.cs new file mode 100644 index 0000000..6340975 --- /dev/null +++ b/App/WeddingBuilder/Views/PageDesignerViewModel.cs @@ -0,0 +1,18 @@ +using TheXamlGuy.Framework.Avalonia; +using TheXamlGuy.Framework.Core; + +namespace Builder; + +public class PageDesignerViewModel : ObservableViewModel +{ + public PageDesignerViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + Route = route; + } + + public IRouter Route { get; } +} diff --git a/App/WeddingBuilder/Views/PageItemViewModel.cs b/App/WeddingBuilder/Views/PageItemViewModel.cs new file mode 100644 index 0000000..74fa9c7 --- /dev/null +++ b/App/WeddingBuilder/Views/PageItemViewModel.cs @@ -0,0 +1,22 @@ +using TheXamlGuy.Framework.Avalonia; +using TheXamlGuy.Framework.Core; + +namespace Builder; + +public class PageItemViewModel : ObservableViewModel +{ + public PageItemViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + IRouter route, + string name) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + Route = route; + Name = name; + } + + public IRouter Route { get; } + + public string Name { get; } +} diff --git a/App/WeddingBuilder/Views/ProjectConfigurationView.axaml b/App/WeddingBuilder/Views/ProjectConfigurationView.axaml new file mode 100644 index 0000000..5c91ade --- /dev/null +++ b/App/WeddingBuilder/Views/ProjectConfigurationView.axaml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/WeddingBuilder/Views/ProjectConfigurationView.axaml.cs b/App/WeddingBuilder/Views/ProjectConfigurationView.axaml.cs new file mode 100644 index 0000000..6e09ce1 --- /dev/null +++ b/App/WeddingBuilder/Views/ProjectConfigurationView.axaml.cs @@ -0,0 +1,17 @@ +using Avalonia.Styling; +using FluentAvalonia.UI.Controls; +using PropertyChanged; +using System; + +namespace Builder; + +[DoNotNotify] +public partial class ProjectConfigurationView : ContentDialog, IStyleable +{ + public ProjectConfigurationView() + { + InitializeComponent(); + } + + Type IStyleable.StyleKey => typeof(ContentDialog); +} diff --git a/App/WeddingBuilder/Views/ProjectConfigurationViewModel.cs b/App/WeddingBuilder/Views/ProjectConfigurationViewModel.cs new file mode 100644 index 0000000..a318c1c --- /dev/null +++ b/App/WeddingBuilder/Views/ProjectConfigurationViewModel.cs @@ -0,0 +1,18 @@ +using TheXamlGuy.Framework.Avalonia; +using TheXamlGuy.Framework.Core; + +namespace Builder; + +public class ProjectConfigurationViewModel : ObservableViewModel +{ + public ProjectConfigurationViewModel(IPropertyBuilder propertyBuilder, + IEventAggregator eventAggregator, + IServiceFactory serviceFactory, + IDisposer disposer, + IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer) + { + Route = route; + } + + public IRouter Route { get; } +} diff --git a/App/WeddingBuilder/Views/ProjectView.axaml b/App/WeddingBuilder/Views/ProjectView.axaml new file mode 100644 index 0000000..ed30dfd --- /dev/null +++ b/App/WeddingBuilder/Views/ProjectView.axaml @@ -0,0 +1,23 @@ + + +