From 553522ff1008cccbbce67e2467747aaaeb18feb5 Mon Sep 17 00:00:00 2001 From: denggaofeng <1139968554@qq.com> Date: Fri, 23 Jan 2026 10:13:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=81=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NFCLockDemoV2.sln | 32 ++ NFCLockDemoV2/App.xaml | 14 + NFCLockDemoV2/App.xaml.cs | 15 + NFCLockDemoV2/AppShell.xaml | 14 + NFCLockDemoV2/AppShell.xaml.cs | 10 + .../Converters/OperationColorConverter.cs | 26 + .../Converters/PercentageConverter.cs | 24 + NFCLockDemoV2/GlobalXmlns.cs | 2 + NFCLockDemoV2/MainPage.xaml | 87 ++++ NFCLockDemoV2/MainPage.xaml.cs | 15 + NFCLockDemoV2/MauiProgram.cs | 26 + NFCLockDemoV2/NFCLockDemoV2.csproj | 113 +++++ .../Platforms/Android/AndroidManifest.xml | 7 + .../Platforms/Android/MainActivity.cs | 89 ++++ .../Platforms/Android/MainApplication.cs | 16 + .../Platforms/Android/NFCCallbacks.cs | 178 +++++++ .../Android/Resources/values/colors.xml | 6 + .../Platforms/MacCatalyst/AppDelegate.cs | 10 + .../Platforms/MacCatalyst/Entitlements.plist | 14 + .../Platforms/MacCatalyst/Info.plist | 38 ++ .../Platforms/MacCatalyst/Program.cs | 16 + NFCLockDemoV2/Platforms/Tizen/Main.cs | 17 + .../Platforms/Tizen/tizen-manifest.xml | 15 + NFCLockDemoV2/Platforms/Windows/App.xaml | 8 + NFCLockDemoV2/Platforms/Windows/App.xaml.cs | 25 + .../Platforms/Windows/Package.appxmanifest | 46 ++ NFCLockDemoV2/Platforms/Windows/app.manifest | 15 + NFCLockDemoV2/Platforms/iOS/AppDelegate.cs | 10 + NFCLockDemoV2/Platforms/iOS/Info.plist | 32 ++ NFCLockDemoV2/Platforms/iOS/Program.cs | 16 + .../iOS/Resources/PrivacyInfo.xcprivacy | 51 ++ NFCLockDemoV2/Resources/AppIcon/appicon.svg | 4 + NFCLockDemoV2/Resources/AppIcon/appiconfg.svg | 8 + .../Resources/Fonts/OpenSans-Regular.ttf | 3 + .../Resources/Fonts/OpenSans-Semibold.ttf | 3 + NFCLockDemoV2/Resources/Images/dotnet_bot.png | 3 + NFCLockDemoV2/Resources/Raw/AboutAssets.txt | 15 + NFCLockDemoV2/Resources/Splash/splash.svg | 8 + NFCLockDemoV2/Resources/Styles/Colors.xaml | 45 ++ NFCLockDemoV2/Resources/Styles/Styles.xaml | 444 ++++++++++++++++++ NFCLockDemoV2/ViewModels/MainViewModel.cs | 81 ++++ NFCLockDemoV2/ViewModels/OperationType.cs | 22 + 42 files changed, 1623 insertions(+) create mode 100644 NFCLockDemoV2.sln create mode 100644 NFCLockDemoV2/App.xaml create mode 100644 NFCLockDemoV2/App.xaml.cs create mode 100644 NFCLockDemoV2/AppShell.xaml create mode 100644 NFCLockDemoV2/AppShell.xaml.cs create mode 100644 NFCLockDemoV2/Converters/OperationColorConverter.cs create mode 100644 NFCLockDemoV2/Converters/PercentageConverter.cs create mode 100644 NFCLockDemoV2/GlobalXmlns.cs create mode 100644 NFCLockDemoV2/MainPage.xaml create mode 100644 NFCLockDemoV2/MainPage.xaml.cs create mode 100644 NFCLockDemoV2/MauiProgram.cs create mode 100644 NFCLockDemoV2/NFCLockDemoV2.csproj create mode 100644 NFCLockDemoV2/Platforms/Android/AndroidManifest.xml create mode 100644 NFCLockDemoV2/Platforms/Android/MainActivity.cs create mode 100644 NFCLockDemoV2/Platforms/Android/MainApplication.cs create mode 100644 NFCLockDemoV2/Platforms/Android/NFCCallbacks.cs create mode 100644 NFCLockDemoV2/Platforms/Android/Resources/values/colors.xml create mode 100644 NFCLockDemoV2/Platforms/MacCatalyst/AppDelegate.cs create mode 100644 NFCLockDemoV2/Platforms/MacCatalyst/Entitlements.plist create mode 100644 NFCLockDemoV2/Platforms/MacCatalyst/Info.plist create mode 100644 NFCLockDemoV2/Platforms/MacCatalyst/Program.cs create mode 100644 NFCLockDemoV2/Platforms/Tizen/Main.cs create mode 100644 NFCLockDemoV2/Platforms/Tizen/tizen-manifest.xml create mode 100644 NFCLockDemoV2/Platforms/Windows/App.xaml create mode 100644 NFCLockDemoV2/Platforms/Windows/App.xaml.cs create mode 100644 NFCLockDemoV2/Platforms/Windows/Package.appxmanifest create mode 100644 NFCLockDemoV2/Platforms/Windows/app.manifest create mode 100644 NFCLockDemoV2/Platforms/iOS/AppDelegate.cs create mode 100644 NFCLockDemoV2/Platforms/iOS/Info.plist create mode 100644 NFCLockDemoV2/Platforms/iOS/Program.cs create mode 100644 NFCLockDemoV2/Platforms/iOS/Resources/PrivacyInfo.xcprivacy create mode 100644 NFCLockDemoV2/Resources/AppIcon/appicon.svg create mode 100644 NFCLockDemoV2/Resources/AppIcon/appiconfg.svg create mode 100644 NFCLockDemoV2/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 NFCLockDemoV2/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 NFCLockDemoV2/Resources/Images/dotnet_bot.png create mode 100644 NFCLockDemoV2/Resources/Raw/AboutAssets.txt create mode 100644 NFCLockDemoV2/Resources/Splash/splash.svg create mode 100644 NFCLockDemoV2/Resources/Styles/Colors.xaml create mode 100644 NFCLockDemoV2/Resources/Styles/Styles.xaml create mode 100644 NFCLockDemoV2/ViewModels/MainViewModel.cs create mode 100644 NFCLockDemoV2/ViewModels/OperationType.cs diff --git a/NFCLockDemoV2.sln b/NFCLockDemoV2.sln new file mode 100644 index 0000000..96d46ff --- /dev/null +++ b/NFCLockDemoV2.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36429.23 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NFCLockDemoV2", "NFCLockDemoV2\NFCLockDemoV2.csproj", "{A15D24B1-BE68-486F-B41B-21353FDD0B0F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidBinding1", "AndroidBinding1\AndroidBinding1.csproj", "{60D96270-D39B-4D6B-9DE5-DC666949D9F5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A15D24B1-BE68-486F-B41B-21353FDD0B0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A15D24B1-BE68-486F-B41B-21353FDD0B0F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A15D24B1-BE68-486F-B41B-21353FDD0B0F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {A15D24B1-BE68-486F-B41B-21353FDD0B0F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A15D24B1-BE68-486F-B41B-21353FDD0B0F}.Release|Any CPU.Build.0 = Release|Any CPU + {60D96270-D39B-4D6B-9DE5-DC666949D9F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60D96270-D39B-4D6B-9DE5-DC666949D9F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60D96270-D39B-4D6B-9DE5-DC666949D9F5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60D96270-D39B-4D6B-9DE5-DC666949D9F5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FC10FDEE-78D8-4C0D-B78D-5E8BA691ED91} + EndGlobalSection +EndGlobal diff --git a/NFCLockDemoV2/App.xaml b/NFCLockDemoV2/App.xaml new file mode 100644 index 0000000..730fb6b --- /dev/null +++ b/NFCLockDemoV2/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/NFCLockDemoV2/App.xaml.cs b/NFCLockDemoV2/App.xaml.cs new file mode 100644 index 0000000..a2bbda1 --- /dev/null +++ b/NFCLockDemoV2/App.xaml.cs @@ -0,0 +1,15 @@ +namespace NFCLockDemoV2 +{ + 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/NFCLockDemoV2/AppShell.xaml b/NFCLockDemoV2/AppShell.xaml new file mode 100644 index 0000000..e7bf1df --- /dev/null +++ b/NFCLockDemoV2/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/NFCLockDemoV2/AppShell.xaml.cs b/NFCLockDemoV2/AppShell.xaml.cs new file mode 100644 index 0000000..179905a --- /dev/null +++ b/NFCLockDemoV2/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace NFCLockDemoV2 +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/NFCLockDemoV2/Converters/OperationColorConverter.cs b/NFCLockDemoV2/Converters/OperationColorConverter.cs new file mode 100644 index 0000000..f64e6ab --- /dev/null +++ b/NFCLockDemoV2/Converters/OperationColorConverter.cs @@ -0,0 +1,26 @@ +using System.Globalization; +using NFCLockDemoV2.ViewModels; + +namespace NFCLockDemoV2.Converters; + +public class OperationColorConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is OperationType currentOperation && parameter is string operationStr) + { + if (Enum.TryParse(operationStr, out var targetOperation)) + { + return currentOperation == targetOperation + ? Color.FromArgb("#00BCD4") // Cyan + : Color.FromArgb("#D3D3D3"); // LightGray + } + } + return Color.FromArgb("#D3D3D3"); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} diff --git a/NFCLockDemoV2/Converters/PercentageConverter.cs b/NFCLockDemoV2/Converters/PercentageConverter.cs new file mode 100644 index 0000000..e7c0a70 --- /dev/null +++ b/NFCLockDemoV2/Converters/PercentageConverter.cs @@ -0,0 +1,24 @@ +using System.Globalization; + +namespace NFCLockDemoV2.Converters; + +public class PercentageConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is int progress) + { + return progress / 100.0; + } + return 0.0; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is double progress) + { + return (int)(progress * 100); + } + return 0; + } +} diff --git a/NFCLockDemoV2/GlobalXmlns.cs b/NFCLockDemoV2/GlobalXmlns.cs new file mode 100644 index 0000000..3ee841f --- /dev/null +++ b/NFCLockDemoV2/GlobalXmlns.cs @@ -0,0 +1,2 @@ +[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "NFCLockDemoV2")] +[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "NFCLockDemoV2.Pages")] diff --git a/NFCLockDemoV2/MainPage.xaml b/NFCLockDemoV2/MainPage.xaml new file mode 100644 index 0000000..077f61e --- /dev/null +++ b/NFCLockDemoV2/MainPage.xaml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + +