From b4f0d0c22d0729b1389bd575b1b0dad3e13b88dd Mon Sep 17 00:00:00 2001 From: marcchevaldonne Date: Wed, 26 Mar 2025 13:06:32 +0100 Subject: [PATCH] :boom: resources sample --- Samples.sln | 14 + .../ex_ResourceDictionary/App.xaml | 17 + .../ex_ResourceDictionary/App.xaml.cs | 14 + .../ex_ResourceDictionary/AppShell.xaml | 15 + .../ex_ResourceDictionary/AppShell.xaml.cs | 9 + .../ex_ResourceDictionary/MainPage.xaml | 28 + .../ex_ResourceDictionary/MainPage.xaml.cs | 10 + .../ex_ResourceDictionary/MauiProgram.cs | 24 + .../ex_ResourceDictionary/Nounours.cs | 9 + .../Platforms/Android/AndroidManifest.xml | 6 + .../Platforms/Android/MainActivity.cs | 10 + .../Platforms/Android/MainApplication.cs | 15 + .../Android/Resources/values/colors.xml | 6 + .../Platforms/MacCatalyst/AppDelegate.cs | 9 + .../Platforms/MacCatalyst/Entitlements.plist | 14 + .../Platforms/MacCatalyst/Info.plist | 38 + .../Platforms/MacCatalyst/Program.cs | 15 + .../Platforms/Tizen/Main.cs | 16 + .../Platforms/Tizen/tizen-manifest.xml | 15 + .../Platforms/Windows/App.xaml | 8 + .../Platforms/Windows/App.xaml.cs | 24 + .../Platforms/Windows/Package.appxmanifest | 46 + .../Platforms/Windows/app.manifest | 15 + .../Platforms/iOS/AppDelegate.cs | 9 + .../Platforms/iOS/Info.plist | 32 + .../Platforms/iOS/Program.cs | 15 + .../iOS/Resources/PrivacyInfo.xcprivacy | 51 + .../Properties/launchSettings.json | 8 + .../Resources/AppIcon/appicon.svg | 4 + .../Resources/AppIcon/appiconfg.svg | 8 + .../Resources/Fonts/FluentUI.cs | 7920 +++++++++++++++++ .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107280 bytes .../Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111164 bytes .../Resources/Images/dotnet_bot.png | Bin 0 -> 93437 bytes .../Resources/Raw/AboutAssets.txt | 15 + .../Resources/Splash/splash.svg | 8 + .../Resources/Styles/Colors.xaml | 45 + .../Resources/Styles/MyStyles.xaml | 17 + .../Resources/Styles/Styles.xaml | 451 + .../ex_ResourceDictionary.csproj | 71 + .../ex_ResourcesLib/MyShareableColors.xaml | 8 + .../ex_ResourcesLib/MyShareableColors.xaml.cs | 9 + .../Platforms/Android/PlatformClass1.cs | 6 + .../Platforms/MacCatalyst/PlatformClass1.cs | 6 + .../Platforms/Tizen/PlatformClass1.cs | 9 + .../Platforms/Windows/PlatformClass1.cs | 6 + .../Platforms/iOS/PlatformClass1.cs | 6 + .../ex_ResourcesLib/ex_ResourcesLib.csproj | 25 + 48 files changed, 9106 insertions(+) create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/App.xaml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/App.xaml.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/AppShell.xaml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/AppShell.xaml.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/MainPage.xaml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/MainPage.xaml.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/MauiProgram.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Nounours.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Android/AndroidManifest.xml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Android/MainActivity.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Android/MainApplication.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Android/Resources/values/colors.xml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/MacCatalyst/AppDelegate.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/MacCatalyst/Entitlements.plist create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/MacCatalyst/Info.plist create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/MacCatalyst/Program.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Tizen/Main.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Tizen/tizen-manifest.xml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Windows/App.xaml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Windows/App.xaml.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Windows/Package.appxmanifest create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/Windows/app.manifest create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/iOS/AppDelegate.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/iOS/Info.plist create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/iOS/Program.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Platforms/iOS/Resources/PrivacyInfo.xcprivacy create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Properties/launchSettings.json create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/AppIcon/appicon.svg create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/AppIcon/appiconfg.svg create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Fonts/FluentUI.cs create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Images/dotnet_bot.png create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Raw/AboutAssets.txt create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Splash/splash.svg create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Styles/Colors.xaml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Styles/MyStyles.xaml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/Resources/Styles/Styles.xaml create mode 100644 ch02_DesigningViews/ex_ResourceDictionary/ex_ResourceDictionary.csproj create mode 100644 ch02_DesigningViews/ex_ResourcesLib/MyShareableColors.xaml create mode 100644 ch02_DesigningViews/ex_ResourcesLib/MyShareableColors.xaml.cs create mode 100644 ch02_DesigningViews/ex_ResourcesLib/Platforms/Android/PlatformClass1.cs create mode 100644 ch02_DesigningViews/ex_ResourcesLib/Platforms/MacCatalyst/PlatformClass1.cs create mode 100644 ch02_DesigningViews/ex_ResourcesLib/Platforms/Tizen/PlatformClass1.cs create mode 100644 ch02_DesigningViews/ex_ResourcesLib/Platforms/Windows/PlatformClass1.cs create mode 100644 ch02_DesigningViews/ex_ResourcesLib/Platforms/iOS/PlatformClass1.cs create mode 100644 ch02_DesigningViews/ex_ResourcesLib/ex_ResourcesLib.csproj diff --git a/Samples.sln b/Samples.sln index c894d61..0e2ea7b 100644 --- a/Samples.sln +++ b/Samples.sln @@ -47,6 +47,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ex_AddingFonts", "ch02_Desi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ex_GlyphsFont", "ch02_DesigningViews\ex_GlyphsFont\ex_GlyphsFont.csproj", "{F417F2C0-EDA9-4B7A-B4FC-00764091B750}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ex_ResourceDictionary", "ch02_DesigningViews\ex_ResourceDictionary\ex_ResourceDictionary.csproj", "{A9C198AC-8002-41C9-A110-AC0C717A20EB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ex_ResourcesLib", "ch02_DesigningViews\ex_ResourcesLib\ex_ResourcesLib.csproj", "{8A93902C-A8D6-4FDC-82ED-0E1C8815E46F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -131,6 +135,14 @@ Global {F417F2C0-EDA9-4B7A-B4FC-00764091B750}.Debug|Any CPU.Build.0 = Debug|Any CPU {F417F2C0-EDA9-4B7A-B4FC-00764091B750}.Release|Any CPU.ActiveCfg = Release|Any CPU {F417F2C0-EDA9-4B7A-B4FC-00764091B750}.Release|Any CPU.Build.0 = Release|Any CPU + {A9C198AC-8002-41C9-A110-AC0C717A20EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9C198AC-8002-41C9-A110-AC0C717A20EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9C198AC-8002-41C9-A110-AC0C717A20EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9C198AC-8002-41C9-A110-AC0C717A20EB}.Release|Any CPU.Build.0 = Release|Any CPU + {8A93902C-A8D6-4FDC-82ED-0E1C8815E46F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A93902C-A8D6-4FDC-82ED-0E1C8815E46F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A93902C-A8D6-4FDC-82ED-0E1C8815E46F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A93902C-A8D6-4FDC-82ED-0E1C8815E46F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -154,5 +166,7 @@ Global {83D42923-CEFB-48EE-986B-95D584386837} = {1E07D063-F377-413B-B9A0-FB94AF14B1A9} {A9F7103F-9AAD-4A1F-9174-8568FEB3C1F0} = {1E07D063-F377-413B-B9A0-FB94AF14B1A9} {F417F2C0-EDA9-4B7A-B4FC-00764091B750} = {1E07D063-F377-413B-B9A0-FB94AF14B1A9} + {A9C198AC-8002-41C9-A110-AC0C717A20EB} = {1E07D063-F377-413B-B9A0-FB94AF14B1A9} + {8A93902C-A8D6-4FDC-82ED-0E1C8815E46F} = {1E07D063-F377-413B-B9A0-FB94AF14B1A9} EndGlobalSection EndGlobal diff --git a/ch02_DesigningViews/ex_ResourceDictionary/App.xaml b/ch02_DesigningViews/ex_ResourceDictionary/App.xaml new file mode 100644 index 0000000..9fb3518 --- /dev/null +++ b/ch02_DesigningViews/ex_ResourceDictionary/App.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/ch02_DesigningViews/ex_ResourceDictionary/App.xaml.cs b/ch02_DesigningViews/ex_ResourceDictionary/App.xaml.cs new file mode 100644 index 0000000..9b05808 --- /dev/null +++ b/ch02_DesigningViews/ex_ResourceDictionary/App.xaml.cs @@ -0,0 +1,14 @@ +namespace ex_ResourceDictionary; + +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/ch02_DesigningViews/ex_ResourceDictionary/AppShell.xaml b/ch02_DesigningViews/ex_ResourceDictionary/AppShell.xaml new file mode 100644 index 0000000..2d46bb0 --- /dev/null +++ b/ch02_DesigningViews/ex_ResourceDictionary/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/ch02_DesigningViews/ex_ResourceDictionary/AppShell.xaml.cs b/ch02_DesigningViews/ex_ResourceDictionary/AppShell.xaml.cs new file mode 100644 index 0000000..831a0fc --- /dev/null +++ b/ch02_DesigningViews/ex_ResourceDictionary/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace ex_ResourceDictionary; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/ch02_DesigningViews/ex_ResourceDictionary/MainPage.xaml b/ch02_DesigningViews/ex_ResourceDictionary/MainPage.xaml new file mode 100644 index 0000000..c0ee5d5 --- /dev/null +++ b/ch02_DesigningViews/ex_ResourceDictionary/MainPage.xaml @@ -0,0 +1,28 @@ + + + + + + +