From 4289dc6108460a5df318a020ae6d7ef22115eebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Sun, 27 Mar 2022 13:25:13 +0200 Subject: [PATCH] Updated Behaviors .NET MAUI sample --- Behaviors/.NET MAUI/Behaviors.sln | 26 +++---- Behaviors/.NET MAUI/Behaviors/App.xaml | 7 ++ Behaviors/.NET MAUI/Behaviors/App.xaml.cs | 11 +++ .../Behaviors.WinUI/Behaviors.WinUI.csproj | 64 ------------------ .../Properties/launchSettings.json | 7 -- .../Behaviors.WinUI/Windows/App.xaml | 15 ---- .../Behaviors.WinUI/Windows/App.xaml.cs | 34 ---------- .../Windows/Package.appxmanifest | 58 ---------------- .../.NET MAUI/Behaviors/Behaviors.csproj | 63 +++++++++++++++++ .../Behaviors/Android/AndroidEnvironment.txt | 1 - .../Behaviors/Android/MainActivity.cs | 11 --- .../Behaviors/Android/MainApplication.cs | 16 ----- .../Android/Resources/values/styles.xml | 16 ----- .../.NET MAUI/Behaviors/Behaviors/App.xaml | 6 -- .../.NET MAUI/Behaviors/Behaviors/App.xaml.cs | 23 ------- .../Behaviors/Behaviors/Behaviors.csproj | 53 --------------- .../Behaviors/MacCatalyst/AppDelegate.cs | 10 --- .../Behaviors/MacCatalyst/Entitlements.plist | 6 -- .../Behaviors/MacCatalyst/Program.cs | 15 ---- .../Behaviors/Behaviors/MainPage.xaml.cs | 12 ---- .../.NET MAUI/Behaviors/Behaviors/Startup.cs | 19 ------ .../Behaviors/Behaviors/iOS/AppDelegate.cs | 10 --- .../Behaviors/iOS/Entitlements.plist | 6 -- .../Behaviors/Behaviors/iOS/Program.cs | 15 ---- .../Behaviors/iOS/Resources/LaunchScreen.xib | 43 ------------ .../Behaviors/Directory.Build.targets | 21 ------ .../Behaviors/{Behaviors => }/MainPage.xaml | 3 +- .../.NET MAUI/Behaviors/MainPage.xaml.cs | 9 +++ Behaviors/.NET MAUI/Behaviors/MauiProgram.cs | 17 +++++ .../NumericValidationBehavior.cs | 0 .../Android/AndroidManifest.xml | 2 +- .../Platforms/Android/MainActivity.cs | 10 +++ .../Platforms/Android/MainApplication.cs | 15 ++++ .../Android/Resources/values/colors.xml | 0 .../Platforms/MacCatalyst/AppDelegate.cs | 9 +++ .../MacCatalyst/Info.plist | 4 -- .../Platforms/MacCatalyst/Program.cs | 15 ++++ .../Behaviors/Platforms/Windows/App.xaml | 8 +++ .../Behaviors/Platforms/Windows/App.xaml.cs | 24 +++++++ .../Platforms/Windows/Package.appxmanifest | 33 +++++++++ .../Windows/app.manifest | 0 .../Behaviors/Platforms/iOS/AppDelegate.cs | 9 +++ .../{Behaviors => Platforms}/iOS/Info.plist | 2 - .../Behaviors/Platforms/iOS/Program.cs | 15 ++++ .../Behaviors/Properties/launchSettings.json | 8 +++ .../Resources/Fonts/OpenSans-Regular.ttf | Bin 96932 -> 107136 bytes .../Resources/Images/dotnet_bot.svg | 0 .../Behaviors/Resources/Raw/AboutAssets.txt | 14 ++++ .../{Behaviors => }/Resources/appicon.svg | 0 .../{Behaviors => }/Resources/appiconfg.svg | 0 50 files changed, 279 insertions(+), 486 deletions(-) create mode 100644 Behaviors/.NET MAUI/Behaviors/App.xaml create mode 100644 Behaviors/.NET MAUI/Behaviors/App.xaml.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Behaviors.WinUI.csproj delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Properties/launchSettings.json delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/App.xaml delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/App.xaml.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/Package.appxmanifest create mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors.csproj delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/Android/AndroidEnvironment.txt delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/Android/MainActivity.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/Android/MainApplication.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/Android/Resources/values/styles.xml delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/App.xaml delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/App.xaml.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/Behaviors.csproj delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/MacCatalyst/AppDelegate.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/MacCatalyst/Entitlements.plist delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/MacCatalyst/Program.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/MainPage.xaml.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/Startup.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/iOS/AppDelegate.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/iOS/Entitlements.plist delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/iOS/Program.cs delete mode 100644 Behaviors/.NET MAUI/Behaviors/Behaviors/iOS/Resources/LaunchScreen.xib delete mode 100644 Behaviors/.NET MAUI/Behaviors/Directory.Build.targets rename Behaviors/.NET MAUI/Behaviors/{Behaviors => }/MainPage.xaml (88%) create mode 100644 Behaviors/.NET MAUI/Behaviors/MainPage.xaml.cs create mode 100644 Behaviors/.NET MAUI/Behaviors/MauiProgram.cs rename Behaviors/.NET MAUI/Behaviors/{Behaviors => }/NumericValidationBehavior.cs (100%) rename Behaviors/.NET MAUI/Behaviors/{Behaviors => Platforms}/Android/AndroidManifest.xml (95%) create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/Android/MainActivity.cs create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/Android/MainApplication.cs rename Behaviors/.NET MAUI/Behaviors/{Behaviors => Platforms}/Android/Resources/values/colors.xml (100%) create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/MacCatalyst/AppDelegate.cs rename Behaviors/.NET MAUI/Behaviors/{Behaviors => Platforms}/MacCatalyst/Info.plist (87%) create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/MacCatalyst/Program.cs create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/Windows/App.xaml create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/Windows/App.xaml.cs create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/Windows/Package.appxmanifest rename Behaviors/.NET MAUI/Behaviors/{Behaviors.WinUI => Platforms}/Windows/app.manifest (100%) create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/iOS/AppDelegate.cs rename Behaviors/.NET MAUI/Behaviors/{Behaviors => Platforms}/iOS/Info.plist (94%) create mode 100644 Behaviors/.NET MAUI/Behaviors/Platforms/iOS/Program.cs create mode 100644 Behaviors/.NET MAUI/Behaviors/Properties/launchSettings.json rename Behaviors/.NET MAUI/Behaviors/{Behaviors => }/Resources/Fonts/OpenSans-Regular.ttf (90%) rename Behaviors/.NET MAUI/Behaviors/{Behaviors => }/Resources/Images/dotnet_bot.svg (100%) create mode 100644 Behaviors/.NET MAUI/Behaviors/Resources/Raw/AboutAssets.txt rename Behaviors/.NET MAUI/Behaviors/{Behaviors => }/Resources/appicon.svg (100%) rename Behaviors/.NET MAUI/Behaviors/{Behaviors => }/Resources/appiconfg.svg (100%) diff --git a/Behaviors/.NET MAUI/Behaviors.sln b/Behaviors/.NET MAUI/Behaviors.sln index aefd6e4..1a4bcd9 100644 --- a/Behaviors/.NET MAUI/Behaviors.sln +++ b/Behaviors/.NET MAUI/Behaviors.sln @@ -1,11 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31220.234 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Behaviors", "Behaviors\Behaviors\Behaviors.csproj", "{A2A717C5-A249-4070-8C58-F12A4AAF6480}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Behaviors.WinUI", "Behaviors\Behaviors.WinUI\Behaviors.WinUI.csproj", "{483F575C-D5E6-4D70-B0F9-FF66FAA823F2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Behaviors", "Behaviors\Behaviors.csproj", "{4F004180-84A1-4CD9-8F23-95CAA5FD6C85}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -13,18 +11,12 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A2A717C5-A249-4070-8C58-F12A4AAF6480}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A2A717C5-A249-4070-8C58-F12A4AAF6480}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A2A717C5-A249-4070-8C58-F12A4AAF6480}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {A2A717C5-A249-4070-8C58-F12A4AAF6480}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A2A717C5-A249-4070-8C58-F12A4AAF6480}.Release|Any CPU.Build.0 = Release|Any CPU - {A2A717C5-A249-4070-8C58-F12A4AAF6480}.Release|Any CPU.Deploy.0 = Release|Any CPU - {483F575C-D5E6-4D70-B0F9-FF66FAA823F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {483F575C-D5E6-4D70-B0F9-FF66FAA823F2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {483F575C-D5E6-4D70-B0F9-FF66FAA823F2}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {483F575C-D5E6-4D70-B0F9-FF66FAA823F2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {483F575C-D5E6-4D70-B0F9-FF66FAA823F2}.Release|Any CPU.Build.0 = Release|Any CPU - {483F575C-D5E6-4D70-B0F9-FF66FAA823F2}.Release|Any CPU.Deploy.0 = Release|Any CPU + {4F004180-84A1-4CD9-8F23-95CAA5FD6C85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F004180-84A1-4CD9-8F23-95CAA5FD6C85}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F004180-84A1-4CD9-8F23-95CAA5FD6C85}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {4F004180-84A1-4CD9-8F23-95CAA5FD6C85}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F004180-84A1-4CD9-8F23-95CAA5FD6C85}.Release|Any CPU.Build.0 = Release|Any CPU + {4F004180-84A1-4CD9-8F23-95CAA5FD6C85}.Release|Any CPU.Deploy.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Behaviors/.NET MAUI/Behaviors/App.xaml b/Behaviors/.NET MAUI/Behaviors/App.xaml new file mode 100644 index 0000000..a5bc53e --- /dev/null +++ b/Behaviors/.NET MAUI/Behaviors/App.xaml @@ -0,0 +1,7 @@ + + + diff --git a/Behaviors/.NET MAUI/Behaviors/App.xaml.cs b/Behaviors/.NET MAUI/Behaviors/App.xaml.cs new file mode 100644 index 0000000..d6c3d9b --- /dev/null +++ b/Behaviors/.NET MAUI/Behaviors/App.xaml.cs @@ -0,0 +1,11 @@ +namespace Behaviors; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new MainPage(); + } +} diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Behaviors.WinUI.csproj b/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Behaviors.WinUI.csproj deleted file mode 100644 index 03286c2..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Behaviors.WinUI.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - net6.0-windows10.0.19041 - WinExe - 10.0.17763.0 - true - Behaviors - - - true - MSIX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Properties/launchSettings.json b/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Properties/launchSettings.json deleted file mode 100644 index e4b5658..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Properties/launchSettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "profiles": { - "Behaviors.WinUI": { - "commandName": "AppContainer" - } - } -} \ No newline at end of file diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/App.xaml b/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/App.xaml deleted file mode 100644 index e49afd3..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/App.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/App.xaml.cs b/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/App.xaml.cs deleted file mode 100644 index 563f376..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/App.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.Maui; -using Microsoft.UI.Xaml; -using Windows.ApplicationModel; - -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. - -namespace Behaviors.WinUI -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - public partial class App : MiddleApp - { - /// - /// 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 void OnLaunched(LaunchActivatedEventArgs args) - { - base.OnLaunched(args); - - Microsoft.Maui.Essentials.Platform.OnLaunched(args); - } - } - public class MiddleApp : MauiWinUIApplication - { - } -} diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/Package.appxmanifest b/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/Package.appxmanifest deleted file mode 100644 index 693efd0..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors.WinUI/Windows/Package.appxmanifest +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - Behaviors - Microsoft - Assets\appiconStoreLogo.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors.csproj b/Behaviors/.NET MAUI/Behaviors/Behaviors.csproj new file mode 100644 index 0000000..b58076e --- /dev/null +++ b/Behaviors/.NET MAUI/Behaviors/Behaviors.csproj @@ -0,0 +1,63 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041 + Exe + Behaviors + true + true + enable + true + + + Behaviors + + + com.companyname.behaviors + A698EE57-5651-41E1-8EF5-95519583BC9D + + + 1.0 + 1 + + + True + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + WinExe + win10-x64 + + + diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/AndroidEnvironment.txt b/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/AndroidEnvironment.txt deleted file mode 100644 index 2cdf769..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/AndroidEnvironment.txt +++ /dev/null @@ -1 +0,0 @@ -DOTNET_MODIFIABLE_ASSEMBLIES=Debug \ No newline at end of file diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/MainActivity.cs b/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/MainActivity.cs deleted file mode 100644 index 81a01ea..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/MainActivity.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Android.App; -using Android.Content.PM; -using Microsoft.Maui; - -namespace Behaviors -{ - [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)] - public class MainActivity : MauiAppCompatActivity - { - } -} \ No newline at end of file diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/MainApplication.cs b/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/MainApplication.cs deleted file mode 100644 index ccc8eea..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/MainApplication.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using Android.App; -using Android.Runtime; -using Microsoft.Maui; - -namespace Behaviors -{ - [Application] - public class MainApplication : MauiApplication - { - public MainApplication(IntPtr handle, JniHandleOwnership ownership) - : base(handle, ownership) - { - } - } -} \ No newline at end of file diff --git a/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/Resources/values/styles.xml b/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/Resources/values/styles.xml deleted file mode 100644 index b749b60..0000000 --- a/Behaviors/.NET MAUI/Behaviors/Behaviors/Android/Resources/values/styles.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - -