diff --git a/AdventureWorks.MAUI.sln b/AdventureWorks.MAUI.sln new file mode 100644 index 0000000..fe35113 --- /dev/null +++ b/AdventureWorks.MAUI.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36408.4 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdventureWorks.MAUI", "AdventureWorks.MAUI\AdventureWorks.MAUI.csproj", "{403BA6B6-E816-4A0A-992D-E54FDCEA7E7D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {403BA6B6-E816-4A0A-992D-E54FDCEA7E7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {403BA6B6-E816-4A0A-992D-E54FDCEA7E7D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {403BA6B6-E816-4A0A-992D-E54FDCEA7E7D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {403BA6B6-E816-4A0A-992D-E54FDCEA7E7D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {59BADB27-A5DD-4BC8-BA1D-64A650EEEEB0} + EndGlobalSection +EndGlobal diff --git a/AdventureWorks.MAUI/AdventureWorks.MAUI.csproj b/AdventureWorks.MAUI/AdventureWorks.MAUI.csproj new file mode 100644 index 0000000..a193795 --- /dev/null +++ b/AdventureWorks.MAUI/AdventureWorks.MAUI.csproj @@ -0,0 +1,67 @@ + + + + net9.0-android;net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net9.0-windows10.0.19041.0 + + + + + + + Exe + AdventureWorks.MAUI + true + true + enable + enable + + + AdventureWorks.MAUI + + + com.companyname.adventureworks.maui + + + 1.0 + 1 + + + None + + 15.0 + 15.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AdventureWorks.MAUI/App.xaml b/AdventureWorks.MAUI/App.xaml new file mode 100644 index 0000000..d7cd6b8 --- /dev/null +++ b/AdventureWorks.MAUI/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/AdventureWorks.MAUI/App.xaml.cs b/AdventureWorks.MAUI/App.xaml.cs new file mode 100644 index 0000000..14284e0 --- /dev/null +++ b/AdventureWorks.MAUI/App.xaml.cs @@ -0,0 +1,15 @@ +namespace AdventureWorks.MAUI +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new AppShell()); + } + } +} \ No newline at end of file diff --git a/AdventureWorks.MAUI/AppShell.xaml b/AdventureWorks.MAUI/AppShell.xaml new file mode 100644 index 0000000..6cbee92 --- /dev/null +++ b/AdventureWorks.MAUI/AppShell.xaml @@ -0,0 +1,16 @@ + + + + + + diff --git a/AdventureWorks.MAUI/AppShell.xaml.cs b/AdventureWorks.MAUI/AppShell.xaml.cs new file mode 100644 index 0000000..ffd9973 --- /dev/null +++ b/AdventureWorks.MAUI/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace AdventureWorks.MAUI +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/AdventureWorks.MAUI/MainPage.xaml b/AdventureWorks.MAUI/MainPage.xaml new file mode 100644 index 0000000..0ff5bbe --- /dev/null +++ b/AdventureWorks.MAUI/MainPage.xaml @@ -0,0 +1,49 @@ + + + + + + + diff --git a/AdventureWorks.MAUI/MainPage.xaml.cs b/AdventureWorks.MAUI/MainPage.xaml.cs new file mode 100644 index 0000000..63ad9ad --- /dev/null +++ b/AdventureWorks.MAUI/MainPage.xaml.cs @@ -0,0 +1,13 @@ +namespace AdventureWorks.MAUI +{ + public partial class MainPage : ContentPage + { + + public MainPage() + { + InitializeComponent(); + } + + + } +} diff --git a/AdventureWorks.MAUI/MauiProgram.cs b/AdventureWorks.MAUI/MauiProgram.cs new file mode 100644 index 0000000..22c06e3 --- /dev/null +++ b/AdventureWorks.MAUI/MauiProgram.cs @@ -0,0 +1,57 @@ +using Microsoft.Extensions.Logging; + +//#if Windows +using Microsoft.Maui.LifecycleEvents; +//#endif + +namespace AdventureWorks.MAUI +{ + public static class MauiProgram + { + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); + +#if WINDOWS + SetWindowOptions(builder); +#endif + +#if DEBUG + builder.Logging.AddDebug(); +#endif + + return builder.Build(); + } +#if WINDOWS + public static void SetWindowOptions(MauiAppBuilder builder) + { + builder.ConfigureLifecycleEvents(events => + { + events.AddWindows(wndLifeCycleBuilder => + { + wndLifeCycleBuilder.OnWindowCreated(window => + { + IntPtr nativeWindowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window); + Microsoft.UI.WindowId win32WindowsId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(nativeWindowHandle); + Microsoft.UI.Windowing.AppWindow winuiAppWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(win32WindowsId); + if(winuiAppWindow.Presenter is Microsoft.UI.Windowing.OverlappedPresenter p) + { + p.Maximize(); + //p.IsResizable = false; // Uncomment to disable resizing + //p.IsMaximizable = false; // Uncomment to disable maximizing + //p.IsMinimizable = false; // Uncomment to disable minimizing + } + }); + }); + }); + } +#endif + } +} diff --git a/AdventureWorks.MAUI/Platforms/Android/AndroidManifest.xml b/AdventureWorks.MAUI/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..e9937ad --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AdventureWorks.MAUI/Platforms/Android/MainActivity.cs b/AdventureWorks.MAUI/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..5c3601c --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Android/MainActivity.cs @@ -0,0 +1,11 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace AdventureWorks.MAUI +{ + [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] + public class MainActivity : MauiAppCompatActivity + { + } +} diff --git a/AdventureWorks.MAUI/Platforms/Android/MainApplication.cs b/AdventureWorks.MAUI/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..e45de45 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Android/MainApplication.cs @@ -0,0 +1,16 @@ +using Android.App; +using Android.Runtime; + +namespace AdventureWorks.MAUI +{ + [Application] + public class MainApplication : MauiApplication + { + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/AdventureWorks.MAUI/Platforms/Android/Resources/values/colors.xml b/AdventureWorks.MAUI/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..c04d749 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/AdventureWorks.MAUI/Platforms/MacCatalyst/AppDelegate.cs b/AdventureWorks.MAUI/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..7f95b3d --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; + +namespace AdventureWorks.MAUI +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/AdventureWorks.MAUI/Platforms/MacCatalyst/Entitlements.plist b/AdventureWorks.MAUI/Platforms/MacCatalyst/Entitlements.plist new file mode 100644 index 0000000..de4adc9 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/MacCatalyst/Entitlements.plist @@ -0,0 +1,14 @@ + + + + + + + com.apple.security.app-sandbox + + + com.apple.security.network.client + + + + diff --git a/AdventureWorks.MAUI/Platforms/MacCatalyst/Info.plist b/AdventureWorks.MAUI/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..7268977 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + UIDeviceFamily + + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/AdventureWorks.MAUI/Platforms/MacCatalyst/Program.cs b/AdventureWorks.MAUI/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..1fde997 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,16 @@ +using ObjCRuntime; +using UIKit; + +namespace AdventureWorks.MAUI +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } + } +} diff --git a/AdventureWorks.MAUI/Platforms/Tizen/Main.cs b/AdventureWorks.MAUI/Platforms/Tizen/Main.cs new file mode 100644 index 0000000..d4dcd4f --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Tizen/Main.cs @@ -0,0 +1,17 @@ +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace AdventureWorks.MAUI +{ + internal class Program : MauiApplication + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } + } +} diff --git a/AdventureWorks.MAUI/Platforms/Tizen/tizen-manifest.xml b/AdventureWorks.MAUI/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 0000000..62e1984 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/AdventureWorks.MAUI/Platforms/Windows/App.xaml b/AdventureWorks.MAUI/Platforms/Windows/App.xaml new file mode 100644 index 0000000..7a8fe8f --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/AdventureWorks.MAUI/Platforms/Windows/App.xaml.cs b/AdventureWorks.MAUI/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..659f075 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Windows/App.xaml.cs @@ -0,0 +1,25 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace AdventureWorks.MAUI.WinUI +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : MauiWinUIApplication + { + /// + /// 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(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } + +} diff --git a/AdventureWorks.MAUI/Platforms/Windows/Package.appxmanifest b/AdventureWorks.MAUI/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..0b0e8ed --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AdventureWorks.MAUI/Platforms/Windows/app.manifest b/AdventureWorks.MAUI/Platforms/Windows/app.manifest new file mode 100644 index 0000000..971bed1 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/AdventureWorks.MAUI/Platforms/iOS/AppDelegate.cs b/AdventureWorks.MAUI/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..7f95b3d --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; + +namespace AdventureWorks.MAUI +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/AdventureWorks.MAUI/Platforms/iOS/Info.plist b/AdventureWorks.MAUI/Platforms/iOS/Info.plist new file mode 100644 index 0000000..0004a4f --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/AdventureWorks.MAUI/Platforms/iOS/Program.cs b/AdventureWorks.MAUI/Platforms/iOS/Program.cs new file mode 100644 index 0000000..1fde997 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/iOS/Program.cs @@ -0,0 +1,16 @@ +using ObjCRuntime; +using UIKit; + +namespace AdventureWorks.MAUI +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } + } +} diff --git a/AdventureWorks.MAUI/Platforms/iOS/Resources/PrivacyInfo.xcprivacy b/AdventureWorks.MAUI/Platforms/iOS/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..24ab3b4 --- /dev/null +++ b/AdventureWorks.MAUI/Platforms/iOS/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,51 @@ + + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + NSPrivacyAccessedAPITypeReasons + + E174.1 + + + + + + diff --git a/AdventureWorks.MAUI/Properties/launchSettings.json b/AdventureWorks.MAUI/Properties/launchSettings.json new file mode 100644 index 0000000..4f85793 --- /dev/null +++ b/AdventureWorks.MAUI/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "Project", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/AdventureWorks.MAUI/Resources/AppIcon/appicon.svg b/AdventureWorks.MAUI/Resources/AppIcon/appicon.svg new file mode 100644 index 0000000..9d63b65 --- /dev/null +++ b/AdventureWorks.MAUI/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/AdventureWorks.MAUI/Resources/AppIcon/appiconfg.svg b/AdventureWorks.MAUI/Resources/AppIcon/appiconfg.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/AdventureWorks.MAUI/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/AdventureWorks.MAUI/Resources/Fonts/OpenSans-Regular.ttf b/AdventureWorks.MAUI/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..33b3e0d Binary files /dev/null and b/AdventureWorks.MAUI/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/AdventureWorks.MAUI/Resources/Fonts/OpenSans-Semibold.ttf b/AdventureWorks.MAUI/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 0000000..a1f8571 Binary files /dev/null and b/AdventureWorks.MAUI/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/AdventureWorks.MAUI/Resources/Images/dotnet_bot.png b/AdventureWorks.MAUI/Resources/Images/dotnet_bot.png new file mode 100644 index 0000000..1d1b981 Binary files /dev/null and b/AdventureWorks.MAUI/Resources/Images/dotnet_bot.png differ diff --git a/AdventureWorks.MAUI/Resources/Raw/AboutAssets.txt b/AdventureWorks.MAUI/Resources/Raw/AboutAssets.txt new file mode 100644 index 0000000..89dc758 --- /dev/null +++ b/AdventureWorks.MAUI/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with your package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/AdventureWorks.MAUI/Resources/Splash/splash.svg b/AdventureWorks.MAUI/Resources/Splash/splash.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/AdventureWorks.MAUI/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/AdventureWorks.MAUI/Resources/Styles/Colors.xaml b/AdventureWorks.MAUI/Resources/Styles/Colors.xaml new file mode 100644 index 0000000..30307a5 --- /dev/null +++ b/AdventureWorks.MAUI/Resources/Styles/Colors.xaml @@ -0,0 +1,45 @@ + + + + + + + #512BD4 + #ac99ea + #242424 + #DFD8F7 + #9880e5 + #2B0B98 + + White + Black + #D600AA + #190649 + #1f1f1f + + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AdventureWorks.MAUI/Resources/Styles/Styles.xaml b/AdventureWorks.MAUI/Resources/Styles/Styles.xaml new file mode 100644 index 0000000..86f574d --- /dev/null +++ b/AdventureWorks.MAUI/Resources/Styles/Styles.xaml @@ -0,0 +1,451 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +