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 @@ + + + + + + + + + + + + + + + + + +