From 5302c086b560e256aa354a40d3c55cbc1ff6f6a6 Mon Sep 17 00:00:00 2001 From: James Clancey Date: Fri, 2 Apr 2021 14:28:57 -0800 Subject: [PATCH] Updating to Maui --- Comet.Mac.sln | 120 +-- External/Maui | 2 +- NuGet.config | 12 + sample/Comet.Samples/AnimationSample.cs | 4 +- .../Comet.Samples/ApiAudit/ApiAuditManager.cs | 42 +- sample/Comet.Samples/AuditReportPage.cs | 3 +- sample/Comet.Samples/BasicTestView.cs | 2 +- sample/Comet.Samples/ClipSample1.cs | 3 +- sample/Comet.Samples/ClipSample_AspectFill.cs | 3 +- sample/Comet.Samples/ClipSample_AspectFit.cs | 3 +- sample/Comet.Samples/ClipSample_Fill.cs | 3 +- sample/Comet.Samples/ClipSample_None.cs | 3 +- sample/Comet.Samples/Comet.Samples.csproj | 2 +- .../CommunityQuestions/Question1.cs | 2 +- .../CommunityQuestions/Question1a.cs | 2 +- .../CommunityQuestions/Question1b.cs | 5 +- .../CommunityQuestions/Question1c.cs | 2 +- .../CommunityQuestions/Question1d.cs | 2 +- .../CommunityQuestions/Question1e.cs | 5 +- sample/Comet.Samples/Comparisons/Section2.cs | 3 +- sample/Comet.Samples/Comparisons/Section3.cs | 3 +- sample/Comet.Samples/Comparisons/Section4.cs | 3 +- sample/Comet.Samples/Comparisons/Section4b.cs | 3 +- sample/Comet.Samples/DemoCreditCardView.cs | 2 +- sample/Comet.Samples/DemoCreditCardView2.cs | 2 +- sample/Comet.Samples/DemoCreditCardView3.cs | 2 +- sample/Comet.Samples/GitHubIssues/Issue123.cs | 2 +- sample/Comet.Samples/GitHubIssues/Issue133.cs | 2 +- .../Comet.Samples/GitHubIssues/Issue133b.cs | 2 +- .../Comet.Samples/GitHubIssues/Issue133c.cs | 2 +- sample/Comet.Samples/ListViewSample1.cs | 3 +- sample/Comet.Samples/ListViewSample2.cs | 2 +- .../LiveStreamIssues/DavidSample1.cs | 4 +- .../LiveStreamIssues/DavidSample1a.cs | 4 +- .../LiveStreamIssues/DavidSample1b.cs | 4 +- .../LiveStreamIssues/DavidSample1c.cs | 4 +- .../LiveStreamIssues/DavidSample2.cs | 4 +- sample/Comet.Samples/MainPage.cs | 5 +- sample/Comet.Samples/RideTheCometSample.cs | 4 +- sample/Comet.Samples/SampleApp.cs | 4 +- sample/Comet.Samples/ShapeSample1.cs | 3 +- sample/Comet.Samples/ShapeSample2.cs | 3 +- .../Comet.Samples/Skia/BindableFingerPaint.cs | 2 +- .../Comet.Samples/Skia/SimpleFingerPaint.cs | 2 +- sample/Comet.Samples/Skia/SkiaSample6.cs | 2 +- sample/Comet.Samples/Startup.cs | 10 + sample/Comet.Samples/TextFieldSample2.cs | 2 +- sample/Comet.Samples/TextFieldSample3.cs | 2 +- sample/Comet.Samples/TextFieldSample4.cs | 2 +- sample/Comet.iOS.Sample/AppDelegate.cs | 71 +- .../Comet.iOS.Sample/Comet.iOS.Sample.csproj | 14 +- src/Comet/Animations/AnimationExtensions.cs | 1 - .../Animations/AnimationLerpingExtensions.cs | 5 +- src/Comet/Animations/Lerping.cs | 5 +- src/Comet/AppHostBuilderExtensions.cs | 43 + src/Comet/Comet.csproj | 8 +- src/Comet/CometPlatform.cs | 20 +- src/Comet/Controls/AbstractLayout.cs | 13 +- src/Comet/Controls/Button.cs | 21 +- src/Comet/Controls/ContainerView.cs | 7 +- src/Comet/Controls/ContentView.cs | 20 +- src/Comet/Controls/Grid.cs | 19 +- src/Comet/Controls/HStack.cs | 4 +- src/Comet/Controls/Image.cs | 3 +- src/Comet/Controls/ListView.cs | 6 +- src/Comet/Controls/RadioGroup.cs | 4 +- src/Comet/Controls/ScrollView.cs | 2 +- src/Comet/Controls/Slider.cs | 15 +- src/Comet/Controls/Text.cs | 28 +- src/Comet/Controls/VStack.cs | 4 +- src/Comet/Controls/View.cs | 126 +-- src/Comet/Controls/ZStack.cs | 2 +- src/Comet/EnvironmentData.cs | 1 + src/Comet/Graphics/AffineTransformF.cs | 2 +- src/Comet/Graphics/Bitmap.cs | 2 +- src/Comet/Graphics/Gradient.cs | 4 +- src/Comet/Graphics/GraphicsOperations.cs | 3 +- src/Comet/Graphics/LinearGradient.cs | 3 +- src/Comet/Graphics/PathBuilder.cs | 2 +- src/Comet/Graphics/PathF.cs | 2 +- src/Comet/Graphics/RadialGradient.cs | 4 +- src/Comet/Graphics/Stop.cs | 4 +- src/Comet/Helpers/ColorExtensions.cs | 3 +- src/Comet/Helpers/DatabindingExtensions.cs | 18 +- src/Comet/Helpers/DrawingExtensions.cs | 3 +- src/Comet/Helpers/GraphicsExtensions.cs | 3 +- src/Comet/Helpers/LayoutExtensions.cs | 5 +- src/Comet/Helpers/LineBreakModeExtensions.cs | 2 +- src/Comet/Helpers/MauiExtensions.cs | 4 +- src/Comet/Helpers/RectExtensions.cs | 2 +- src/Comet/Helpers/RectangleExtensions.cs | 5 +- src/Comet/Helpers/TextExtensions.cs | 2 +- src/Comet/Helpers/ViewExtensions.cs | 5 + src/Comet/IReloadHandler.cs | 8 - src/Comet/Internal/Extensions.cs | 10 +- src/Comet/Layout/GridLayoutManager.cs | 923 +++++++++--------- src/Comet/Layout/ZStackLayoutManager.cs | 9 +- src/Comet/LineBreakMode.cs | 16 - src/Comet/Shadow.cs | 4 +- src/Comet/Shape.cs | 6 +- src/Comet/Shapes/Capsule.cs | 3 +- src/Comet/Shapes/Circle.cs | 3 +- src/Comet/Shapes/Ellipse.cs | 2 +- src/Comet/Shapes/Path.cs | 3 +- src/Comet/Shapes/Pill.cs | 3 +- src/Comet/Shapes/Rectangle.cs | 4 +- src/Comet/Shapes/RoundedRectangle.cs | 2 +- src/Comet/Styles/ButtonStyle.cs | 5 +- src/Comet/Styles/Material/ColorPalette.cs | 3 +- src/Comet/Styles/Material/MaterialStyle.cs | 5 +- src/Comet/Styles/NavbarStyle.cs | 3 +- src/Comet/Styles/ProgressBarStyle.cs | 2 +- src/Comet/Styles/SliderStyle.cs | 2 +- src/Comet/Styles/TextStyle.cs | 3 +- src/Comet/Styles/ViewStyle.cs | 3 +- 115 files changed, 950 insertions(+), 904 deletions(-) create mode 100644 NuGet.config create mode 100644 sample/Comet.Samples/Startup.cs create mode 100644 src/Comet/AppHostBuilderExtensions.cs delete mode 100644 src/Comet/IReloadHandler.cs delete mode 100644 src/Comet/LineBreakMode.cs diff --git a/Comet.Mac.sln b/Comet.Mac.sln index 479b6ee4..f406aa27 100644 --- a/Comet.Mac.sln +++ b/Comet.Mac.sln @@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{C3FDCD EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{586C3CCB-82A5-47F0-A099-B9A31BB4EA88}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Comet.Tests", "tests\Comet.Tests\Comet.Tests.csproj", "{EDC997D0-2358-416F-A628-5DFD85728060}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Comet.iOS.Sample", "sample\Comet.iOS.Sample\Comet.iOS.Sample.csproj", "{12BE5947-A64A-4968-96A6-5CA3CE36C244}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BC86B934-3C23-4DA8-A4F4-BB2B0C298DF5}" @@ -18,10 +16,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Platform.Handlers", "external\Maui\src\Platform.Handlers\src\Xamarin.Platform.Handlers\Xamarin.Platform.Handlers.csproj", "{9C19FAED-2BCB-44E7-B33D-90ECD30D236B}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Comet.Samples", "sample\Comet.Samples\Comet.Samples.csproj", "{1057EEAD-899D-4BC2-BA73-6BC526AD3F19}" EndProject +Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Comet.Tests", "tests\Comet.Tests\Comet.Tests.csproj", "{9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "external\Maui\src\Core\src\Core.csproj", "{8A53D192-072F-4EF2-8547-932D7538FFB9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -68,33 +68,6 @@ Global {1817646E-E71E-48CF-80A4-3030EF870D61}.Release|x64.Build.0 = Release|Any CPU {1817646E-E71E-48CF-80A4-3030EF870D61}.Release|x86.ActiveCfg = Release|Any CPU {1817646E-E71E-48CF-80A4-3030EF870D61}.Release|x86.Build.0 = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|ARM.ActiveCfg = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|ARM.Build.0 = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|ARM64.Build.0 = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|iPhone.Build.0 = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|x64.ActiveCfg = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|x64.Build.0 = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|x86.ActiveCfg = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Debug|x86.Build.0 = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|Any CPU.Build.0 = Debug|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|ARM.ActiveCfg = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|ARM.Build.0 = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|ARM64.ActiveCfg = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|ARM64.Build.0 = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|iPhone.ActiveCfg = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|iPhone.Build.0 = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|x64.ActiveCfg = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|x64.Build.0 = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|x86.ActiveCfg = Release|Any CPU - {EDC997D0-2358-416F-A628-5DFD85728060}.Release|x86.Build.0 = Release|Any CPU {12BE5947-A64A-4968-96A6-5CA3CE36C244}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator {12BE5947-A64A-4968-96A6-5CA3CE36C244}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator {12BE5947-A64A-4968-96A6-5CA3CE36C244}.Debug|ARM.ActiveCfg = Debug|iPhone @@ -115,34 +88,6 @@ Global {12BE5947-A64A-4968-96A6-5CA3CE36C244}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator {12BE5947-A64A-4968-96A6-5CA3CE36C244}.Release|x64.ActiveCfg = Release|iPhoneSimulator {12BE5947-A64A-4968-96A6-5CA3CE36C244}.Release|x86.ActiveCfg = Release|iPhoneSimulator - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|ARM.ActiveCfg = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|ARM.Build.0 = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|ARM64.Build.0 = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|iPhone.Build.0 = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|x64.ActiveCfg = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|x64.Build.0 = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|x86.ActiveCfg = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Debug|x86.Build.0 = Debug|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|Any CPU.Build.0 = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|ARM.ActiveCfg = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|ARM.Build.0 = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|ARM64.ActiveCfg = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|ARM64.Build.0 = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|iPhone.ActiveCfg = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|iPhone.Build.0 = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|x64.ActiveCfg = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|x64.Build.0 = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|x86.ActiveCfg = Release|Any CPU - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B}.Release|x86.Build.0 = Release|Any CPU {1057EEAD-899D-4BC2-BA73-6BC526AD3F19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1057EEAD-899D-4BC2-BA73-6BC526AD3F19}.Debug|Any CPU.Build.0 = Debug|Any CPU {1057EEAD-899D-4BC2-BA73-6BC526AD3F19}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -171,14 +116,69 @@ Global {1057EEAD-899D-4BC2-BA73-6BC526AD3F19}.Release|x64.Build.0 = Release|Any CPU {1057EEAD-899D-4BC2-BA73-6BC526AD3F19}.Release|x86.ActiveCfg = Release|Any CPU {1057EEAD-899D-4BC2-BA73-6BC526AD3F19}.Release|x86.Build.0 = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|ARM.ActiveCfg = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|ARM.Build.0 = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|ARM64.Build.0 = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|iPhone.Build.0 = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|x64.ActiveCfg = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|x64.Build.0 = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|x86.ActiveCfg = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Debug|x86.Build.0 = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|Any CPU.Build.0 = Debug|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|ARM.ActiveCfg = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|ARM.Build.0 = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|ARM64.ActiveCfg = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|ARM64.Build.0 = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|iPhone.ActiveCfg = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|iPhone.Build.0 = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|x64.ActiveCfg = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|x64.Build.0 = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|x86.ActiveCfg = Release|Any CPU + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE}.Release|x86.Build.0 = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|ARM.ActiveCfg = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|ARM.Build.0 = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|ARM64.Build.0 = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|iPhone.Build.0 = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|x64.ActiveCfg = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|x64.Build.0 = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|x86.ActiveCfg = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Debug|x86.Build.0 = Debug|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|Any CPU.Build.0 = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|ARM.ActiveCfg = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|ARM.Build.0 = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|ARM64.ActiveCfg = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|ARM64.Build.0 = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|iPhone.ActiveCfg = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|iPhone.Build.0 = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|x64.ActiveCfg = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|x64.Build.0 = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|x86.ActiveCfg = Release|Any CPU + {8A53D192-072F-4EF2-8547-932D7538FFB9}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {EDC997D0-2358-416F-A628-5DFD85728060} = {586C3CCB-82A5-47F0-A099-B9A31BB4EA88} {12BE5947-A64A-4968-96A6-5CA3CE36C244} = {C3FDCDB7-0C29-472D-A406-E2F21A4B0EAE} {1057EEAD-899D-4BC2-BA73-6BC526AD3F19} = {C3FDCDB7-0C29-472D-A406-E2F21A4B0EAE} + {9676A0F8-EF04-4A9D-A774-563E9AB1FAEE} = {586C3CCB-82A5-47F0-A099-B9A31BB4EA88} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0653DB4A-5BBE-4D78-99B2-DB1C82663246} diff --git a/External/Maui b/External/Maui index 011d5c15..c01d873f 160000 --- a/External/Maui +++ b/External/Maui @@ -1 +1 @@ -Subproject commit 011d5c15dcb488a8b756e4a326369fe288dc6017 +Subproject commit c01d873fdeeccfd8ea8967b9ee0b87954490560c diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 00000000..c4b4c8e1 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/sample/Comet.Samples/AnimationSample.cs b/sample/Comet.Samples/AnimationSample.cs index 25a44db8..998eb4ab 100644 --- a/sample/Comet.Samples/AnimationSample.cs +++ b/sample/Comet.Samples/AnimationSample.cs @@ -1,4 +1,6 @@ -using System.Graphics; + + +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ApiAudit/ApiAuditManager.cs b/sample/Comet.Samples/ApiAudit/ApiAuditManager.cs index df62c0ce..5a2a98d6 100644 --- a/sample/Comet.Samples/ApiAudit/ApiAuditManager.cs +++ b/sample/Comet.Samples/ApiAudit/ApiAuditManager.cs @@ -4,7 +4,7 @@ using Comet.Reflection; using Comet.Internal; using System.Linq; using System.Reflection; -using Xamarin.Platform; +using Microsoft.Maui; namespace Comet.Samples { @@ -69,11 +69,11 @@ namespace Comet.Samples public static List GenerateReport() { var reports = new List(); - var pairs = Xamarin.Platform.Registrar.Handlers.GetAllRenderers(); - foreach (var pair in pairs) - { - reports.Add(GenerateReport(pair.Key, pair.Value)); - } + //var pairs = Microsoft.Maui.Registrar.Handlers.GetAllRenderers(); + //foreach (var pair in pairs) + //{ + // reports.Add(GenerateReport(pair.Key, pair.Value)); + //} return reports.OrderByDescending(x => x.UnHandledProperties.Count).ToList(); } @@ -87,21 +87,21 @@ namespace Comet.Samples if (viewType.BaseType != null) { - var baseHandler = Registrar.Handlers.GetRendererType(viewType); - if (baseHandler != null) - { - var baseReport = GenerateReport(viewType.BaseType, baseHandler); - foreach (var p in baseReport.HandledProperties) - { - if (!report.HandledProperties.Contains(p)) - report.HandledProperties.Add(p); - } - foreach (var p in baseReport.UnHandledProperties) - { - if (!report.UnHandledProperties.Contains(p)) - report.UnHandledProperties.Add(p); - } - } + //var baseHandler = Registrar.Handlers.GetRendererType(viewType); + //if (baseHandler != null) + //{ + // var baseReport = GenerateReport(viewType.BaseType, baseHandler); + // foreach (var p in baseReport.HandledProperties) + // { + // if (!report.HandledProperties.Contains(p)) + // report.HandledProperties.Add(p); + // } + // foreach (var p in baseReport.UnHandledProperties) + // { + // if (!report.UnHandledProperties.Contains(p)) + // report.UnHandledProperties.Add(p); + // } + //} } diff --git a/sample/Comet.Samples/AuditReportPage.cs b/sample/Comet.Samples/AuditReportPage.cs index 37756e82..763db022 100644 --- a/sample/Comet.Samples/AuditReportPage.cs +++ b/sample/Comet.Samples/AuditReportPage.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Threading.Tasks; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/BasicTestView.cs b/sample/Comet.Samples/BasicTestView.cs index 3ebc3397..aa843493 100644 --- a/sample/Comet.Samples/BasicTestView.cs +++ b/sample/Comet.Samples/BasicTestView.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ClipSample1.cs b/sample/Comet.Samples/ClipSample1.cs index b8ccbddd..e4f294fa 100644 --- a/sample/Comet.Samples/ClipSample1.cs +++ b/sample/Comet.Samples/ClipSample1.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ClipSample_AspectFill.cs b/sample/Comet.Samples/ClipSample_AspectFill.cs index 74f14709..6deec431 100644 --- a/sample/Comet.Samples/ClipSample_AspectFill.cs +++ b/sample/Comet.Samples/ClipSample_AspectFill.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ClipSample_AspectFit.cs b/sample/Comet.Samples/ClipSample_AspectFit.cs index cb95c135..42df6cb9 100644 --- a/sample/Comet.Samples/ClipSample_AspectFit.cs +++ b/sample/Comet.Samples/ClipSample_AspectFit.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ClipSample_Fill.cs b/sample/Comet.Samples/ClipSample_Fill.cs index 85c27c59..3116a6b3 100644 --- a/sample/Comet.Samples/ClipSample_Fill.cs +++ b/sample/Comet.Samples/ClipSample_Fill.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ClipSample_None.cs b/sample/Comet.Samples/ClipSample_None.cs index 155db9e1..5d336a75 100644 --- a/sample/Comet.Samples/ClipSample_None.cs +++ b/sample/Comet.Samples/ClipSample_None.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/Comet.Samples.csproj b/sample/Comet.Samples/Comet.Samples.csproj index 82b43cf1..97e5a5c8 100644 --- a/sample/Comet.Samples/Comet.Samples.csproj +++ b/sample/Comet.Samples/Comet.Samples.csproj @@ -12,7 +12,7 @@ - + diff --git a/sample/Comet.Samples/CommunityQuestions/Question1.cs b/sample/Comet.Samples/CommunityQuestions/Question1.cs index 236e89a6..9373bb6b 100644 --- a/sample/Comet.Samples/CommunityQuestions/Question1.cs +++ b/sample/Comet.Samples/CommunityQuestions/Question1.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/CommunityQuestions/Question1a.cs b/sample/Comet.Samples/CommunityQuestions/Question1a.cs index d60a284c..3a03c170 100644 --- a/sample/Comet.Samples/CommunityQuestions/Question1a.cs +++ b/sample/Comet.Samples/CommunityQuestions/Question1a.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/CommunityQuestions/Question1b.cs b/sample/Comet.Samples/CommunityQuestions/Question1b.cs index af8f3ca1..c78fa157 100644 --- a/sample/Comet.Samples/CommunityQuestions/Question1b.cs +++ b/sample/Comet.Samples/CommunityQuestions/Question1b.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; -using Xamarin.Forms; + +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/CommunityQuestions/Question1c.cs b/sample/Comet.Samples/CommunityQuestions/Question1c.cs index 846e6f38..54ac4aef 100644 --- a/sample/Comet.Samples/CommunityQuestions/Question1c.cs +++ b/sample/Comet.Samples/CommunityQuestions/Question1c.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/CommunityQuestions/Question1d.cs b/sample/Comet.Samples/CommunityQuestions/Question1d.cs index 0afd96e8..d8205256 100644 --- a/sample/Comet.Samples/CommunityQuestions/Question1d.cs +++ b/sample/Comet.Samples/CommunityQuestions/Question1d.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/CommunityQuestions/Question1e.cs b/sample/Comet.Samples/CommunityQuestions/Question1e.cs index 3c18dbc4..fd3cf75a 100644 --- a/sample/Comet.Samples/CommunityQuestions/Question1e.cs +++ b/sample/Comet.Samples/CommunityQuestions/Question1e.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; -using Xamarin.Forms; + +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/Comparisons/Section2.cs b/sample/Comet.Samples/Comparisons/Section2.cs index d4a78a14..cb0beb75 100644 --- a/sample/Comet.Samples/Comparisons/Section2.cs +++ b/sample/Comet.Samples/Comparisons/Section2.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; /* diff --git a/sample/Comet.Samples/Comparisons/Section3.cs b/sample/Comet.Samples/Comparisons/Section3.cs index c01d4975..65ec0276 100644 --- a/sample/Comet.Samples/Comparisons/Section3.cs +++ b/sample/Comet.Samples/Comparisons/Section3.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; /* diff --git a/sample/Comet.Samples/Comparisons/Section4.cs b/sample/Comet.Samples/Comparisons/Section4.cs index f150d77b..bfaa4e73 100644 --- a/sample/Comet.Samples/Comparisons/Section4.cs +++ b/sample/Comet.Samples/Comparisons/Section4.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; /* diff --git a/sample/Comet.Samples/Comparisons/Section4b.cs b/sample/Comet.Samples/Comparisons/Section4b.cs index 586c5835..3a8e153a 100644 --- a/sample/Comet.Samples/Comparisons/Section4b.cs +++ b/sample/Comet.Samples/Comparisons/Section4b.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; /* diff --git a/sample/Comet.Samples/DemoCreditCardView.cs b/sample/Comet.Samples/DemoCreditCardView.cs index 8ce8caac..91ea30d3 100644 --- a/sample/Comet.Samples/DemoCreditCardView.cs +++ b/sample/Comet.Samples/DemoCreditCardView.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/DemoCreditCardView2.cs b/sample/Comet.Samples/DemoCreditCardView2.cs index 02e5815c..35910789 100644 --- a/sample/Comet.Samples/DemoCreditCardView2.cs +++ b/sample/Comet.Samples/DemoCreditCardView2.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/DemoCreditCardView3.cs b/sample/Comet.Samples/DemoCreditCardView3.cs index 12146c35..acb183ca 100644 --- a/sample/Comet.Samples/DemoCreditCardView3.cs +++ b/sample/Comet.Samples/DemoCreditCardView3.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/GitHubIssues/Issue123.cs b/sample/Comet.Samples/GitHubIssues/Issue123.cs index 729d5341..155b4193 100644 --- a/sample/Comet.Samples/GitHubIssues/Issue123.cs +++ b/sample/Comet.Samples/GitHubIssues/Issue123.cs @@ -1,6 +1,6 @@ using System; using System.Collections.ObjectModel; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/GitHubIssues/Issue133.cs b/sample/Comet.Samples/GitHubIssues/Issue133.cs index f1db4a42..26a2e5ac 100644 --- a/sample/Comet.Samples/GitHubIssues/Issue133.cs +++ b/sample/Comet.Samples/GitHubIssues/Issue133.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/GitHubIssues/Issue133b.cs b/sample/Comet.Samples/GitHubIssues/Issue133b.cs index b8f0da07..b5890815 100644 --- a/sample/Comet.Samples/GitHubIssues/Issue133b.cs +++ b/sample/Comet.Samples/GitHubIssues/Issue133b.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/GitHubIssues/Issue133c.cs b/sample/Comet.Samples/GitHubIssues/Issue133c.cs index b529fa6b..4339df19 100644 --- a/sample/Comet.Samples/GitHubIssues/Issue133c.cs +++ b/sample/Comet.Samples/GitHubIssues/Issue133c.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ListViewSample1.cs b/sample/Comet.Samples/ListViewSample1.cs index 00686e5b..4348db1e 100644 --- a/sample/Comet.Samples/ListViewSample1.cs +++ b/sample/Comet.Samples/ListViewSample1.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using Comet.Samples.Models; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ListViewSample2.cs b/sample/Comet.Samples/ListViewSample2.cs index ddac9f6a..fbcf5e6a 100644 --- a/sample/Comet.Samples/ListViewSample2.cs +++ b/sample/Comet.Samples/ListViewSample2.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Graphics; + using Comet.Samples.Models; namespace Comet.Samples diff --git a/sample/Comet.Samples/LiveStreamIssues/DavidSample1.cs b/sample/Comet.Samples/LiveStreamIssues/DavidSample1.cs index ba2c2372..e63804c2 100644 --- a/sample/Comet.Samples/LiveStreamIssues/DavidSample1.cs +++ b/sample/Comet.Samples/LiveStreamIssues/DavidSample1.cs @@ -1,4 +1,6 @@ -using System.Graphics; + + +using Microsoft.Maui.Graphics; namespace Comet.Samples.LiveStreamIssues { diff --git a/sample/Comet.Samples/LiveStreamIssues/DavidSample1a.cs b/sample/Comet.Samples/LiveStreamIssues/DavidSample1a.cs index 4d0a5872..373e773b 100644 --- a/sample/Comet.Samples/LiveStreamIssues/DavidSample1a.cs +++ b/sample/Comet.Samples/LiveStreamIssues/DavidSample1a.cs @@ -1,4 +1,6 @@ -using System.Graphics; + + +using Microsoft.Maui.Graphics; namespace Comet.Samples.LiveStreamIssues { diff --git a/sample/Comet.Samples/LiveStreamIssues/DavidSample1b.cs b/sample/Comet.Samples/LiveStreamIssues/DavidSample1b.cs index f332964d..d0cc8760 100644 --- a/sample/Comet.Samples/LiveStreamIssues/DavidSample1b.cs +++ b/sample/Comet.Samples/LiveStreamIssues/DavidSample1b.cs @@ -1,4 +1,6 @@ -using System.Graphics; + + +using Microsoft.Maui.Graphics; namespace Comet.Samples.LiveStreamIssues { diff --git a/sample/Comet.Samples/LiveStreamIssues/DavidSample1c.cs b/sample/Comet.Samples/LiveStreamIssues/DavidSample1c.cs index fa7fd75d..e26e4639 100644 --- a/sample/Comet.Samples/LiveStreamIssues/DavidSample1c.cs +++ b/sample/Comet.Samples/LiveStreamIssues/DavidSample1c.cs @@ -1,4 +1,6 @@ -using System.Graphics; + + +using Microsoft.Maui.Graphics; namespace Comet.Samples.LiveStreamIssues { diff --git a/sample/Comet.Samples/LiveStreamIssues/DavidSample2.cs b/sample/Comet.Samples/LiveStreamIssues/DavidSample2.cs index 331043c0..6f071100 100644 --- a/sample/Comet.Samples/LiveStreamIssues/DavidSample2.cs +++ b/sample/Comet.Samples/LiveStreamIssues/DavidSample2.cs @@ -1,4 +1,6 @@ -using System.Graphics; + + +using Microsoft.Maui.Graphics; namespace Comet.Samples.LiveStreamIssues { diff --git a/sample/Comet.Samples/MainPage.cs b/sample/Comet.Samples/MainPage.cs index c57d24d4..e990bbf2 100644 --- a/sample/Comet.Samples/MainPage.cs +++ b/sample/Comet.Samples/MainPage.cs @@ -2,7 +2,8 @@ using System.Collections.Generic; using Comet.Samples.Comparisons; using Comet.Samples.LiveStreamIssues; -using Xamarin.Platform; +using Microsoft.Maui; +using Microsoft.Maui.HotReload; //using Comet.Samples.Skia; namespace Comet.Samples @@ -94,7 +95,7 @@ namespace Comet.Samples public MainPage(List additionalPage = null) { //This is only required since there is a parameter for the view - Xamarin.Platform.HotReload.HotReloadHelper.Register(this, additionalPage); + MauiHotReloadHelper.Register(this, additionalPage); if (additionalPage != null) pages.AddRange(additionalPage); diff --git a/sample/Comet.Samples/RideTheCometSample.cs b/sample/Comet.Samples/RideTheCometSample.cs index 2a54e2f4..838d8b5a 100644 --- a/sample/Comet.Samples/RideTheCometSample.cs +++ b/sample/Comet.Samples/RideTheCometSample.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; /* diff --git a/sample/Comet.Samples/SampleApp.cs b/sample/Comet.Samples/SampleApp.cs index 5a5a08d0..7ba8b4f2 100644 --- a/sample/Comet.Samples/SampleApp.cs +++ b/sample/Comet.Samples/SampleApp.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { @@ -13,7 +13,7 @@ namespace Comet.Samples new Text("Hey!!"), //new Text("Hey!!"), new Text("TEST PADDING").Frame(height:30).Margin(top:100), - new Text("This top part is a Xamarin.Platform.VerticalStackLayout"), + new Text("This top part is a Microsoft.Maui.VerticalStackLayout"), new HStack(spacing:2) { new Button("A Button").Frame(width:100).Color(Colors.White), diff --git a/sample/Comet.Samples/ShapeSample1.cs b/sample/Comet.Samples/ShapeSample1.cs index b226cd51..273ce27b 100644 --- a/sample/Comet.Samples/ShapeSample1.cs +++ b/sample/Comet.Samples/ShapeSample1.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/ShapeSample2.cs b/sample/Comet.Samples/ShapeSample2.cs index 095ec78b..a64e28c4 100644 --- a/sample/Comet.Samples/ShapeSample2.cs +++ b/sample/Comet.Samples/ShapeSample2.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; using Comet.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/Skia/BindableFingerPaint.cs b/sample/Comet.Samples/Skia/BindableFingerPaint.cs index 5b68cc70..8a01162f 100644 --- a/sample/Comet.Samples/Skia/BindableFingerPaint.cs +++ b/sample/Comet.Samples/Skia/BindableFingerPaint.cs @@ -1,5 +1,5 @@ //using System.Collections.Generic; -//using System.Graphics; +// //using Comet.Skia; //using SkiaSharp; diff --git a/sample/Comet.Samples/Skia/SimpleFingerPaint.cs b/sample/Comet.Samples/Skia/SimpleFingerPaint.cs index 88fe9e89..c3cbb3da 100644 --- a/sample/Comet.Samples/Skia/SimpleFingerPaint.cs +++ b/sample/Comet.Samples/Skia/SimpleFingerPaint.cs @@ -1,5 +1,5 @@ //using System.Collections.Generic; -//using System.Graphics; +// //using Comet.Skia; //using SkiaSharp; diff --git a/sample/Comet.Samples/Skia/SkiaSample6.cs b/sample/Comet.Samples/Skia/SkiaSample6.cs index ec874aad..719645b4 100644 --- a/sample/Comet.Samples/Skia/SkiaSample6.cs +++ b/sample/Comet.Samples/Skia/SkiaSample6.cs @@ -1,6 +1,6 @@ //using Comet.Graphics; //using Comet.Skia; -//using System.Graphics; +// //namespace Comet.Samples.Skia //{ diff --git a/sample/Comet.Samples/Startup.cs b/sample/Comet.Samples/Startup.cs new file mode 100644 index 00000000..c2492ce9 --- /dev/null +++ b/sample/Comet.Samples/Startup.cs @@ -0,0 +1,10 @@ +using System; +namespace Comet.Samples +{ + public class Startup + { + public Startup() + { + } + } +} diff --git a/sample/Comet.Samples/TextFieldSample2.cs b/sample/Comet.Samples/TextFieldSample2.cs index 9ad2216e..4c25ae4f 100644 --- a/sample/Comet.Samples/TextFieldSample2.cs +++ b/sample/Comet.Samples/TextFieldSample2.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/TextFieldSample3.cs b/sample/Comet.Samples/TextFieldSample3.cs index e04238d5..8527989d 100644 --- a/sample/Comet.Samples/TextFieldSample3.cs +++ b/sample/Comet.Samples/TextFieldSample3.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.Samples/TextFieldSample4.cs b/sample/Comet.Samples/TextFieldSample4.cs index 81e2d4b8..86a5f74e 100644 --- a/sample/Comet.Samples/TextFieldSample4.cs +++ b/sample/Comet.Samples/TextFieldSample4.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Samples { diff --git a/sample/Comet.iOS.Sample/AppDelegate.cs b/sample/Comet.iOS.Sample/AppDelegate.cs index 24937aaa..6c7d98f3 100644 --- a/sample/Comet.iOS.Sample/AppDelegate.cs +++ b/sample/Comet.iOS.Sample/AppDelegate.cs @@ -4,10 +4,8 @@ using Foundation; using Comet.Samples; using MapKit; using UIKit; -using Comet.Styles; -using Comet.Styles.Material; -using Xamarin.Platform; -using Xamarin.Platform.HotReload; +using Microsoft.Maui; +using Microsoft.Maui.HotReload; namespace Comet.iOS.Sample { @@ -20,12 +18,6 @@ namespace Comet.iOS.Sample UIWindow _window; public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { -#if DEBUG - Reloadify.Reload.Instance.ReplaceType = (d) => HotReloadHelper.RegisterReplacedView(d.ClassName, d.Type); - Reloadify.Reload.Instance.FinishedReload = () => HotReloadHelper.TriggerReload(); - Reloadify.Reload.Init(); - //Comet.Reload.Init(); -#endif CometPlatform.Init(); _window = new UIWindow(); @@ -57,63 +49,6 @@ namespace Comet.iOS.Sample //protected override CometApp CreateApp() => new SampleApp(); } - public class RootViewController : UIViewController - { - public IView ContentView { get; set; } - UIView _contentView; - public override void LoadView() - { - base.LoadView(); - View.AddSubview(_contentView = ContentView?.ToNative()); - } - public override void ViewDidLayoutSubviews() - { - base.ViewDidLayoutSubviews(); - _contentView.Frame = View.Bounds; - } - } - - //public class Section5Native : View - //{ - // public Section5Native() - // { - // Body = () => new VStack - // { - // new ViewRepresentable() - // { - // MakeView = () => new MKMapView(UIScreen.MainScreen.Bounds), - // UpdateView = (view, data) => - // { - // var mapView = (MKMapView)view; - // var coordinate = new CLLocationCoordinate2D(latitude: 34.011286, longitude: -116.166868); - // var span = new MKCoordinateSpan(latitudeDelta: 2.0, longitudeDelta: 2.0); - // var region = new MKCoordinateRegion(center: coordinate, span: span); - // mapView.SetRegion(region, animated: true); - // } - // } - // }; - // } - //} - - //public class Section5NativeB : View - //{ - // public Section5NativeB() - // { - // Body = () => new VStack - // { - // new UIViewRepresentable() - // { - // MakeView = () => new MKMapView(UIScreen.MainScreen.Bounds), - // UpdateView = (view, data) => - // { - // var coordinate = new CLLocationCoordinate2D(latitude: 34.011286, longitude: -116.166868); - // var span = new MKCoordinateSpan(latitudeDelta: 2.0, longitudeDelta: 2.0); - // var region = new MKCoordinateRegion(center: coordinate, span: span); - // view.SetRegion(region, animated: true); - // } - // } - // }; - // } - //} + } diff --git a/sample/Comet.iOS.Sample/Comet.iOS.Sample.csproj b/sample/Comet.iOS.Sample/Comet.iOS.Sample.csproj index 8ec7f6ba..6c04aebb 100644 --- a/sample/Comet.iOS.Sample/Comet.iOS.Sample.csproj +++ b/sample/Comet.iOS.Sample/Comet.iOS.Sample.csproj @@ -140,17 +140,17 @@ - - {1817646E-E71E-48CF-80A4-3030EF870D61} - Comet - {1057EEAD-899D-4BC2-BA73-6BC526AD3F19} Comet.Samples - - {9C19FAED-2BCB-44E7-B33D-90ECD30D236B} - Xamarin.Platform.Handlers + + {8A53D192-072F-4EF2-8547-932D7538FFB9} + Core + + + {1817646E-E71E-48CF-80A4-3030EF870D61} + Comet diff --git a/src/Comet/Animations/AnimationExtensions.cs b/src/Comet/Animations/AnimationExtensions.cs index 393d9451..11dc811a 100644 --- a/src/Comet/Animations/AnimationExtensions.cs +++ b/src/Comet/Animations/AnimationExtensions.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Graphics; namespace Comet { diff --git a/src/Comet/Animations/AnimationLerpingExtensions.cs b/src/Comet/Animations/AnimationLerpingExtensions.cs index 2079b48a..5d5d8ac8 100644 --- a/src/Comet/Animations/AnimationLerpingExtensions.cs +++ b/src/Comet/Animations/AnimationLerpingExtensions.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; -using Xamarin.Forms; + +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Animations/Lerping.cs b/src/Comet/Animations/Lerping.cs index 7ff33123..4abd49e1 100644 --- a/src/Comet/Animations/Lerping.cs +++ b/src/Comet/Animations/Lerping.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; -using Xamarin.Forms; + +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/AppHostBuilderExtensions.cs b/src/Comet/AppHostBuilderExtensions.cs new file mode 100644 index 00000000..9ada8fb4 --- /dev/null +++ b/src/Comet/AppHostBuilderExtensions.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Maui.Handlers; +using Microsoft.Maui.Hosting; + +namespace Comet +{ + public static class AppHostBuilderExtensions + { + public static IAppHostBuilder UseMauiHandlers(this IAppHostBuilder builder) + { + + //AnimationManger.SetTicker(new iOSTicker()); + + //Set Default Style + var style = new Styles.Style(); + style.Apply(); + + builder.RegisterHandlers(new Dictionary + { + { typeof(ActivityIndicator), typeof(ActivityIndicatorHandler) }, + { typeof(Button), typeof(ButtonHandler) }, + //{ typeof(ICheck), typeof(CheckBoxHandler) }, + { typeof(DatePicker), typeof(DatePickerHandler) }, + //{ typeof(Editor), typeof(EditorHandler) }, + { typeof(TextField), typeof(EntryHandler) }, + { typeof(Text), typeof(LabelHandler) }, + { typeof(AbstractLayout), typeof(LayoutHandler) }, + //{ typeof(Picker), typeof(PickerHandler) }, + //{ typeof(Progress), typeof(ProgressBarHandler) }, + //{ typeof(SearchBar), typeof(SearchBarHandler) }, + { typeof(Slider), typeof(SliderHandler) }, + { typeof(Stepper), typeof(StepperHandler) }, + //{ typeof(Switch), typeof(SwitchHandler) }, + //{ typeof(TimePicker), typeof(TimePickerHandler) }, + }); + + return builder; + } + + } +} \ No newline at end of file diff --git a/src/Comet/Comet.csproj b/src/Comet/Comet.csproj index 9bb98c69..0b82cbd2 100644 --- a/src/Comet/Comet.csproj +++ b/src/Comet/Comet.csproj @@ -24,7 +24,6 @@ - @@ -33,9 +32,12 @@ + + + - + @@ -46,5 +48,5 @@ - + \ No newline at end of file diff --git a/src/Comet/CometPlatform.cs b/src/Comet/CometPlatform.cs index 5d04bf56..e20a52a2 100644 --- a/src/Comet/CometPlatform.cs +++ b/src/Comet/CometPlatform.cs @@ -1,7 +1,7 @@ using System; -using Xamarin.Platform; -using Xamarin.Platform.Handlers; -using RegistrarHandlers = Xamarin.Platform.Registrar; +//using Xamarin.Platform; +//using Xamarin.Platform.Handlers; +//using RegistrarHandlers = Xamarin.Platform.Registrar; namespace Comet { public static class CometPlatform @@ -15,13 +15,13 @@ namespace Comet { if (HasInit) return; - RegistrarHandlers.Handlers.Register(); - RegistrarHandlers.Handlers.Register(); - RegistrarHandlers.Handlers.Register(); - RegistrarHandlers.Handlers.Register(); - RegistrarHandlers.Handlers.Register(); - RegistrarHandlers.Handlers.Register(); - RegistrarHandlers.Handlers.Register(); + //RegistrarHandlers.Handlers.Register(); + //RegistrarHandlers.Handlers.Register(); + //RegistrarHandlers.Handlers.Register(); + //RegistrarHandlers.Handlers.Register(); + //RegistrarHandlers.Handlers.Register(); + //RegistrarHandlers.Handlers.Register(); + //RegistrarHandlers.Handlers.Register(); #if __IOS__ // Device Features //ModalView.PerformPresent = (o) => { diff --git a/src/Comet/Controls/AbstractLayout.cs b/src/Comet/Controls/AbstractLayout.cs index 9e1c6117..22c32aff 100644 --- a/src/Comet/Controls/AbstractLayout.cs +++ b/src/Comet/Controls/AbstractLayout.cs @@ -1,10 +1,9 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Graphics; -using Comet.Layout; -using Xamarin.Platform; -using Xamarin.Platform.Layouts; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; +using Microsoft.Maui.Layouts; namespace Comet { @@ -15,9 +14,7 @@ namespace Comet public ILayoutManager LayoutManager => layout ??= CreateLayoutManager(); public ILayoutHandler LayoutHandler => ViewHandler as ILayoutHandler; - IReadOnlyList ILayout.Children => this.GetChildren(); - - ILayoutHandler ILayout.LayoutHandler => throw new NotImplementedException(); + IReadOnlyList IContainer.Children => this.GetChildren(); protected override void OnAdded(View view) { @@ -51,7 +48,7 @@ namespace Comet padding.Right, frame.Width - padding.HorizontalThickness, frame.Height - padding.VerticalThickness); - LayoutManager?.Arrange(bounds); + LayoutManager?.ArrangeChildren(bounds); } public override Size GetDesiredSize(Size availableSize) diff --git a/src/Comet/Controls/Button.cs b/src/Comet/Controls/Button.cs index 146ae3cc..fae5f9c5 100644 --- a/src/Comet/Controls/Button.cs +++ b/src/Comet/Controls/Button.cs @@ -1,7 +1,6 @@ using System; -using System.Graphics; -using Xamarin.Forms; -using Xamarin.Platform; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet { @@ -31,28 +30,16 @@ namespace Comet public Action OnClick { get; private set; } - - //TODO:Audit and fill these out. - string IText.Text => _text?.CurrentValue; - Color IText.Color => this.GetColor(null); - Font IText.Font => Font.Default; - TextTransform IText.TextTransform => TextTransform.Default; double IText.CharacterSpacing => this.GetEnvironment(nameof(IText.CharacterSpacing)); - Xamarin.Forms.FontAttributes IFont.FontAttributes => throw new NotImplementedException(); + Color IText.TextColor => this.GetColor(null); - string IFont.FontFamily => null; - - double IFont.FontSize => this.GetEnvironment(nameof(IText.FontSize)); - - Xamarin.Forms.TextAlignment ITextAlignment.HorizontalTextAlignment => this.GetTextAlignment() ?? default; - - Xamarin.Forms.TextAlignment ITextAlignment.VerticalTextAlignment => this.GetTextAlignment() ?? default; + Thickness IPadding.Padding => this.GetPadding(); void IButton.Pressed() { } void IButton.Released() { } diff --git a/src/Comet/Controls/ContainerView.cs b/src/Comet/Controls/ContainerView.cs index 81efe793..8afa13ca 100644 --- a/src/Comet/Controls/ContainerView.cs +++ b/src/Comet/Controls/ContainerView.cs @@ -1,11 +1,11 @@ using System; using System.Collections; using System.Collections.Generic; -using Xamarin.Platform; +using Microsoft.Maui; namespace Comet { - public class ContainerView : View, IList, IContainerView + public class ContainerView : View, IList, IContainerView, IContainer { readonly protected List Views = new List(); @@ -94,6 +94,8 @@ namespace Comet public bool IsReadOnly => false; + IReadOnlyList IContainer.Children => GetChildren(); + public IEnumerator GetEnumerator() => Views.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => Views.GetEnumerator(); @@ -209,5 +211,6 @@ namespace Comet Views?.ForEach(v => v.ResumeAnimations()); base.ResumeAnimations(); } + } } diff --git a/src/Comet/Controls/ContentView.cs b/src/Comet/Controls/ContentView.cs index 2edaca20..e0e48600 100644 --- a/src/Comet/Controls/ContentView.cs +++ b/src/Comet/Controls/ContentView.cs @@ -1,7 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet { @@ -83,15 +83,15 @@ namespace Comet base.ViewDidDisappear(); } - public override void PauseAnimations() - { + public override void PauseAnimations() + { Content?.PauseAnimations(); - base.PauseAnimations(); - } - public override void ResumeAnimations() - { + base.PauseAnimations(); + } + public override void ResumeAnimations() + { Content?.ResumeAnimations(); - base.ResumeAnimations(); - } - } + base.ResumeAnimations(); + } + } } diff --git a/src/Comet/Controls/Grid.cs b/src/Comet/Controls/Grid.cs index ab0a8b27..4ddce588 100644 --- a/src/Comet/Controls/Grid.cs +++ b/src/Comet/Controls/Grid.cs @@ -1,5 +1,6 @@ using Comet.Layout; -using Xamarin.Platform.Layouts; +using Microsoft.Maui; +using Microsoft.Maui.Layouts; namespace Comet { @@ -13,20 +14,20 @@ namespace Comet object defaultColumnWidth = null) { var layout = (GridLayoutManager)LayoutManager; + + //layout.DefaultRowHeight = defaultRowHeight ?? "*"; + //layout.DefaultColumnWidth = defaultColumnWidth ?? "*"; - layout.DefaultRowHeight = defaultRowHeight ?? "*"; - layout.DefaultColumnWidth = defaultColumnWidth ?? "*"; + //if (columns != null) + // layout.AddColumns(columns); - if (columns != null) - layout.AddColumns(columns); - - if (rows != null) - layout.AddRows(rows); + //if (rows != null) + // layout.AddRows(rows); Spacing = spacing; } public float? Spacing { get; } - protected override ILayoutManager CreateLayoutManager() => new GridLayoutManager(this,Spacing); + protected override ILayoutManager CreateLayoutManager() => new GridLayoutManager((IGridLayout)this); } } diff --git a/src/Comet/Controls/HStack.cs b/src/Comet/Controls/HStack.cs index 78924ee3..07e2b893 100644 --- a/src/Comet/Controls/HStack.cs +++ b/src/Comet/Controls/HStack.cs @@ -1,6 +1,6 @@ using Comet.Layout; -using Xamarin.Platform; -using Xamarin.Platform.Layouts; +using Microsoft.Maui; +using Microsoft.Maui.Layouts; namespace Comet { diff --git a/src/Comet/Controls/Image.cs b/src/Comet/Controls/Image.cs index 3fa0945b..d7ba41a9 100644 --- a/src/Comet/Controls/Image.cs +++ b/src/Comet/Controls/Image.cs @@ -1,6 +1,7 @@ using System; using Comet.Graphics; -using System.Graphics; +using Microsoft.Maui.Graphics; + namespace Comet { public class Image : View diff --git a/src/Comet/Controls/ListView.cs b/src/Comet/Controls/ListView.cs index 3e5a28a1..6571f4a7 100644 --- a/src/Comet/Controls/ListView.cs +++ b/src/Comet/Controls/ListView.cs @@ -182,9 +182,9 @@ namespace Comet { views?.ForEach(v => v.Dispose()); //TODO: Verify. I don't think we need to check all active views anymore - var cells = ActiveViews.Where(x => x.Parent == this).OfType().ToList(); - foreach (var cell in cells) - cell.Dispose(); + //var cells = ActiveViews.Where(x => x.Parent == this).OfType().ToList(); + //foreach (var cell in cells) + // cell.Dispose(); base.Dispose(disposing); } diff --git a/src/Comet/Controls/RadioGroup.cs b/src/Comet/Controls/RadioGroup.cs index f1cd0037..37f05214 100644 --- a/src/Comet/Controls/RadioGroup.cs +++ b/src/Comet/Controls/RadioGroup.cs @@ -1,6 +1,6 @@ using Comet.Layout; -using Xamarin.Platform; -using Xamarin.Platform.Layouts; +using Microsoft.Maui; +using Microsoft.Maui.Layouts; namespace Comet { diff --git a/src/Comet/Controls/ScrollView.cs b/src/Comet/Controls/ScrollView.cs index 345d8e6e..c305eb0e 100644 --- a/src/Comet/Controls/ScrollView.cs +++ b/src/Comet/Controls/ScrollView.cs @@ -1,7 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Controls/Slider.cs b/src/Comet/Controls/Slider.cs index c858b459..8c9fdb19 100644 --- a/src/Comet/Controls/Slider.cs +++ b/src/Comet/Controls/Slider.cs @@ -1,6 +1,7 @@ using System; using Comet.Internal; -using Xamarin.Platform; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet { @@ -50,17 +51,17 @@ namespace Comet public Action OnEditingChanged { get; private set; } - double ISlider.Minimum => From; + Color ISlider.MinimumTrackColor => this.GetTrackColor(); - double ISlider.Maximum => Through; + Color ISlider.MaximumTrackColor => this.GetProgressColor(); - double ISlider.Value { get => Value; set => Value.Set(value); } + Color ISlider.ThumbColor => this.GetThumbColor(); - System.Graphics.Color ISlider.MinimumTrackColor => this.GetTrackColor(); + double IRange.Minimum => From; - System.Graphics.Color ISlider.MaximumTrackColor => this.GetProgressColor(); + double IRange.Maximum => Through; - System.Graphics.Color ISlider.ThumbColor => this.GetThumbColor(); + double IRange.Value { get => Value; set => Value.Set(value); } public void ValueChanged(double value) => OnEditingChanged.Invoke(value); diff --git a/src/Comet/Controls/Text.cs b/src/Comet/Controls/Text.cs index 2499e79d..2acef805 100644 --- a/src/Comet/Controls/Text.cs +++ b/src/Comet/Controls/Text.cs @@ -1,7 +1,8 @@ using System; -using System.Graphics; -using Xamarin.Forms; -using Xamarin.Platform; + +using Microsoft.Maui; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet { @@ -32,22 +33,27 @@ namespace Comet string IText.Text => Value?.CurrentValue; - Color IText.Color => this.GetColor(null); Font IText.Font => throw new NotImplementedException(); - TextTransform IText.TextTransform => throw new NotImplementedException(); double IText.CharacterSpacing => this.GetEnvironment(nameof(IText.CharacterSpacing)); - Xamarin.Forms.FontAttributes IFont.FontAttributes => throw new NotImplementedException(); - - string IFont.FontFamily => throw new NotImplementedException(); - - double IFont.FontSize => throw new NotImplementedException(); TextAlignment ITextAlignment.HorizontalTextAlignment => this.GetTextAlignment() ?? TextAlignment.Start; - TextAlignment ITextAlignment.VerticalTextAlignment => this.GetVerticalTextAlignment() ?? TextAlignment.Start; + //TextAlignment ITextAlignment.VerticalTextAlignment => this.GetVerticalTextAlignment() ?? TextAlignment.Start; + + Microsoft.Maui.LineBreakMode ILabel.LineBreakMode => this.GetLineBreakMode(LineBreakMode.NoWrap); + + int ILabel.MaxLines => this.GetEnvironment(nameof(ILabel.MaxLines)); + + TextDecorations ILabel.TextDecorations => throw new NotImplementedException(); + + double ILabel.LineHeight => throw new NotImplementedException(); + + Color IText.TextColor => this.GetColor(null); + + Thickness IPadding.Padding => this.GetPadding(); } } diff --git a/src/Comet/Controls/VStack.cs b/src/Comet/Controls/VStack.cs index 339b4201..d0fc40d1 100644 --- a/src/Comet/Controls/VStack.cs +++ b/src/Comet/Controls/VStack.cs @@ -1,6 +1,6 @@ using Comet.Layout; -using Xamarin.Platform; -using Xamarin.Platform.Layouts; +using Microsoft.Maui; +using Microsoft.Maui.Layouts; namespace Comet { diff --git a/src/Comet/Controls/View.cs b/src/Comet/Controls/View.cs index 996dfa03..04be891b 100644 --- a/src/Comet/Controls/View.cs +++ b/src/Comet/Controls/View.cs @@ -1,27 +1,26 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Graphics; + using System.Linq; using System.Runtime.CompilerServices; using Comet.Helpers; using Comet.Internal; //using System.Reflection; using Comet.Reflection; -using Xamarin.Forms; -using Xamarin.Platform; -using Xamarin.Platform.Core; -using Xamarin.Platform.HotReload; -using Xamarin.Platform.Layouts; -using Xamarin.Platform.Shapes; -using Rectangle = System.Graphics.Rectangle; +using Microsoft.Maui; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; +using Microsoft.Maui.HotReload; +using Microsoft.Maui.Layouts; +using Microsoft.Maui.Primitives; +using Rectangle = Microsoft.Maui.Graphics.Rectangle; namespace Comet { - public class View : ContextualObject, IDisposable, IView, IReplaceableView, IClipShapeView + public class View : ContextualObject, IDisposable, IView, IHotReloadableView//, IClipShapeView { - internal static WeakList ActiveViews => HotReloadHelper.ActiveViews; static View() { CometPlatform.Init(); @@ -84,9 +83,9 @@ namespace Comet public View() { - HotReloadHelper.ActiveViews.Add(this); - Debug.WriteLine($"Active View Count: {HotReloadHelper.ActiveViews.Count}"); - HotReloadHelper.Register(this); + //HotReloadHelper.ActiveViews.Add(this); + //Debug.WriteLine($"Active View Count: {HotReloadHelper.ActiveViews.Count}"); + //HotReloadHelper.Register(this); //TODO: Should this need its view? State = new BindingState(); StateManager.ConstructingView(this); @@ -198,7 +197,7 @@ namespace Comet } /// - public bool HasContent => Body != null && (HotReloadHelper.IsEnabled || hasGlobalState); + public bool HasContent => Body != null && (MauiHotReloadHelper.IsEnabled || hasGlobalState); bool hasGlobalState => State.GlobalProperties.Any(); internal View GetView() => GetRenderView(); @@ -207,7 +206,7 @@ namespace Comet { if (replacedView != null) return replacedView.GetRenderView(); - var replaced = HotReloadHelper.GetReplacedView(this) as View; + var replaced = MauiHotReloadHelper.GetReplacedView(this) as View; if (replaced != this) { replaced.viewThatWasReplaced = this; @@ -308,7 +307,7 @@ namespace Comet { Environment.SetValue(key, value, true); ThreadHelper.RunOnMainThread(() => { - HotReloadHelper.ActiveViews.OfType().ForEach(x => x.ViewPropertyChanged(key, value)); + MauiHotReloadHelper.ActiveViews.OfType().ForEach(x => x.ViewPropertyChanged(key, value)); }); } @@ -318,7 +317,7 @@ namespace Comet var typedKey = string.IsNullOrWhiteSpace(styleId) ? key : $"{styleId}.{key}"; Environment.SetValue(typedKey, value, true); ThreadHelper.RunOnMainThread(() => { - HotReloadHelper.ActiveViews.OfType().ForEach(x => x.ViewPropertyChanged(typedKey, value)); + MauiHotReloadHelper.ActiveViews.OfType().ForEach(x => x.ViewPropertyChanged(typedKey, value)); }); } @@ -327,7 +326,7 @@ namespace Comet var typedKey = ContextualObject.GetTypedKey(type, key); Environment.SetValue(typedKey, value, true); ThreadHelper.RunOnMainThread(() => { - HotReloadHelper.ActiveViews.OfType().ForEach(x => x.ViewPropertyChanged(typedKey, value)); + MauiHotReloadHelper.ActiveViews.OfType().ForEach(x => x.ViewPropertyChanged(typedKey, value)); }); } @@ -399,11 +398,11 @@ namespace Comet if (!disposing) return; - HotReloadHelper.ActiveViews.Remove(this); + //MauiHotReloadHelper.ActiveViews.Remove(this); - Debug.WriteLine($"Active View Count: {HotReloadHelper.ActiveViews.Count}"); + //Debug.WriteLine($"Active View Count: {HotReloadHelper.ActiveViews.Count}"); - HotReloadHelper.UnRegister(this); + MauiHotReloadHelper.UnRegister(this); var vh = ViewHandler; ViewHandler = null; //TODO: Ditch the cast @@ -547,40 +546,7 @@ namespace Comet List GetAnimations(bool create) => !create ? animations : animations ?? (animations = new List()); public List Animations => animations; - bool IFrameworkElement.IsEnabled => this.GetEnvironment("IsEnabled"); - - Color IFrameworkElement.BackgroundColor => this.GetBackgroundColor(); - - Rectangle IFrameworkElement.Frame => Frame; - - IViewHandler IFrameworkElement.Handler - { - get => this.ViewHandler; - set => SetViewHandler(value); - } - - IFrameworkElement IFrameworkElement.Parent => this.Parent; - - Size IFrameworkElement.DesiredSize => MeasuredSize; - - protected bool IsMeasureValid; - bool IFrameworkElement.IsMeasureValid => IsMeasureValid; - - protected bool IsArrangeValid; - bool IFrameworkElement.IsArrangeValid => IsArrangeValid; - - double IFrameworkElement.Width => this.GetFrameConstraints()?.Width ?? -1; - double IFrameworkElement.Height => this.GetFrameConstraints()?.Height ?? -1; - - public IView ReplacedView => this.GetView();// HasContent ? this : BuiltView ?? this; - - Thickness IFrameworkElement.Margin => this.GetMargin(); - - public bool RequiresContainer => HasContent; - - public IShape ClipShape => this.GetClipShape(); - - IView IReplaceableView.ReplacedView => this.ReplacedView; + public void AddAnimation(Animation animation) { @@ -610,6 +576,52 @@ namespace Comet GetAnimations(false)?.ForEach(x => x.Resume()); notificationView?.ResumeAnimations(); } + + bool IFrameworkElement.IsEnabled => this.GetEnvironment("IsEnabled"); + + Color IFrameworkElement.BackgroundColor => this.GetBackgroundColor(); + + Rectangle IFrameworkElement.Frame => Frame; + + IViewHandler IFrameworkElement.Handler + { + get => this.ViewHandler; + set => SetViewHandler(value); + } + + IFrameworkElement IFrameworkElement.Parent => this.Parent; + + Size IFrameworkElement.DesiredSize => MeasuredSize; + + protected bool IsMeasureValid; + bool IFrameworkElement.IsMeasureValid => IsMeasureValid; + + protected bool IsArrangeValid; + bool IFrameworkElement.IsArrangeValid => IsArrangeValid; + + double IFrameworkElement.Width => this.GetFrameConstraints()?.Width ?? -1; + double IFrameworkElement.Height => this.GetFrameConstraints()?.Height ?? -1; + + public IView ReplacedView => this.GetView();// HasContent ? this : BuiltView ?? this; + + + public bool RequiresContainer => HasContent; + + //public IShape ClipShape => this.GetClipShape(); + + IView IReplaceableView.ReplacedView => this.ReplacedView; + + Thickness IView.Margin => this.GetMargin(); + + string IFrameworkElement.AutomationId => this.GetAutomationId(); + + //TODO: lets update these to be actual property + FlowDirection IFrameworkElement.FlowDirection => this.GetEnvironment(nameof(IFrameworkElement.FlowDirection)); + + LayoutAlignment IFrameworkElement.HorizontalLayoutAlignment => this.GetEnvironment(nameof(IFrameworkElement.HorizontalLayoutAlignment)); + + LayoutAlignment IFrameworkElement.VerticalLayoutAlignment => this.GetEnvironment(nameof(IFrameworkElement.VerticalLayoutAlignment)); + void IFrameworkElement.Arrange(Rectangle bounds) => LayoutSubviews(bounds); Size IFrameworkElement.Measure(double widthConstraint, double heightConstraint) => @@ -617,7 +629,7 @@ namespace Comet Measure(widthConstraint, heightConstraint); void IFrameworkElement.InvalidateMeasure() => InvalidateMeasurement(); void IFrameworkElement.InvalidateArrange() => IsArrangeValid = false; - void IReplaceableView. TransferState(IView newView) { + void IHotReloadableView. TransferState(IView newView) { var oldState = this.GetState(); var changes = oldState.ChangedProperties; foreach (var change in changes) @@ -625,6 +637,6 @@ namespace Comet newView.SetDeepPropertyValue(change.Key, change.Value); } } - void IReplaceableView.Reload() => ThreadHelper.RunOnMainThread(()=>Reload(true)); + void IHotReloadableView.Reload() => ThreadHelper.RunOnMainThread(()=>Reload(true)); } } \ No newline at end of file diff --git a/src/Comet/Controls/ZStack.cs b/src/Comet/Controls/ZStack.cs index ec752c62..20ce8e90 100644 --- a/src/Comet/Controls/ZStack.cs +++ b/src/Comet/Controls/ZStack.cs @@ -1,5 +1,5 @@ using Comet.Layout; -using Xamarin.Platform.Layouts; +using Microsoft.Maui.Layouts; namespace Comet { diff --git a/src/Comet/EnvironmentData.cs b/src/Comet/EnvironmentData.cs index 77ebfe48..338a2577 100644 --- a/src/Comet/EnvironmentData.cs +++ b/src/Comet/EnvironmentData.cs @@ -56,6 +56,7 @@ namespace Comet public const string Title = "Title"; public const string Border = "Border"; public const string StyleId = "StyleId"; + public const string AutomationId = nameof(AutomationId); } public static class Shape diff --git a/src/Comet/Graphics/AffineTransformF.cs b/src/Comet/Graphics/AffineTransformF.cs index 14b1dafd..0dc4f0a7 100644 --- a/src/Comet/Graphics/AffineTransformF.cs +++ b/src/Comet/Graphics/AffineTransformF.cs @@ -1,5 +1,5 @@ //using System; -//using System.Graphics; +// //// ReSharper disable CompareOfFloatsByEqualityOperator //// ReSharper disable MemberCanBePrivate.Global diff --git a/src/Comet/Graphics/Bitmap.cs b/src/Comet/Graphics/Bitmap.cs index a6658504..f8ca4c20 100644 --- a/src/Comet/Graphics/Bitmap.cs +++ b/src/Comet/Graphics/Bitmap.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Graphics { diff --git a/src/Comet/Graphics/Gradient.cs b/src/Comet/Graphics/Gradient.cs index f38f088d..12a0fed2 100644 --- a/src/Comet/Graphics/Gradient.cs +++ b/src/Comet/Graphics/Gradient.cs @@ -1,5 +1,5 @@ -using System; -using System.Graphics; +using System; +using Microsoft.Maui.Graphics; namespace Comet.Graphics { diff --git a/src/Comet/Graphics/GraphicsOperations.cs b/src/Comet/Graphics/GraphicsOperations.cs index 66aa7efb..b7b40e0c 100644 --- a/src/Comet/Graphics/GraphicsOperations.cs +++ b/src/Comet/Graphics/GraphicsOperations.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Linq; +using Microsoft.Maui.Graphics; namespace Comet.Graphics { diff --git a/src/Comet/Graphics/LinearGradient.cs b/src/Comet/Graphics/LinearGradient.cs index 2a1071be..c1600ccb 100644 --- a/src/Comet/Graphics/LinearGradient.cs +++ b/src/Comet/Graphics/LinearGradient.cs @@ -1,5 +1,6 @@ -using System.Graphics; + using System.Net; +using Microsoft.Maui.Graphics; namespace Comet.Graphics { diff --git a/src/Comet/Graphics/PathBuilder.cs b/src/Comet/Graphics/PathBuilder.cs index 736727a5..655ecdb4 100644 --- a/src/Comet/Graphics/PathBuilder.cs +++ b/src/Comet/Graphics/PathBuilder.cs @@ -3,7 +3,7 @@ //using System.Text.RegularExpressions; //using System.Text; //using System.Globalization; -//using System.Graphics; +// //namespace Comet.Graphics //{ diff --git a/src/Comet/Graphics/PathF.cs b/src/Comet/Graphics/PathF.cs index bc012ad1..acf0885b 100644 --- a/src/Comet/Graphics/PathF.cs +++ b/src/Comet/Graphics/PathF.cs @@ -1,6 +1,6 @@ //using System; //using System.Collections.Generic; -//using System.Graphics; +// //using System.Linq; //// ReSharper disable MemberCanBePrivate.Global diff --git a/src/Comet/Graphics/RadialGradient.cs b/src/Comet/Graphics/RadialGradient.cs index b7f805ff..b439511d 100644 --- a/src/Comet/Graphics/RadialGradient.cs +++ b/src/Comet/Graphics/RadialGradient.cs @@ -1,4 +1,6 @@ -using System.Graphics; + + +using Microsoft.Maui.Graphics; namespace Comet.Graphics { diff --git a/src/Comet/Graphics/Stop.cs b/src/Comet/Graphics/Stop.cs index 2c93d64a..2c1a169b 100644 --- a/src/Comet/Graphics/Stop.cs +++ b/src/Comet/Graphics/Stop.cs @@ -1,5 +1,5 @@ -using System; -using System.Graphics; +using System; +using Microsoft.Maui.Graphics; namespace Comet.Graphics { diff --git a/src/Comet/Helpers/ColorExtensions.cs b/src/Comet/Helpers/ColorExtensions.cs index aa37f02d..425deba3 100644 --- a/src/Comet/Helpers/ColorExtensions.cs +++ b/src/Comet/Helpers/ColorExtensions.cs @@ -1,5 +1,6 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; + // ReSharper disable once CheckNamespace namespace Comet diff --git a/src/Comet/Helpers/DatabindingExtensions.cs b/src/Comet/Helpers/DatabindingExtensions.cs index fff464da..517165e6 100644 --- a/src/Comet/Helpers/DatabindingExtensions.cs +++ b/src/Comet/Helpers/DatabindingExtensions.cs @@ -5,8 +5,8 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using Comet.Reflection; -using Xamarin.Platform; -using Xamarin.Platform.HotReload; +using Microsoft.Maui; +using Microsoft.Maui.HotReload; // ReSharper disable once CheckNamespace namespace Comet @@ -227,23 +227,23 @@ namespace Comet { static bool AreSameType(View view, View compareView) { - if (HotReloadHelper.IsReplacedView(view, compareView)) + if (MauiHotReloadHelper.IsReplacedView(view, compareView)) return true; //Add in more edge cases var viewView = view?.GetView(); var compareViewView = compareView?.GetView(); - if (HotReloadHelper.IsReplacedView(viewView, compareViewView)) + if (MauiHotReloadHelper.IsReplacedView(viewView, compareViewView)) return true; return viewView?.GetType() == compareViewView?.GetType(); } var areSame = AreSameType(view, compareView); - if (areSame && checkRenderers && compareView.ViewHandler != null) - { - var renderType = Xamarin.Platform.Registrar.Handlers.GetRendererType(view.GetType()); - areSame = renderType == compareView.ViewHandler.GetType(); - } + //if (areSame && checkRenderers && compareView.ViewHandler != null) + //{ + // var renderType = Microsoft.Maui.Registrar.Handlers.GetRendererType(view.GetType()); + // areSame = renderType == compareView.ViewHandler.GetType(); + //} return areSame; } } diff --git a/src/Comet/Helpers/DrawingExtensions.cs b/src/Comet/Helpers/DrawingExtensions.cs index 194bba13..7125a862 100644 --- a/src/Comet/Helpers/DrawingExtensions.cs +++ b/src/Comet/Helpers/DrawingExtensions.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; + using Comet.Graphics; +using Microsoft.Maui.Graphics; // ReSharper disable once CheckNamespace namespace Comet diff --git a/src/Comet/Helpers/GraphicsExtensions.cs b/src/Comet/Helpers/GraphicsExtensions.cs index f78e9043..6f6e2c81 100644 --- a/src/Comet/Helpers/GraphicsExtensions.cs +++ b/src/Comet/Helpers/GraphicsExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; -using System.Graphics; +using Microsoft.Maui.Graphics; + namespace Comet { public static class GraphicsExtensions diff --git a/src/Comet/Helpers/LayoutExtensions.cs b/src/Comet/Helpers/LayoutExtensions.cs index f59c03d1..37d7ea62 100644 --- a/src/Comet/Helpers/LayoutExtensions.cs +++ b/src/Comet/Helpers/LayoutExtensions.cs @@ -1,6 +1,7 @@ using Comet.Layout; -using System.Graphics; -using Xamarin.Forms; + +using Microsoft.Maui; +using Microsoft.Maui.Graphics; // ReSharper disable once CheckNamespace namespace Comet diff --git a/src/Comet/Helpers/LineBreakModeExtensions.cs b/src/Comet/Helpers/LineBreakModeExtensions.cs index d0566ec9..14183e59 100644 --- a/src/Comet/Helpers/LineBreakModeExtensions.cs +++ b/src/Comet/Helpers/LineBreakModeExtensions.cs @@ -1,5 +1,5 @@ using System; -using static Comet.EnvironmentKeys; +using Microsoft.Maui; namespace Comet { diff --git a/src/Comet/Helpers/MauiExtensions.cs b/src/Comet/Helpers/MauiExtensions.cs index 2e3f6dcf..eb67dddc 100644 --- a/src/Comet/Helpers/MauiExtensions.cs +++ b/src/Comet/Helpers/MauiExtensions.cs @@ -1,7 +1,7 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; -namespace Xamarin.Platform +namespace Microsoft.Maui { public static class MauiExtensions { diff --git a/src/Comet/Helpers/RectExtensions.cs b/src/Comet/Helpers/RectExtensions.cs index 21660dd1..027cde2e 100644 --- a/src/Comet/Helpers/RectExtensions.cs +++ b/src/Comet/Helpers/RectExtensions.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; namespace Comet diff --git a/src/Comet/Helpers/RectangleExtensions.cs b/src/Comet/Helpers/RectangleExtensions.cs index 4d65004d..c1b45e1e 100644 --- a/src/Comet/Helpers/RectangleExtensions.cs +++ b/src/Comet/Helpers/RectangleExtensions.cs @@ -1,7 +1,8 @@ using System; -using System.Graphics; + using System.Linq; -using Xamarin.Forms; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Helpers/TextExtensions.cs b/src/Comet/Helpers/TextExtensions.cs index 2ad4cb50..7d25d0ec 100644 --- a/src/Comet/Helpers/TextExtensions.cs +++ b/src/Comet/Helpers/TextExtensions.cs @@ -1,5 +1,5 @@ using System; -using Xamarin.Forms; +using Microsoft.Maui; // ReSharper disable once CheckNamespace namespace Comet diff --git a/src/Comet/Helpers/ViewExtensions.cs b/src/Comet/Helpers/ViewExtensions.cs index 31737b15..3bce8e11 100644 --- a/src/Comet/Helpers/ViewExtensions.cs +++ b/src/Comet/Helpers/ViewExtensions.cs @@ -114,5 +114,10 @@ namespace Comet var resultView = view.FindParentOfType>(); resultView.SetException(ex); } + + public static string GetAutomationId(this View view) + => view.GetEnvironment(view, EnvironmentKeys.View.AutomationId,cascades:false); + public static void SetAutomationId(this View view, string automationId) + => view.SetEnvironment(EnvironmentKeys.View.AutomationId, automationId, cascades: false); } } diff --git a/src/Comet/IReloadHandler.cs b/src/Comet/IReloadHandler.cs deleted file mode 100644 index c6ede4ec..00000000 --- a/src/Comet/IReloadHandler.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; -namespace Comet -{ - public interface IReloadHandler - { - void Reload(); - } -} diff --git a/src/Comet/Internal/Extensions.cs b/src/Comet/Internal/Extensions.cs index 16860ae7..f0f6e708 100644 --- a/src/Comet/Internal/Extensions.cs +++ b/src/Comet/Internal/Extensions.cs @@ -2,14 +2,14 @@ using System.Collections.Generic; using System.Linq; using Comet.Reflection; -using Xamarin.Platform; +using Microsoft.Maui; namespace Comet.Internal { public static class Extensions { - public static View FindViewById(this View view, string id) - => View.ActiveViews.OfType().FirstOrDefault(x => x.Id == id); + //public static View FindViewById(this View view, string id) + // => View.ActiveViews.OfType().FirstOrDefault(x => x.Id == id); public static Func GetBody(this View view) { @@ -21,11 +21,11 @@ namespace Comet.Internal public static BindingState InternalGetState(this View view) => view.GetState(); public static void ResetGlobalEnvironment(this View view) => View.Environment.Clear(); - public static void DisposeAllViews(this View view) => View.ActiveViews.Clear(); + //public static void DisposeAllViews(this View view) => View.ActiveViews.Clear(); public static View GetView(this View view) => view.GetView(); - public static Dictionary GetAllRenderers(this Registrar registar) => registar._handler; + //public static Dictionary GetAllRenderers(this Registrar registar) => registar._handler; public static T SetParent(this T view, View parent) where T : View { diff --git a/src/Comet/Layout/GridLayoutManager.cs b/src/Comet/Layout/GridLayoutManager.cs index 6c1b275c..a725342f 100644 --- a/src/Comet/Layout/GridLayoutManager.cs +++ b/src/Comet/Layout/GridLayoutManager.cs @@ -1,461 +1,462 @@ -using System; -using System.Collections.Generic; -using System.Graphics; -using System.Linq; -using Xamarin.Platform.Layouts; - -namespace Comet.Layout -{ - public class GridLayoutManager : ILayoutManager - { - private readonly List _constraints = new List(); - private readonly List _definedRows = new List(); - private readonly List _definedColumns = new List(); - private Size _lastSize; - private double[] _gridX; - private double[] _gridY; - private double[] _widths; - private double[] _heights; - private double _width; - private double _height; - - private readonly double _spacing; - private readonly Grid grid; - - public GridLayoutManager(Grid grid, - double? spacing) - { - this.grid = grid; - _spacing = spacing ?? 4; - } - - public object DefaultRowHeight { get; set; } - - public object DefaultColumnWidth { get; set; } - - public void Invalidate() - { - _constraints.Clear(); - _gridX = null; - _gridY = null; - _widths = null; - _heights = null; - } - - public Size Measure(double widthConstraint, double heightConstraint) - { - var available = new Size(widthConstraint, heightConstraint); - var layout = grid; - if (_constraints.Count == 0) - { - var maxRow = 0; - var maxColumn = 0; - - for (var index = 0; index < layout.Count; index++) - { - var view = layout[index]; - var constraint = view.GetLayoutConstraints() as GridConstraints ?? GridConstraints.Default; - _constraints.Add(constraint); - - maxRow = Math.Max(maxRow, constraint.Row + constraint.RowSpan - 1); - maxColumn = Math.Max(maxColumn, constraint.Column + constraint.ColumnSpan - 1); - } - - while (maxRow >= _definedRows.Count) - _definedRows.Add(DefaultRowHeight); - - while (maxColumn >= _definedColumns.Count) - _definedColumns.Add(DefaultColumnWidth); - } - - if (_gridX == null || !_lastSize.Equals(available)) - { - ComputeGrid(available.Width, available.Height); - _lastSize = available; - } - - for (var index = 0; index < _constraints.Count; index++) - { - var position = _constraints[index]; - var view = layout[index]; - - var x = _gridX[position.Column]; - var y = _gridY[position.Row]; - - double w = 0; - for (var i = 0; i < position.ColumnSpan; i++) - w += GetColumnWidth(position.Column + i); - - double h = 0; - for (var i = 0; i < position.RowSpan; i++) - h += GetRowHeight(position.Row + i); - - if (position.WeightX < 1 || position.WeightY < 1) - { - var viewSize = view.MeasuredSize; - - if (!view.MeasurementValid) - viewSize = view.Measure(widthConstraint,heightConstraint); - - var cellWidth = w; - var cellHeight = h; - - if (position.WeightX <= 0) - w = viewSize.Width; - else - w *= position.WeightX; - - if (position.WeightY <= 0) - h = viewSize.Height; - else - h *= position.WeightY; - - if (position.PositionX > 0) - { - var availWidth = cellWidth - w; - x += (double)Math.Round(availWidth * position.PositionX); - } - - if (position.PositionY > 0) - { - var availHeight = cellHeight - h; - y += (double)Math.Round(availHeight * position.PositionY); - } - - view.MeasuredSize = new Size(w, h); - view.MeasurementValid = true; - } - - view.Frame = new Rectangle(x, y, w, h); - } - - return new Size(_width, _height); - } - - public void Arrange(Rectangle rect) - { - var layout = grid; - var measured = rect.Size; - var size = rect.Size; - if (_gridX == null || !_lastSize.Equals(size)) - { - ComputeGrid(size.Width, size.Height); - _lastSize = size; - } - - for (var index = 0; index < _constraints.Count; index++) - { - var position = _constraints[index]; - var view = layout[index]; - - var viewSize = view.MeasuredSize; - if (!view.MeasurementValid) - { - view.MeasuredSize = viewSize = view.Measure(measured.Width, measured.Height); - view.MeasurementValid = true; - } - - var x = _gridX[position.Column]; - var y = _gridY[position.Row]; - - double w = 0; - for (var i = 0; i < position.ColumnSpan; i++) - w += GetColumnWidth(position.Column + i); - - double h = 0; - for (var i = 0; i < position.RowSpan; i++) - h += GetRowHeight(position.Row + i); - - if (position.WeightX < 1 || position.WeightY < 1) - { - var cellWidth = w; - var cellHeight = h; - - if (position.WeightX <= 0) - w = viewSize.Width; - else - w *= position.WeightX; - - if (position.WeightY <= 0) - h = viewSize.Height; - else - h *= position.WeightY; - - if (position.PositionX > 0) - { - var availWidth = cellWidth - w; - x += (double)Math.Round(availWidth * position.PositionX); - } - - if (position.PositionY > 0) - { - var availHeight = cellHeight - h; - y += (double)Math.Round(availHeight * position.PositionY); - } - } - - var margin = view.GetMargin(); - if (!margin.IsEmpty) - { - x += margin.Left; - y += margin.Top; - w -= margin.HorizontalThickness; - h -= margin.VerticalThickness; - } - - view.Frame = new Rectangle(x, y, w, h); - } - } - - public int AddRow(object row) - { - if (row == null) - return -1; - - _definedRows.Add(row); - Invalidate(); - - return _definedRows.Count - 1; - } - - public void AddRows(params object[] rows) - { - if (rows == null) - return; - - foreach (var row in rows) - _definedRows.Add(row ?? DefaultRowHeight); - - Invalidate(); - } - - public void SetRowHeight(int index, object value) - { - if (index >= 0 && index < _definedRows.Count) - { - _definedRows[index] = value; - Invalidate(); - } - } - - public int AddColumn(object column) - { - if (column == null) - return -1; - - _definedColumns.Add(column); - - Invalidate(); - return _definedColumns.Count - 1; - } - - public void AddColumns(params object[] columns) - { - if (columns == null) - return; - - foreach (var column in columns) - _definedColumns.Add(column ?? DefaultColumnWidth); - - Invalidate(); - } - - public void SetColumnWidth(int index, object value) - { - if (index >= 0 && index < _definedColumns.Count) - { - _definedColumns[index] = value; - Invalidate(); - } - } - - private double GetColumnWidth(int column) - { - return _widths[column]; - } - - private double GetRowHeight(int row) - { - return _heights[row]; - } - - private void ComputeGrid(double width, double height) - { - var rows = _definedRows.Count; - var columns = _definedColumns.Count; - - _gridX = new double[columns]; - _gridY = new double[rows]; - _widths = new double[columns]; - _heights = new double[rows]; - _width = 0; - _height = 0; - - double takenX = 0; - var calculatedColumns = new List(); - var calculatedColumnFactors = new List(); - for (var c = 0; c < columns; c++) - { - var w = _definedColumns[c]; - if (!w.ToString().EndsWith("*", StringComparison.Ordinal)) - { - if (double.TryParse(w.ToString(), out var value)) - { - takenX += value; - _widths[c] = value; - } - else - { - calculatedColumns.Add(c); - calculatedColumnFactors.Add(GetFactor(w)); - } - } - else - { - calculatedColumns.Add(c); - calculatedColumnFactors.Add(GetFactor(w)); - } - } - - var availableWidth = width - takenX; - var columnFactor = calculatedColumnFactors.Sum(f => f); - var columnWidth = availableWidth / columnFactor; - var factorIndex = 0; - foreach (var c in calculatedColumns) - { - _widths[c] = columnWidth * calculatedColumnFactors[factorIndex++]; - } - - double takenY = 0; - var calculatedRows = new List(); - var calculatedRowFactors = new List(); - for (var r = 0; r < rows; r++) - { - var h = _definedRows[r]; - if (!h.ToString().EndsWith("*", StringComparison.Ordinal)) - { - if (double.TryParse(h.ToString(), out var value)) - { - takenY += value; - _heights[r] = value; - } - else - { - calculatedRows.Add(r); - calculatedRowFactors.Add(GetFactor(h)); - } - } - else - { - calculatedRows.Add(r); - calculatedRowFactors.Add(GetFactor(h)); - } - } - - var availableHeight = height - takenY; - var rowFactor = calculatedRowFactors.Sum(f => f); - var rowHeight = availableHeight / rowFactor; - factorIndex = 0; - foreach (var r in calculatedRows) - { - _heights[r] = rowHeight * calculatedRowFactors[factorIndex++]; - } - - double x = 0; - for (var c = 0; c < columns; c++) - { - _gridX[c] = x; - x += _widths[c]; - } - - double y = 0; - for (var r = 0; r < rows; r++) - { - _gridY[r] = y; - y += _heights[r]; - } - - _width = _widths.Sum(); - _height = _heights.Sum(); - } - - private double GetFactor(object value) - { - if (value != null) - { - var str = value.ToString(); - if (str.EndsWith("*", StringComparison.Ordinal)) - { - str = str.Substring(0, str.Length - 1); - if (double.TryParse(str, out var f)) - { - return f; - } - } - } - - return 1; - } - - public double CalculateWidth() - { - double width = 0; - - if (_widths != null) - { - foreach (var value in _widths) - { - width += value; - } - } - else - { - var columns = _definedColumns.Count; - for (var c = 0; c < columns; c++) - { - var w = _definedColumns[c]; - if (!"*".Equals(w)) - { - if (double.TryParse(w.ToString(), out var value)) - { - width += value; - } - } - } - } - - return width; - } - - public double CalculateHeight() - { - double height = 0; - - if (_heights != null) - { - foreach (var value in _heights) - { - height += value; - } - } - else - { - var rows = _definedRows.Count; - for (var r = 0; r < rows; r++) - { - var h = _definedRows[r]; - if (!"*".Equals(h)) - { - if (double.TryParse(h.ToString(), out var value)) - { - height += value; - } - } - } - } - - return height; - } - - } -} +//using System; +//using System.Collections.Generic; + +//using System.Linq; +//using Microsoft.Maui.Graphics; +//using Microsoft.Maui.Layouts; + +//namespace Comet.Layout +//{ +// public class GridLayoutManager : ILayoutManager +// { +// private readonly List _constraints = new List(); +// private readonly List _definedRows = new List(); +// private readonly List _definedColumns = new List(); +// private Size _lastSize; +// private double[] _gridX; +// private double[] _gridY; +// private double[] _widths; +// private double[] _heights; +// private double _width; +// private double _height; + +// private readonly double _spacing; +// private readonly Grid grid; + +// public GridLayoutManager(Grid grid, +// double? spacing) +// { +// this.grid = grid; +// _spacing = spacing ?? 4; +// } + +// public object DefaultRowHeight { get; set; } + +// public object DefaultColumnWidth { get; set; } + +// public void Invalidate() +// { +// _constraints.Clear(); +// _gridX = null; +// _gridY = null; +// _widths = null; +// _heights = null; +// } + +// public Size Measure(double widthConstraint, double heightConstraint) +// { +// var available = new Size(widthConstraint, heightConstraint); +// var layout = grid; +// if (_constraints.Count == 0) +// { +// var maxRow = 0; +// var maxColumn = 0; + +// for (var index = 0; index < layout.Count; index++) +// { +// var view = layout[index]; +// var constraint = view.GetLayoutConstraints() as GridConstraints ?? GridConstraints.Default; +// _constraints.Add(constraint); + +// maxRow = Math.Max(maxRow, constraint.Row + constraint.RowSpan - 1); +// maxColumn = Math.Max(maxColumn, constraint.Column + constraint.ColumnSpan - 1); +// } + +// while (maxRow >= _definedRows.Count) +// _definedRows.Add(DefaultRowHeight); + +// while (maxColumn >= _definedColumns.Count) +// _definedColumns.Add(DefaultColumnWidth); +// } + +// if (_gridX == null || !_lastSize.Equals(available)) +// { +// ComputeGrid(available.Width, available.Height); +// _lastSize = available; +// } + +// for (var index = 0; index < _constraints.Count; index++) +// { +// var position = _constraints[index]; +// var view = layout[index]; + +// var x = _gridX[position.Column]; +// var y = _gridY[position.Row]; + +// double w = 0; +// for (var i = 0; i < position.ColumnSpan; i++) +// w += GetColumnWidth(position.Column + i); + +// double h = 0; +// for (var i = 0; i < position.RowSpan; i++) +// h += GetRowHeight(position.Row + i); + +// if (position.WeightX < 1 || position.WeightY < 1) +// { +// var viewSize = view.MeasuredSize; + +// if (!view.MeasurementValid) +// viewSize = view.Measure(widthConstraint,heightConstraint); + +// var cellWidth = w; +// var cellHeight = h; + +// if (position.WeightX <= 0) +// w = viewSize.Width; +// else +// w *= position.WeightX; + +// if (position.WeightY <= 0) +// h = viewSize.Height; +// else +// h *= position.WeightY; + +// if (position.PositionX > 0) +// { +// var availWidth = cellWidth - w; +// x += (double)Math.Round(availWidth * position.PositionX); +// } + +// if (position.PositionY > 0) +// { +// var availHeight = cellHeight - h; +// y += (double)Math.Round(availHeight * position.PositionY); +// } + +// view.MeasuredSize = new Size(w, h); +// view.MeasurementValid = true; +// } + +// view.Frame = new Rectangle(x, y, w, h); +// } + +// return new Size(_width, _height); +// } + +// public void ArrangeChildren(Rectangle rect) +// { +// var layout = grid; +// var measured = rect.Size; +// var size = rect.Size; +// if (_gridX == null || !_lastSize.Equals(size)) +// { +// ComputeGrid(size.Width, size.Height); +// _lastSize = size; +// } + +// for (var index = 0; index < _constraints.Count; index++) +// { +// var position = _constraints[index]; +// var view = layout[index]; + +// var viewSize = view.MeasuredSize; +// if (!view.MeasurementValid) +// { +// view.MeasuredSize = viewSize = view.Measure(measured.Width, measured.Height); +// view.MeasurementValid = true; +// } + +// var x = _gridX[position.Column]; +// var y = _gridY[position.Row]; + +// double w = 0; +// for (var i = 0; i < position.ColumnSpan; i++) +// w += GetColumnWidth(position.Column + i); + +// double h = 0; +// for (var i = 0; i < position.RowSpan; i++) +// h += GetRowHeight(position.Row + i); + +// if (position.WeightX < 1 || position.WeightY < 1) +// { +// var cellWidth = w; +// var cellHeight = h; + +// if (position.WeightX <= 0) +// w = viewSize.Width; +// else +// w *= position.WeightX; + +// if (position.WeightY <= 0) +// h = viewSize.Height; +// else +// h *= position.WeightY; + +// if (position.PositionX > 0) +// { +// var availWidth = cellWidth - w; +// x += (double)Math.Round(availWidth * position.PositionX); +// } + +// if (position.PositionY > 0) +// { +// var availHeight = cellHeight - h; +// y += (double)Math.Round(availHeight * position.PositionY); +// } +// } + +// var margin = view.GetMargin(); +// if (!margin.IsEmpty) +// { +// x += margin.Left; +// y += margin.Top; +// w -= margin.HorizontalThickness; +// h -= margin.VerticalThickness; +// } + +// view.Frame = new Rectangle(x, y, w, h); +// } +// } + +// public int AddRow(object row) +// { +// if (row == null) +// return -1; + +// _definedRows.Add(row); +// Invalidate(); + +// return _definedRows.Count - 1; +// } + +// public void AddRows(params object[] rows) +// { +// if (rows == null) +// return; + +// foreach (var row in rows) +// _definedRows.Add(row ?? DefaultRowHeight); + +// Invalidate(); +// } + +// public void SetRowHeight(int index, object value) +// { +// if (index >= 0 && index < _definedRows.Count) +// { +// _definedRows[index] = value; +// Invalidate(); +// } +// } + +// public int AddColumn(object column) +// { +// if (column == null) +// return -1; + +// _definedColumns.Add(column); + +// Invalidate(); +// return _definedColumns.Count - 1; +// } + +// public void AddColumns(params object[] columns) +// { +// if (columns == null) +// return; + +// foreach (var column in columns) +// _definedColumns.Add(column ?? DefaultColumnWidth); + +// Invalidate(); +// } + +// public void SetColumnWidth(int index, object value) +// { +// if (index >= 0 && index < _definedColumns.Count) +// { +// _definedColumns[index] = value; +// Invalidate(); +// } +// } + +// private double GetColumnWidth(int column) +// { +// return _widths[column]; +// } + +// private double GetRowHeight(int row) +// { +// return _heights[row]; +// } + +// private void ComputeGrid(double width, double height) +// { +// var rows = _definedRows.Count; +// var columns = _definedColumns.Count; + +// _gridX = new double[columns]; +// _gridY = new double[rows]; +// _widths = new double[columns]; +// _heights = new double[rows]; +// _width = 0; +// _height = 0; + +// double takenX = 0; +// var calculatedColumns = new List(); +// var calculatedColumnFactors = new List(); +// for (var c = 0; c < columns; c++) +// { +// var w = _definedColumns[c]; +// if (!w.ToString().EndsWith("*", StringComparison.Ordinal)) +// { +// if (double.TryParse(w.ToString(), out var value)) +// { +// takenX += value; +// _widths[c] = value; +// } +// else +// { +// calculatedColumns.Add(c); +// calculatedColumnFactors.Add(GetFactor(w)); +// } +// } +// else +// { +// calculatedColumns.Add(c); +// calculatedColumnFactors.Add(GetFactor(w)); +// } +// } + +// var availableWidth = width - takenX; +// var columnFactor = calculatedColumnFactors.Sum(f => f); +// var columnWidth = availableWidth / columnFactor; +// var factorIndex = 0; +// foreach (var c in calculatedColumns) +// { +// _widths[c] = columnWidth * calculatedColumnFactors[factorIndex++]; +// } + +// double takenY = 0; +// var calculatedRows = new List(); +// var calculatedRowFactors = new List(); +// for (var r = 0; r < rows; r++) +// { +// var h = _definedRows[r]; +// if (!h.ToString().EndsWith("*", StringComparison.Ordinal)) +// { +// if (double.TryParse(h.ToString(), out var value)) +// { +// takenY += value; +// _heights[r] = value; +// } +// else +// { +// calculatedRows.Add(r); +// calculatedRowFactors.Add(GetFactor(h)); +// } +// } +// else +// { +// calculatedRows.Add(r); +// calculatedRowFactors.Add(GetFactor(h)); +// } +// } + +// var availableHeight = height - takenY; +// var rowFactor = calculatedRowFactors.Sum(f => f); +// var rowHeight = availableHeight / rowFactor; +// factorIndex = 0; +// foreach (var r in calculatedRows) +// { +// _heights[r] = rowHeight * calculatedRowFactors[factorIndex++]; +// } + +// double x = 0; +// for (var c = 0; c < columns; c++) +// { +// _gridX[c] = x; +// x += _widths[c]; +// } + +// double y = 0; +// for (var r = 0; r < rows; r++) +// { +// _gridY[r] = y; +// y += _heights[r]; +// } + +// _width = _widths.Sum(); +// _height = _heights.Sum(); +// } + +// private double GetFactor(object value) +// { +// if (value != null) +// { +// var str = value.ToString(); +// if (str.EndsWith("*", StringComparison.Ordinal)) +// { +// str = str.Substring(0, str.Length - 1); +// if (double.TryParse(str, out var f)) +// { +// return f; +// } +// } +// } + +// return 1; +// } + +// public double CalculateWidth() +// { +// double width = 0; + +// if (_widths != null) +// { +// foreach (var value in _widths) +// { +// width += value; +// } +// } +// else +// { +// var columns = _definedColumns.Count; +// for (var c = 0; c < columns; c++) +// { +// var w = _definedColumns[c]; +// if (!"*".Equals(w)) +// { +// if (double.TryParse(w.ToString(), out var value)) +// { +// width += value; +// } +// } +// } +// } + +// return width; +// } + +// public double CalculateHeight() +// { +// double height = 0; + +// if (_heights != null) +// { +// foreach (var value in _heights) +// { +// height += value; +// } +// } +// else +// { +// var rows = _definedRows.Count; +// for (var r = 0; r < rows; r++) +// { +// var h = _definedRows[r]; +// if (!"*".Equals(h)) +// { +// if (double.TryParse(h.ToString(), out var value)) +// { +// height += value; +// } +// } +// } +// } + +// return height; +// } + +// } +//} diff --git a/src/Comet/Layout/ZStackLayoutManager.cs b/src/Comet/Layout/ZStackLayoutManager.cs index af729ce6..7f8b3e03 100644 --- a/src/Comet/Layout/ZStackLayoutManager.cs +++ b/src/Comet/Layout/ZStackLayoutManager.cs @@ -1,6 +1,7 @@ -using System.Graphics; -using Xamarin.Platform; -using Xamarin.Platform.Layouts; + +using Microsoft.Maui; +using Microsoft.Maui.Graphics; +using Microsoft.Maui.Layouts; namespace Comet.Layout { @@ -11,7 +12,7 @@ namespace Comet.Layout ILayout layout; public Size Measure(double widthConstraint, double heightConstraint) => new(widthConstraint, heightConstraint); - public void Arrange(Rectangle bounds) + public void ArrangeChildren(Rectangle bounds) { foreach (var v in layout.Children) { diff --git a/src/Comet/LineBreakMode.cs b/src/Comet/LineBreakMode.cs deleted file mode 100644 index 36bdcd46..00000000 --- a/src/Comet/LineBreakMode.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -namespace Comet -{ - /// - /// Truncation or wrapping used on Text - /// - public enum LineBreakMode - { - NoWrap, - WordWrap, - CharacterWrap, - HeadTruncation, - TailTruncation, - MiddleTruncation - } -} diff --git a/src/Comet/Shadow.cs b/src/Comet/Shadow.cs index 80c89957..b4719468 100644 --- a/src/Comet/Shadow.cs +++ b/src/Comet/Shadow.cs @@ -1,4 +1,6 @@ -using System.Graphics; + + +using Microsoft.Maui.Graphics; namespace Comet.Graphics { diff --git a/src/Comet/Shape.cs b/src/Comet/Shape.cs index 7ceca885..ac9fb91b 100644 --- a/src/Comet/Shape.cs +++ b/src/Comet/Shape.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; -using System.Graphics; + using Comet.Graphics; -using Xamarin.Platform.Shapes; +using Microsoft.Maui.Graphics; namespace Comet { - public abstract class Shape : ContextualObject, IShape + public abstract class Shape : ContextualObject//, IShape { protected Shape() { diff --git a/src/Comet/Shapes/Capsule.cs b/src/Comet/Shapes/Capsule.cs index cf1a7bcd..9daa65a9 100644 --- a/src/Comet/Shapes/Capsule.cs +++ b/src/Comet/Shapes/Capsule.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; + using Comet.Graphics; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Shapes/Circle.cs b/src/Comet/Shapes/Circle.cs index 5fa1d4c5..efb9122b 100644 --- a/src/Comet/Shapes/Circle.cs +++ b/src/Comet/Shapes/Circle.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; + using Comet.Graphics; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Shapes/Ellipse.cs b/src/Comet/Shapes/Ellipse.cs index 01f6ca4c..319ef984 100644 --- a/src/Comet/Shapes/Ellipse.cs +++ b/src/Comet/Shapes/Ellipse.cs @@ -1,5 +1,5 @@ using Comet.Graphics; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Shapes/Path.cs b/src/Comet/Shapes/Path.cs index 33b9a968..f3137369 100644 --- a/src/Comet/Shapes/Path.cs +++ b/src/Comet/Shapes/Path.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; + using Comet.Graphics; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Shapes/Pill.cs b/src/Comet/Shapes/Pill.cs index 98915b07..5d4b8dc5 100644 --- a/src/Comet/Shapes/Pill.cs +++ b/src/Comet/Shapes/Pill.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; + using Comet.Graphics; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Shapes/Rectangle.cs b/src/Comet/Shapes/Rectangle.cs index f68191a8..d5e1727b 100644 --- a/src/Comet/Shapes/Rectangle.cs +++ b/src/Comet/Shapes/Rectangle.cs @@ -1,11 +1,11 @@ using Comet.Graphics; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Shapes { public class Rectangle : Shape { - public override PathF PathForBounds(System.Graphics.Rectangle rect) + public override PathF PathForBounds(Microsoft.Maui.Graphics.Rectangle rect) { var path = new PathF(); path.AppendRectangle(rect); diff --git a/src/Comet/Shapes/RoundedRectangle.cs b/src/Comet/Shapes/RoundedRectangle.cs index 2c38887e..7ecfc40c 100644 --- a/src/Comet/Shapes/RoundedRectangle.cs +++ b/src/Comet/Shapes/RoundedRectangle.cs @@ -1,5 +1,5 @@ using Comet.Graphics; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet { diff --git a/src/Comet/Styles/ButtonStyle.cs b/src/Comet/Styles/ButtonStyle.cs index 9be4356a..cf2c1340 100644 --- a/src/Comet/Styles/ButtonStyle.cs +++ b/src/Comet/Styles/ButtonStyle.cs @@ -1,9 +1,10 @@ using Comet.Graphics; using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; -using Xamarin.Forms; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet.Styles { diff --git a/src/Comet/Styles/Material/ColorPalette.cs b/src/Comet/Styles/Material/ColorPalette.cs index c6dc7753..e4fb0a7c 100644 --- a/src/Comet/Styles/Material/ColorPalette.cs +++ b/src/Comet/Styles/Material/ColorPalette.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Styles.Material { diff --git a/src/Comet/Styles/Material/MaterialStyle.cs b/src/Comet/Styles/Material/MaterialStyle.cs index c9881140..4ce2d68e 100644 --- a/src/Comet/Styles/Material/MaterialStyle.cs +++ b/src/Comet/Styles/Material/MaterialStyle.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; -using Xamarin.Forms; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Comet.Styles.Material { diff --git a/src/Comet/Styles/NavbarStyle.cs b/src/Comet/Styles/NavbarStyle.cs index 8767357d..4fb7a898 100644 --- a/src/Comet/Styles/NavbarStyle.cs +++ b/src/Comet/Styles/NavbarStyle.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Styles { diff --git a/src/Comet/Styles/ProgressBarStyle.cs b/src/Comet/Styles/ProgressBarStyle.cs index 13152a66..9554ac18 100644 --- a/src/Comet/Styles/ProgressBarStyle.cs +++ b/src/Comet/Styles/ProgressBarStyle.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Styles { diff --git a/src/Comet/Styles/SliderStyle.cs b/src/Comet/Styles/SliderStyle.cs index d7548d6e..71c4b13a 100644 --- a/src/Comet/Styles/SliderStyle.cs +++ b/src/Comet/Styles/SliderStyle.cs @@ -1,5 +1,5 @@ using System; -using System.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Styles { diff --git a/src/Comet/Styles/TextStyle.cs b/src/Comet/Styles/TextStyle.cs index 6560c341..53473445 100644 --- a/src/Comet/Styles/TextStyle.cs +++ b/src/Comet/Styles/TextStyle.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using System.Graphics; + using System.Text; +using Microsoft.Maui.Graphics; namespace Comet.Styles { diff --git a/src/Comet/Styles/ViewStyle.cs b/src/Comet/Styles/ViewStyle.cs index ba5956b8..93db614a 100644 --- a/src/Comet/Styles/ViewStyle.cs +++ b/src/Comet/Styles/ViewStyle.cs @@ -1,6 +1,7 @@ using System; -using System.Graphics; + using Comet.Graphics; +using Microsoft.Maui.Graphics; namespace Comet.Styles {