diff --git a/Chapter09/HardwareSupplies/App.xaml b/Chapter09/HardwareSupplies/App.xaml new file mode 100644 index 0000000..5d66b0f --- /dev/null +++ b/Chapter09/HardwareSupplies/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/Chapter09/HardwareSupplies/App.xaml.cs b/Chapter09/HardwareSupplies/App.xaml.cs new file mode 100644 index 0000000..6aee8a9 --- /dev/null +++ b/Chapter09/HardwareSupplies/App.xaml.cs @@ -0,0 +1,50 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Microsoft.UI.Xaml.Shapes; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace HardwareSupplies +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); + } + + private Window m_window; + } +} diff --git a/Chapter09/HardwareSupplies/Assets/LockScreenLogo.scale-200.png b/Chapter09/HardwareSupplies/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..7440f0d Binary files /dev/null and b/Chapter09/HardwareSupplies/Assets/LockScreenLogo.scale-200.png differ diff --git a/Chapter09/HardwareSupplies/Assets/SplashScreen.scale-200.png b/Chapter09/HardwareSupplies/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..32f486a Binary files /dev/null and b/Chapter09/HardwareSupplies/Assets/SplashScreen.scale-200.png differ diff --git a/Chapter09/HardwareSupplies/Assets/Square150x150Logo.scale-200.png b/Chapter09/HardwareSupplies/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..53ee377 Binary files /dev/null and b/Chapter09/HardwareSupplies/Assets/Square150x150Logo.scale-200.png differ diff --git a/Chapter09/HardwareSupplies/Assets/Square44x44Logo.scale-200.png b/Chapter09/HardwareSupplies/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..f713bba Binary files /dev/null and b/Chapter09/HardwareSupplies/Assets/Square44x44Logo.scale-200.png differ diff --git a/Chapter09/HardwareSupplies/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Chapter09/HardwareSupplies/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..dc9f5be Binary files /dev/null and b/Chapter09/HardwareSupplies/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/Chapter09/HardwareSupplies/Assets/StoreLogo.png b/Chapter09/HardwareSupplies/Assets/StoreLogo.png new file mode 100644 index 0000000..a4586f2 Binary files /dev/null and b/Chapter09/HardwareSupplies/Assets/StoreLogo.png differ diff --git a/Chapter09/HardwareSupplies/Assets/Wide310x150Logo.scale-200.png b/Chapter09/HardwareSupplies/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..8b4a5d0 Binary files /dev/null and b/Chapter09/HardwareSupplies/Assets/Wide310x150Logo.scale-200.png differ diff --git a/Chapter09/HardwareSupplies/HardwareItem.cs b/Chapter09/HardwareSupplies/HardwareItem.cs new file mode 100644 index 0000000..82f2cbc --- /dev/null +++ b/Chapter09/HardwareSupplies/HardwareItem.cs @@ -0,0 +1,12 @@ +namespace HardwareSupplies +{ + public class HardwareItem + { + public long id { get; set; } + public string name { get; set; } + public string category { get; set; } + public int quantity { get; set; } + public decimal cost { get; set; } + public decimal price { get; set; } + } +} \ No newline at end of file diff --git a/Chapter09/HardwareSupplies/HardwareSupplies.csproj b/Chapter09/HardwareSupplies/HardwareSupplies.csproj new file mode 100644 index 0000000..7022bca --- /dev/null +++ b/Chapter09/HardwareSupplies/HardwareSupplies.csproj @@ -0,0 +1,50 @@ + + + WinExe + net6.0-windows10.0.19041.0 + 10.0.17763.0 + HardwareSupplies + app.manifest + x86;x64;ARM64 + win10-x86;win10-x64;win10-arm64 + win10-$(Platform).pubxml + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + diff --git a/Chapter09/HardwareSupplies/HardwareSupplies.sln b/Chapter09/HardwareSupplies/HardwareSupplies.sln new file mode 100644 index 0000000..8cbd2c2 --- /dev/null +++ b/Chapter09/HardwareSupplies/HardwareSupplies.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33829.357 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HardwareSupplies", "HardwareSupplies.csproj", "{8D6387EA-63C3-4077-8475-64A659F3B6E0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|ARM64.Build.0 = Debug|ARM64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|x64.ActiveCfg = Debug|x64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|x64.Build.0 = Debug|x64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|x64.Deploy.0 = Debug|x64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|x86.ActiveCfg = Debug|x86 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|x86.Build.0 = Debug|x86 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Debug|x86.Deploy.0 = Debug|x86 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|ARM64.ActiveCfg = Release|ARM64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|ARM64.Build.0 = Release|ARM64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|ARM64.Deploy.0 = Release|ARM64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|x64.ActiveCfg = Release|x64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|x64.Build.0 = Release|x64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|x64.Deploy.0 = Release|x64 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|x86.ActiveCfg = Release|x86 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|x86.Build.0 = Release|x86 + {8D6387EA-63C3-4077-8475-64A659F3B6E0}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {17DB2E2D-EA4F-4380-B1BD-756DA5889D50} + EndGlobalSection +EndGlobal diff --git a/Chapter09/HardwareSupplies/MainWindow.xaml b/Chapter09/HardwareSupplies/MainWindow.xaml new file mode 100644 index 0000000..4f51bf6 --- /dev/null +++ b/Chapter09/HardwareSupplies/MainWindow.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/Chapter09/HardwareSupplies/MainWindow.xaml.cs b/Chapter09/HardwareSupplies/MainWindow.xaml.cs new file mode 100644 index 0000000..5164515 --- /dev/null +++ b/Chapter09/HardwareSupplies/MainWindow.xaml.cs @@ -0,0 +1,50 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +namespace HardwareSupplies +{ + /// + /// An empty window that can be used on its own or navigated to within a Frame. + /// + public sealed partial class MainWindow : Window + { + public MainWindow() + { + this.InitializeComponent(); + PopulateItems(); + } + + public HardwareItem[] HardwareItems { get; set; } + + private void PopulateItems() + { + HardwareItems = new HardwareItem[] + { + new HardwareItem { id = 1, name = "Wood Screw", category = "Screws", cost = 0.02M, price = 0.10M, quantity = 504 }, + new HardwareItem { id = 2, name = "Sheet Metal Screw", category = "Screws", cost = 0.03M, price = 0.15M, quantity = 655 }, + new HardwareItem { id = 3, name = "Drywall Screw", category = "Screws", cost = 0.02M, price = 0.11M, quantity = 421 }, + new HardwareItem { id = 4, name = "Galvanized Nail", category = "Nails", cost = 0.04M, price = 0.16M, quantity = 5620 }, + new HardwareItem { id = 5, name = "Framing Nail", category = "Nails", cost = 0.06M, price = 0.20M, quantity = 12000 }, + new HardwareItem { id = 6, name = "Finishing Nail 2 inch", category = "Nails", cost = 0.02M, price = 0.11M, quantity = 1405 }, + new HardwareItem { id = 7, name = "Finishing Nail 1 inch", category = "Nails", cost = 0.01M, price = 0.10M, quantity = 1110 }, + new HardwareItem { id = 8, name = "Light Switch - White", category = "Electrical", cost = 0.25M, price = 1.99M, quantity = 78 }, + new HardwareItem { id = 9, name = "Outlet - White", category = "Electrical", cost = 0.21M, price = 1.99M, quantity = 56 }, + new HardwareItem { id = 10, name = "Outlet - Beige", category = "Electrical", cost = 0.21M, price = 1.99M, quantity = 90 }, + new HardwareItem { id = 11, name = "Wire Ties", category = "Electrical", cost = 0.50M, price = 4.99M, quantity = 125 }, + new HardwareItem { id = 12, name = "Switch Plate - White", category = "Electrical", cost = 0.21M, price = 2.49M, quantity = 200 } + }; + } + } +} diff --git a/Chapter09/HardwareSupplies/Package.appxmanifest b/Chapter09/HardwareSupplies/Package.appxmanifest new file mode 100644 index 0000000..5549f1d --- /dev/null +++ b/Chapter09/HardwareSupplies/Package.appxmanifest @@ -0,0 +1,51 @@ + + + + + + + + + + HardwareSupplies + alash + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter09/HardwareSupplies/Properties/launchSettings.json b/Chapter09/HardwareSupplies/Properties/launchSettings.json new file mode 100644 index 0000000..19e0703 --- /dev/null +++ b/Chapter09/HardwareSupplies/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "HardwareSupplies (Package)": { + "commandName": "MsixPackage" + }, + "HardwareSupplies (Unpackaged)": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/Chapter09/HardwareSupplies/app.manifest b/Chapter09/HardwareSupplies/app.manifest new file mode 100644 index 0000000..830e7c3 --- /dev/null +++ b/Chapter09/HardwareSupplies/app.manifest @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + PerMonitorV2 + + + \ No newline at end of file