From eadcd9236f17152b241823b680689464409f0308 Mon Sep 17 00:00:00 2001 From: Vladyslav Horbachov Date: Sun, 21 Jan 2024 01:36:18 +0100 Subject: [PATCH] Add ProductView2 with markup from TemplateStudio --- .../Services/Navigation/PageService.cs | 4 +- .../Inventory.Presentation.csproj | 9 ++ .../Views/Product/ProductView2.xaml | 106 ++++++++++++++++++ .../Views/Product/ProductView2.xaml.cs | 71 ++++++++++++ 4 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 src/Inventory.Presentation/Views/Product/ProductView2.xaml create mode 100644 src/Inventory.Presentation/Views/Product/ProductView2.xaml.cs diff --git a/src/Inventory.Infrastructure/Services/Navigation/PageService.cs b/src/Inventory.Infrastructure/Services/Navigation/PageService.cs index f6185de..b837bf7 100644 --- a/src/Inventory.Infrastructure/Services/Navigation/PageService.cs +++ b/src/Inventory.Infrastructure/Services/Navigation/PageService.cs @@ -20,7 +20,7 @@ namespace Inventory.Infrastructure.Services.Navigation; internal sealed class PageService : IPageService { - private readonly Dictionary _pages = new(); + private readonly Dictionary _pages = []; public PageService() { @@ -30,7 +30,7 @@ public PageService() Configure(); Configure(); Configure(); - Configure(); + Configure(); } public Type GetPageType(string key) diff --git a/src/Inventory.Presentation/Inventory.Presentation.csproj b/src/Inventory.Presentation/Inventory.Presentation.csproj index e188292..8f5ee33 100644 --- a/src/Inventory.Presentation/Inventory.Presentation.csproj +++ b/src/Inventory.Presentation/Inventory.Presentation.csproj @@ -21,6 +21,7 @@ + @@ -98,4 +99,12 @@ + + + + + + + + diff --git a/src/Inventory.Presentation/Views/Product/ProductView2.xaml b/src/Inventory.Presentation/Views/Product/ProductView2.xaml new file mode 100644 index 0000000..b7e2e40 --- /dev/null +++ b/src/Inventory.Presentation/Views/Product/ProductView2.xaml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Inventory.Presentation/Views/Product/ProductView2.xaml.cs b/src/Inventory.Presentation/Views/Product/ProductView2.xaml.cs new file mode 100644 index 0000000..41c7f2d --- /dev/null +++ b/src/Inventory.Presentation/Views/Product/ProductView2.xaml.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using Inventory.Application.Models; +using Microsoft.UI.Xaml.Controls; + +namespace Inventory.Presentation.Views.Product; + +public sealed partial class ProductView2 : Page +{ + public ProductView2() + { + InitializeComponent(); + ViewModel = new SampleOrder() + { + OrderID = 10643, // Symbol Globe + OrderDate = new DateTime(1997, 8, 25), + RequiredDate = new DateTime(1997, 9, 22), + ShippedDate = new DateTime(1997, 9, 22), + ShipperName = "Speedy Express", + ShipperPhone = "(503) 555-9831", + Freight = 29.46, + Company = "Company A", + ShipTo = "Company A, Obere Str. 57, Berlin, 12209, Germany", + OrderTotal = 814.50, + Status = "Shipped", + SymbolCode = 57643, + SymbolName = "Globe", + Details = new List() + { + new() + { + ProductID = 28, + ProductName = "Rössle Sauerkraut", + Quantity = 15, + Discount = 0.25, + QuantityPerUnit = "25 - 825 g cans", + UnitPrice = 45.60, + CategoryName = "Produce", + CategoryDescription = "Dried fruit and bean curd", + Total = 513.00, + }, + new() + { + ProductID = 39, + ProductName = "Chartreuse verte", + Quantity = 21, + Discount = 0.25, + QuantityPerUnit = "750 cc per bottle", + UnitPrice = 18.0, + CategoryName = "Beverages", + CategoryDescription = "Soft drinks, coffees, teas, beers, and ales", + Total = 283.50, + }, + new() + { + ProductID = 46, + ProductName = "Spegesild", + Quantity = 2, + Discount = 0.25, + QuantityPerUnit = "4 - 450 g glasses", + UnitPrice = 12.0, + CategoryName = "Seafood", + CategoryDescription = "Seaweed and fish", + Total = 18.00, + }, + }, + }; + } + + private SampleOrder ViewModel { get; } +} \ No newline at end of file