diff --git a/.editorconfig b/.editorconfig index 6ec408421b09..184e44b0bd10 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,6 +19,10 @@ indent_size = 2 [*.cs] indent_style = tab +# TODO: Disable platform compatibility analyzer until all CA1416 violations are fixed +# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1416 +dotnet_diagnostic.CA1416.severity = none + # Modifier preferences dotnet_style_require_accessibility_modifiers = never:suggestion diff --git a/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets b/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets index dbde4aba4ed6..1008f09bfefd 100644 --- a/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets +++ b/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets @@ -1,41 +1,47 @@ - - - - + + + + - - + + - - + + - - - - + + + + - - + + - - + + + + - + + + + + Platform\Windows\ @@ -64,7 +70,6 @@ $(DefineConstants);MACCATALYST;IOS - false @@ -73,12 +78,19 @@ + + + + 10.0.17763.0 win10-x86;win10-x64;win10-arm64 WINDOWS;$(DefineConstants) + + WINDOWS_UWP;$(DefineConstants) + diff --git a/.nuspec/Microsoft.Maui.Resizetizer.targets b/.nuspec/Microsoft.Maui.Resizetizer.targets index 00072c9fa2d2..ea80880dfee4 100644 --- a/.nuspec/Microsoft.Maui.Resizetizer.targets +++ b/.nuspec/Microsoft.Maui.Resizetizer.targets @@ -32,14 +32,18 @@ AssemblyFile="$(_ResizetizerTaskAssemblyName)" TaskName="Microsoft.Maui.Resizetizer.GenerateSplashStoryboard" /> + + $(CleanDependsOn); _CleanResizetizer; - <_ResizetizerInputsFile>$(IntermediateOutputPath)resizetizer.inputs - <_ResizetizerStampFile>$(IntermediateOutputPath)resizetizer.stamp + <_ResizetizerInputsFile>$(IntermediateOutputPath)mauiimage.inputs + <_ResizetizerStampFile>$(IntermediateOutputPath)mauiimage.stamp <_MauiFontInputsFile>$(IntermediateOutputPath)mauifont.inputs <_MauiFontStampFile>$(IntermediateOutputPath)mauifont.stamp <_MauiSplashInputsFile>$(IntermediateOutputPath)mauisplash.inputs @@ -79,6 +83,7 @@ $(ResizetizeDependsOnTargets); ResizetizeCollectItems; + ProcessMauiSplashScreens; $(ProcessMauiFontsDependsOnTargets); @@ -166,7 +171,7 @@ - + @@ -246,15 +251,19 @@ - - - - - - - - - + + <_MauiAssetFolderName>Assets + <_MauiAssetItemMetadata>TargetPath + + + + + + + + true + true + true net6.0-ios;net6.0-maccatalyst;net6.0-android net6.0-windows10.0.18362 $(MauiPlatforms);$(WindowsTargetFramework) $(WindowsTargetFramework) + net6.0-android + + + Xamarin.iOS10;MonoAndroid10.0 + netstandard2.0;netstandard2.1;Xamarin.iOS10;MonoAndroid90;MonoAndroid10.0;tizen40;Xamarin.Mac20; + $(NonNet6EssentialsPlatforms);uap10.0.16299; + + false + true + Xamarin.iOS10 + netstandard2.0;netstandard2.1;Xamarin.iOS10 + + false + MonoAndroid10.0 + netstandard2.0;netstandard2.1;MonoAndroid10.0 + snupkg + + + + + $(MSBuildThisFileDirectory)bin/ + $(DotNetOutputPath)temp/ + $(DotNetOutputPath)dotnet/ + $(DotNetDirectory)dotnet + $(DotNetDirectory)packs/ + $(DotNetDirectory)sdk-manifests/$(DotNetPreviewVersionBand)/ <_MauiBuildTasksLocation>$(_MauiBuildTasksLocation) <_MauiBuildTasksLocation Condition="'$(_MauiBuildTasksLocation)' == ''">$(MSBuildThisFileDirectory).nuspec\ true diff --git a/Directory.Build.targets b/Directory.Build.targets index ddf229a497b9..2115a542b396 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -3,4 +3,17 @@ - + + + + false + + + + + UAP + <_SupportEmbedFileResources>true + <_EmbedFileResfilePath>$(IntermediateOutputPath)$(AppxSubfolderWithFilesToBeEmbedded)\embed.resfiles + + + \ No newline at end of file diff --git a/GitInfo.txt b/GitInfo.txt index c6c5412ec7c2..554a08ec4b82 100644 --- a/GitInfo.txt +++ b/GitInfo.txt @@ -1 +1 @@ -6.0.100-preview.3 +6.0.100-ci.main diff --git a/Microsoft.Maui-net6.sln b/Microsoft.Maui-net6.sln index e0ebda8da5e3..315d123b65b1 100644 --- a/Microsoft.Maui-net6.sln +++ b/Microsoft.Maui-net6.sln @@ -66,7 +66,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlazorWebView", "BlazorWebView", "{1614D1A4-5C3D-4D5B-8C89-426E37A564EF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "core", "src\BlazorWebView\src\core\Microsoft.AspNetCore.Components.WebView.Maui.csproj", "{F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView.Maui", "src\BlazorWebView\src\core\Microsoft.AspNetCore.Components.WebView.Maui.csproj", "{F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Core.Design-net6", "src\Controls\src\Core.Design\Controls.Core.Design-net6.csproj", "{F2A419ED-B18E-4075-9969-536C2EC67F82}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.Design-net6", "src\Controls\src\Xaml.Design\Controls.Xaml.Design-net6.csproj", "{F9AEE4C0-9E67-4B87-932E-26EDF0FC932A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -149,6 +153,14 @@ Global {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}.Release|Any CPU.Build.0 = Release|Any CPU + {F2A419ED-B18E-4075-9969-536C2EC67F82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2A419ED-B18E-4075-9969-536C2EC67F82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2A419ED-B18E-4075-9969-536C2EC67F82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2A419ED-B18E-4075-9969-536C2EC67F82}.Release|Any CPU.Build.0 = Release|Any CPU + {F9AEE4C0-9E67-4B87-932E-26EDF0FC932A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9AEE4C0-9E67-4B87-932E-26EDF0FC932A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9AEE4C0-9E67-4B87-932E-26EDF0FC932A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9AEE4C0-9E67-4B87-932E-26EDF0FC932A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -175,6 +187,8 @@ Global {C564DDD6-DE79-45CD-88EA-3F690481572A} = {09C264E9-E3F3-4586-9151-DCBB1F6DA7AB} {50C758FE-4E10-409A-94F5-A75480960864} = {459BF674-83CB-46F6-881F-A2D2117DBF4D} {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7} = {1614D1A4-5C3D-4D5B-8C89-426E37A564EF} + {F2A419ED-B18E-4075-9969-536C2EC67F82} = {50C758FE-4E10-409A-94F5-A75480960864} + {F9AEE4C0-9E67-4B87-932E-26EDF0FC932A} = {50C758FE-4E10-409A-94F5-A75480960864} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50} diff --git a/Microsoft.Maui.Droid.sln b/Microsoft.Maui.Droid.sln new file mode 100644 index 000000000000..2709a258012f --- /dev/null +++ b/Microsoft.Maui.Droid.sln @@ -0,0 +1,159 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30926.220 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core-net6", "src\Core\src\Core-net6.csproj", "{95BA42B5-B00E-4986-B9B5-517140378452}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{449F6071-A74F-4309-8D7B-7038CFD1B17B}" + ProjectSection(SolutionItems) = preProject + .nuspec\Microsoft.Maui.Controls.MultiTargeting.targets = .nuspec\Microsoft.Maui.Controls.MultiTargeting.targets + README.md = README.md + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Core-net6", "src\Controls\src\Core\Controls.Core-net6.csproj", "{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Compatibility-net6", "src\Compatibility\Core\src\Compatibility-net6.csproj", "{00A11C2F-969F-4964-8557-91ADF4B1523D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Compatibility.Android.FormsViewGroup-net6", "src\Compatibility\Core\src\Android.FormsViewGroup\Compatibility.Android.FormsViewGroup-net6.csproj", "{EB956381-F3E6-437C-9069-36B8BF5C6E2F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controls", "Controls", "{459BF674-83CB-46F6-881F-A2D2117DBF4D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E1082E26-D700-4127-9329-66D673FD2D55}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample-net6", "src\Controls\samples\Controls.Sample\Maui.Controls.Sample-net6.csproj", "{B8DC1324-977C-46F1-B697-9064ADE6099A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample.Droid-net6", "src\Controls\samples\Controls.Sample.Droid\Maui.Controls.Sample.Droid-net6.csproj", "{BE50FAEF-4096-48B5-B9CE-EE0C38F15A18}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{123AA89E-1638-4E0E-B828-B8F9F9F906A2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{09C264E9-E3F3-4586-9151-DCBB1F6DA7AB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Build.Tasks-net6", "src\Controls\src\Build.Tasks\Controls.Build.Tasks-net6.csproj", "{75C380E0-CE53-4C01-B89F-CF685331DE18}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Essentials", "Essentials", "{94F3C036-A5F4-4ACC-A028-8506802ADB88}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Essentials-net6", "src\Essentials\src\Essentials-net6.csproj", "{39B47A3C-21CA-4B28-9250-14FD957EB0FC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SingleProject", "SingleProject", "{D5478E0A-5D9C-4C1F-980C-7A9FC71F925E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Resizetizer", "src\SingleProject\Resizetizer\src\Resizetizer.csproj", "{9909F93F-C085-4F76-B92A-5D8C516BF47D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Package-net6", "src\Package\Package-net6.csproj", "{5BEB3326-79B4-438C-BF65-274202F387EC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml-net6", "src\Controls\src\Xaml\Controls.Xaml-net6.csproj", "{CC3D4667-D94E-4276-9311-6439BFD075E4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Templates", "src\Templates\src\Microsoft.Maui.Templates.csproj", "{DAAC2822-63B6-4DE0-83AE-04873CD2F364}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestUtils", "TestUtils", "{6998CAA1-11D4-46B2-B80F-0AC882F58124}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils", "src\TestUtils\TestUtils\src\TestUtils.csproj", "{FBB3270F-1924-4A72-845E-A6DF39C402F6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.UnitTests", "src\Core\tests\UnitTests\Core.UnitTests.csproj", "{92644F6F-5946-48FC-A21A-A3D6EE24E8B3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E8AD265B-3C67-4640-AC58-A522F9FB3361}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C564DDD6-DE79-45CD-88EA-3F690481572A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{50C758FE-4E10-409A-94F5-A75480960864}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{72397ADB-40A8-4B8E-8E08-2DBE2803C845}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlazorWebView", "BlazorWebView", "{1614D1A4-5C3D-4D5B-8C89-426E37A564EF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView.Maui", "src\BlazorWebView\src\core\Microsoft.AspNetCore.Components.WebView.Maui.csproj", "{F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {95BA42B5-B00E-4986-B9B5-517140378452}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95BA42B5-B00E-4986-B9B5-517140378452}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95BA42B5-B00E-4986-B9B5-517140378452}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95BA42B5-B00E-4986-B9B5-517140378452}.Release|Any CPU.Build.0 = Release|Any CPU + {AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Release|Any CPU.Build.0 = Release|Any CPU + {00A11C2F-969F-4964-8557-91ADF4B1523D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00A11C2F-969F-4964-8557-91ADF4B1523D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00A11C2F-969F-4964-8557-91ADF4B1523D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00A11C2F-969F-4964-8557-91ADF4B1523D}.Release|Any CPU.Build.0 = Release|Any CPU + {EB956381-F3E6-437C-9069-36B8BF5C6E2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB956381-F3E6-437C-9069-36B8BF5C6E2F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB956381-F3E6-437C-9069-36B8BF5C6E2F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB956381-F3E6-437C-9069-36B8BF5C6E2F}.Release|Any CPU.Build.0 = Release|Any CPU + {B8DC1324-977C-46F1-B697-9064ADE6099A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8DC1324-977C-46F1-B697-9064ADE6099A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8DC1324-977C-46F1-B697-9064ADE6099A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8DC1324-977C-46F1-B697-9064ADE6099A}.Release|Any CPU.Build.0 = Release|Any CPU + {BE50FAEF-4096-48B5-B9CE-EE0C38F15A18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE50FAEF-4096-48B5-B9CE-EE0C38F15A18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE50FAEF-4096-48B5-B9CE-EE0C38F15A18}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {BE50FAEF-4096-48B5-B9CE-EE0C38F15A18}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE50FAEF-4096-48B5-B9CE-EE0C38F15A18}.Release|Any CPU.Build.0 = Release|Any CPU + {75C380E0-CE53-4C01-B89F-CF685331DE18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {75C380E0-CE53-4C01-B89F-CF685331DE18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75C380E0-CE53-4C01-B89F-CF685331DE18}.Release|Any CPU.ActiveCfg = Release|Any CPU + {75C380E0-CE53-4C01-B89F-CF685331DE18}.Release|Any CPU.Build.0 = Release|Any CPU + {39B47A3C-21CA-4B28-9250-14FD957EB0FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39B47A3C-21CA-4B28-9250-14FD957EB0FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39B47A3C-21CA-4B28-9250-14FD957EB0FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39B47A3C-21CA-4B28-9250-14FD957EB0FC}.Release|Any CPU.Build.0 = Release|Any CPU + {9909F93F-C085-4F76-B92A-5D8C516BF47D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9909F93F-C085-4F76-B92A-5D8C516BF47D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9909F93F-C085-4F76-B92A-5D8C516BF47D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9909F93F-C085-4F76-B92A-5D8C516BF47D}.Release|Any CPU.Build.0 = Release|Any CPU + {5BEB3326-79B4-438C-BF65-274202F387EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5BEB3326-79B4-438C-BF65-274202F387EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5BEB3326-79B4-438C-BF65-274202F387EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5BEB3326-79B4-438C-BF65-274202F387EC}.Release|Any CPU.Build.0 = Release|Any CPU + {CC3D4667-D94E-4276-9311-6439BFD075E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC3D4667-D94E-4276-9311-6439BFD075E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC3D4667-D94E-4276-9311-6439BFD075E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC3D4667-D94E-4276-9311-6439BFD075E4}.Release|Any CPU.Build.0 = Release|Any CPU + {DAAC2822-63B6-4DE0-83AE-04873CD2F364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DAAC2822-63B6-4DE0-83AE-04873CD2F364}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DAAC2822-63B6-4DE0-83AE-04873CD2F364}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DAAC2822-63B6-4DE0-83AE-04873CD2F364}.Release|Any CPU.Build.0 = Release|Any CPU + {FBB3270F-1924-4A72-845E-A6DF39C402F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBB3270F-1924-4A72-845E-A6DF39C402F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBB3270F-1924-4A72-845E-A6DF39C402F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBB3270F-1924-4A72-845E-A6DF39C402F6}.Release|Any CPU.Build.0 = Release|Any CPU + {92644F6F-5946-48FC-A21A-A3D6EE24E8B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92644F6F-5946-48FC-A21A-A3D6EE24E8B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92644F6F-5946-48FC-A21A-A3D6EE24E8B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92644F6F-5946-48FC-A21A-A3D6EE24E8B3}.Release|Any CPU.Build.0 = Release|Any CPU + {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {95BA42B5-B00E-4986-B9B5-517140378452} = {E8AD265B-3C67-4640-AC58-A522F9FB3361} + {AF64451F-E2BD-41C2-B083-F60C26AE2A9F} = {50C758FE-4E10-409A-94F5-A75480960864} + {00A11C2F-969F-4964-8557-91ADF4B1523D} = {123AA89E-1638-4E0E-B828-B8F9F9F906A2} + {EB956381-F3E6-437C-9069-36B8BF5C6E2F} = {123AA89E-1638-4E0E-B828-B8F9F9F906A2} + {E1082E26-D700-4127-9329-66D673FD2D55} = {459BF674-83CB-46F6-881F-A2D2117DBF4D} + {B8DC1324-977C-46F1-B697-9064ADE6099A} = {E1082E26-D700-4127-9329-66D673FD2D55} + {BE50FAEF-4096-48B5-B9CE-EE0C38F15A18} = {E1082E26-D700-4127-9329-66D673FD2D55} + {75C380E0-CE53-4C01-B89F-CF685331DE18} = {50C758FE-4E10-409A-94F5-A75480960864} + {39B47A3C-21CA-4B28-9250-14FD957EB0FC} = {94F3C036-A5F4-4ACC-A028-8506802ADB88} + {9909F93F-C085-4F76-B92A-5D8C516BF47D} = {D5478E0A-5D9C-4C1F-980C-7A9FC71F925E} + {CC3D4667-D94E-4276-9311-6439BFD075E4} = {50C758FE-4E10-409A-94F5-A75480960864} + {DAAC2822-63B6-4DE0-83AE-04873CD2F364} = {72397ADB-40A8-4B8E-8E08-2DBE2803C845} + {FBB3270F-1924-4A72-845E-A6DF39C402F6} = {6998CAA1-11D4-46B2-B80F-0AC882F58124} + {92644F6F-5946-48FC-A21A-A3D6EE24E8B3} = {C564DDD6-DE79-45CD-88EA-3F690481572A} + {E8AD265B-3C67-4640-AC58-A522F9FB3361} = {09C264E9-E3F3-4586-9151-DCBB1F6DA7AB} + {C564DDD6-DE79-45CD-88EA-3F690481572A} = {09C264E9-E3F3-4586-9151-DCBB1F6DA7AB} + {50C758FE-4E10-409A-94F5-A75480960864} = {459BF674-83CB-46F6-881F-A2D2117DBF4D} + {F7F2B379-52CE-4802-9EC9-0D7967B6BFB7} = {1614D1A4-5C3D-4D5B-8C89-426E37A564EF} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50} + EndGlobalSection +EndGlobal diff --git a/Microsoft.Maui.iOS.sln b/Microsoft.Maui.iOS.sln new file mode 100644 index 000000000000..30a61733db1c --- /dev/null +++ b/Microsoft.Maui.iOS.sln @@ -0,0 +1,979 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30503.244 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controls", "Controls", "{9AD757F5-E57A-459D-A0A7-E0675E045B84}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{29AC50BF-B4FB-450B-9386-0C5AD4B84226}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuspec", ".nuspec", "{7E12C50D-A570-4DF1-94E1-8599843FA87C}" + ProjectSection(SolutionItems) = preProject + eng\dogfood.ps1 = eng\dogfood.ps1 + .nuspec\Microsoft.Maui.Controls.Compatibility.AppLinks.nuspec = .nuspec\Microsoft.Maui.Controls.Compatibility.AppLinks.nuspec + .nuspec\Microsoft.Maui.Controls.Compatibility.GTK.nuspec = .nuspec\Microsoft.Maui.Controls.Compatibility.GTK.nuspec + .nuspec\Microsoft.Maui.Controls.Compatibility.Maps.GTK.nuspec = .nuspec\Microsoft.Maui.Controls.Compatibility.Maps.GTK.nuspec + .nuspec\Microsoft.Maui.Controls.Compatibility.Maps.nuspec = .nuspec\Microsoft.Maui.Controls.Compatibility.Maps.nuspec + .nuspec\Microsoft.Maui.Controls.Compatibility.Maps.WPF.nuspec = .nuspec\Microsoft.Maui.Controls.Compatibility.Maps.WPF.nuspec + .nuspec\Microsoft.Maui.Controls.Compatibility.Visual.Material.nuspec = .nuspec\Microsoft.Maui.Controls.Compatibility.Visual.Material.nuspec + .nuspec\Microsoft.Maui.Controls.Compatibility.Visual.Material.targets = .nuspec\Microsoft.Maui.Controls.Compatibility.Visual.Material.targets + .nuspec\Microsoft.Maui.Controls.Compatibility.WPF.nuspec = .nuspec\Microsoft.Maui.Controls.Compatibility.WPF.nuspec + .nuspec\Microsoft.Maui.Controls.Debug.targets = .nuspec\Microsoft.Maui.Controls.Debug.targets + .nuspec\Microsoft.Maui.Controls.DefaultItems.props = .nuspec\Microsoft.Maui.Controls.DefaultItems.props + .nuspec\Microsoft.Maui.Controls.DefaultItems.targets = .nuspec\Microsoft.Maui.Controls.DefaultItems.targets + .nuspec\Microsoft.Maui.Controls.DualScreen.nuspec = .nuspec\Microsoft.Maui.Controls.DualScreen.nuspec + .nuspec\Microsoft.Maui.Controls.MultiTargeting.targets = .nuspec\Microsoft.Maui.Controls.MultiTargeting.targets + .nuspec\Microsoft.Maui.Controls.nuspec = .nuspec\Microsoft.Maui.Controls.nuspec + .nuspec\Microsoft.Maui.Controls.props = .nuspec\Microsoft.Maui.Controls.props + .nuspec\Microsoft.Maui.Controls.SingleProject.props = .nuspec\Microsoft.Maui.Controls.SingleProject.props + .nuspec\Microsoft.Maui.Controls.SingleProject.targets = .nuspec\Microsoft.Maui.Controls.SingleProject.targets + .nuspec\Microsoft.Maui.Controls.targets = .nuspec\Microsoft.Maui.Controls.targets + .nuspec\Microsoft.Maui.Resizetizer.targets = .nuspec\Microsoft.Maui.Resizetizer.targets + eng\package.ps1 = eng\package.ps1 + .nuspec\proguard.cfg = .nuspec\proguard.cfg + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Core", "src\Controls\src\Core\Controls.Core.csproj", "{57B8B73D-C3B5-4C42-869E-7B2F17D354AC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{31721EFD-3238-462B-B501-41F3D2B50E92}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controls", "Controls", "{97FA536A-675D-41C7-A90E-97E2F79D1AE2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{423C21C8-84CB-4A3C-BEB9-1C23D752D90F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2ACC7FFA-238F-44FD-93CB-4D9B17D8C4BA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "src\Core\src\Core.csproj", "{29913989-0F70-48D8-8EDE-B1DD217F21D1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compatibility.iOS", "src\Compatibility\Core\src\iOS\Compatibility.iOS.csproj", "{271193C1-6E7C-429C-A36D-3F1BE5267231}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D5B986A3-7FC9-437E-8030-349AA4698DFD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{75A2CD30-BB85-4CA6-AC95-86A8A538A690}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Core.UnitTests", "src\Controls\tests\Core.UnitTests\Controls.Core.UnitTests.csproj", "{00259593-A283-47A5-ACB7-9C3819B16364}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml", "src\Controls\src\Xaml\Controls.Xaml.csproj", "{BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Build.Tasks", "src\Controls\src\Build.Tasks\Controls.Build.Tasks.csproj", "{C328C538-B69F-43D2-80EE-3C1EB8254CBA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.UnitTests", "src\Core\tests\UnitTests\Core.UnitTests.csproj", "{7A753001-1C3D-404D-A421-2E052A545EAC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.DeviceTests", "src\Core\tests\DeviceTests\Core.DeviceTests.csproj", "{DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.DeviceTests.Android", "src\Core\tests\DeviceTests.Android\Core.DeviceTests.Android.csproj", "{A0B8D99F-4C0E-4D47-8182-9E8879A9B105}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.DeviceTests.iOS", "src\Core\tests\DeviceTests.iOS\Core.DeviceTests.iOS.csproj", "{EE8FC716-27FC-405B-BD27-AF17E01A6671}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Essentials", "Essentials", "{DFD73007-5DB1-43AD-87A8-BD8622C2B192}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7E12E071-51C0-4668-9FF3-E2DE9DC51962}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Essentials", "src\Essentials\src\Essentials.csproj", "{8CB95D25-8442-42BC-82BE-319D21138549}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{99FDF6CA-DCF8-4CB2-B2EA-E24CCB601232}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Essentials.UnitTests", "src\Essentials\test\UnitTests\Essentials.UnitTests.csproj", "{2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials.DeviceTests.iOS", "src\Essentials\test\DeviceTests.iOS\Essentials.DeviceTests.iOS.csproj", "{B73EB308-70BE-49FD-91A7-1D1495663D6D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Essentials.DeviceTests.Shared", "src\Essentials\test\DeviceTests.Shared\Essentials.DeviceTests.Shared.csproj", "{81128D28-CFC8-4EA4-B68D-9939339C461A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{5817A848-0B04-4035-9F7E-B8621B61CBDD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials.Samples.iOS", "src\Essentials\samples\Samples.iOS\Essentials.Samples.iOS.csproj", "{AB6242B7-634F-4839-A991-7629D0D2C636}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Essentials.Samples", "src\Essentials\samples\Samples\Essentials.Samples.csproj", "{2C69EB76-02C4-4921-96A1-4D70CB7CE744}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Essentials.Sample.Server.WebAuthenticator", "src\Essentials\samples\Sample.Server.WebAuthenticator\Essentials.Sample.Server.WebAuthenticator.csproj", "{0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Benchmarks", "src\Core\tests\Benchmarks\Core.Benchmarks.csproj", "{73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{806499EB-C2CC-4E85-BC19-613F3DE5E0C3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Sample", "src\Controls\samples\Controls.Sample\Controls.Sample.csproj", "{90B727DD-4C7B-4462-950F-61842A87DE8A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controls.Sample.iOS", "src\Controls\samples\Controls.Sample.iOS\Controls.Sample.iOS.csproj", "{D51AD52D-C4C6-445A-BD0F-884BE5C1C526}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Maps", "src\Controls\Maps\src\Controls.Maps.csproj", "{F2379E0F-524F-47BC-877C-0428E4C836D4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests", "src\Controls\tests\Xaml.UnitTests\Controls.Xaml.UnitTests.csproj", "{F905B72C-4DF7-408B-8B2B-50F9B8246A5E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestUtils", "TestUtils", "{0F9BA970-11B1-4ACA-AF41-1021AFC0F29C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils", "src\TestUtils\TestUtils\src\TestUtils.csproj", "{E4CB9988-7348-4D55-A08E-85907732F8DA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils.DeviceTests", "src\TestUtils\TestUtils.DeviceTests\src\TestUtils.DeviceTests.csproj", "{551B2209-4298-4D60-B55C-79077B8BC244}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Resizetizer", "Resizetizer", "{4A3BAF64-E9D9-4036-9FDA-8B326C382667}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F83AC93C-9694-4A01-B9CB-7AA8E514B01F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{08F720FF-7530-43BF-A252-8946927669E3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Resizetizer", "src\SingleProject\Resizetizer\src\Resizetizer.csproj", "{3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Resizetizer.UnitTests", "src\SingleProject\Resizetizer\test\UnitTests\Resizetizer.UnitTests.csproj", "{BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SingleProject", "SingleProject", "{15878D2D-B0F1-4EE9-875D-4A643DB0C842}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.CustomAttributes", "src\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj", "{D816B818-F58F-4738-93AE-924EFAB7A07F}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Compatibility.ControlGallery.Issues.Shared", "src\Compatibility\ControlGallery\src\Issues.Shared\Compatibility.ControlGallery.Issues.Shared.shproj", "{AE2513CB-4E5E-4E5C-8237-88954D4C9433}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Compatibility.ControlGallery.Core", "src\Compatibility\ControlGallery\src\Core\Compatibility.ControlGallery.Core.csproj", "{B5F94CCB-5868-43BD-89B5-B66C97C3A741}" +EndProject +Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + src\Compatibility\ControlGallery\src\Issues.Shared\Compatibility.ControlGallery.Issues.Shared.projitems*{ae2513cb-4e5e-4e5c-8237-88954d4c9433}*SharedItemsImports = 13 + src\Compatibility\ControlGallery\src\Issues.Shared\Compatibility.ControlGallery.Issues.Shared.projitems*{b5f94ccb-5868-43bd-89b5-b66c97c3a741}*SharedItemsImports = 5 + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|iPhone = Debug|iPhone + Debug|iPhoneSimulator = Debug|iPhoneSimulator + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|iPhone = Release|iPhone + Release|iPhoneSimulator = Release|iPhoneSimulator + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|ARM.ActiveCfg = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|ARM.Build.0 = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|ARM64.Build.0 = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|iPhone.Build.0 = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|x64.ActiveCfg = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|x64.Build.0 = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|x86.ActiveCfg = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|x86.Build.0 = Debug|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|Any CPU.Build.0 = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|ARM.ActiveCfg = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|ARM.Build.0 = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|ARM64.ActiveCfg = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|ARM64.Build.0 = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|iPhone.ActiveCfg = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|iPhone.Build.0 = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|x64.ActiveCfg = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|x64.Build.0 = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|x86.ActiveCfg = Release|Any CPU + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Release|x86.Build.0 = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|ARM.ActiveCfg = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|ARM.Build.0 = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|ARM64.Build.0 = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|iPhone.Build.0 = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|x64.ActiveCfg = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|x64.Build.0 = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|x86.ActiveCfg = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Debug|x86.Build.0 = Debug|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|Any CPU.Build.0 = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|ARM.ActiveCfg = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|ARM.Build.0 = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|ARM64.ActiveCfg = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|ARM64.Build.0 = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|iPhone.ActiveCfg = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|iPhone.Build.0 = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|x64.ActiveCfg = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|x64.Build.0 = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|x86.ActiveCfg = Release|Any CPU + {29913989-0F70-48D8-8EDE-B1DD217F21D1}.Release|x86.Build.0 = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|Any CPU.Build.0 = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|ARM.ActiveCfg = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|ARM.Build.0 = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|ARM64.Build.0 = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|iPhone.Build.0 = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|x64.ActiveCfg = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|x64.Build.0 = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|x86.ActiveCfg = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Debug|x86.Build.0 = Debug|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|Any CPU.ActiveCfg = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|Any CPU.Build.0 = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|ARM.ActiveCfg = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|ARM.Build.0 = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|ARM64.ActiveCfg = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|ARM64.Build.0 = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|iPhone.ActiveCfg = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|iPhone.Build.0 = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|x64.ActiveCfg = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|x64.Build.0 = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|x86.ActiveCfg = Release|Any CPU + {271193C1-6E7C-429C-A36D-3F1BE5267231}.Release|x86.Build.0 = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|ARM.ActiveCfg = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|ARM.Build.0 = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|ARM64.Build.0 = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|iPhone.Build.0 = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|x64.ActiveCfg = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|x64.Build.0 = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|x86.ActiveCfg = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Debug|x86.Build.0 = Debug|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|Any CPU.Build.0 = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|ARM.ActiveCfg = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|ARM.Build.0 = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|ARM64.ActiveCfg = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|ARM64.Build.0 = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|iPhone.ActiveCfg = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|iPhone.Build.0 = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|x64.ActiveCfg = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|x64.Build.0 = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|x86.ActiveCfg = Release|Any CPU + {00259593-A283-47A5-ACB7-9C3819B16364}.Release|x86.Build.0 = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|ARM.ActiveCfg = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|ARM.Build.0 = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|ARM64.Build.0 = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|iPhone.Build.0 = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|x64.ActiveCfg = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|x64.Build.0 = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|x86.ActiveCfg = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Debug|x86.Build.0 = Debug|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|Any CPU.Build.0 = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|ARM.ActiveCfg = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|ARM.Build.0 = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|ARM64.ActiveCfg = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|ARM64.Build.0 = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|iPhone.ActiveCfg = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|iPhone.Build.0 = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|x64.ActiveCfg = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|x64.Build.0 = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|x86.ActiveCfg = Release|Any CPU + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27}.Release|x86.Build.0 = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|ARM.ActiveCfg = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|ARM.Build.0 = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|ARM64.Build.0 = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|iPhone.Build.0 = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|x64.ActiveCfg = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|x64.Build.0 = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|x86.ActiveCfg = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Debug|x86.Build.0 = Debug|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|Any CPU.Build.0 = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|ARM.ActiveCfg = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|ARM.Build.0 = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|ARM64.ActiveCfg = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|ARM64.Build.0 = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|iPhone.ActiveCfg = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|iPhone.Build.0 = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|x64.ActiveCfg = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|x64.Build.0 = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|x86.ActiveCfg = Release|Any CPU + {C328C538-B69F-43D2-80EE-3C1EB8254CBA}.Release|x86.Build.0 = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|ARM.Build.0 = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|ARM64.Build.0 = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|iPhone.Build.0 = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|x64.ActiveCfg = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|x64.Build.0 = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|x86.ActiveCfg = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Debug|x86.Build.0 = Debug|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|Any CPU.Build.0 = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|ARM.ActiveCfg = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|ARM.Build.0 = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|ARM64.ActiveCfg = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|ARM64.Build.0 = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|iPhone.ActiveCfg = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|iPhone.Build.0 = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|x64.ActiveCfg = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|x64.Build.0 = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|x86.ActiveCfg = Release|Any CPU + {7A753001-1C3D-404D-A421-2E052A545EAC}.Release|x86.Build.0 = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|ARM.ActiveCfg = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|ARM.Build.0 = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|ARM64.Build.0 = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|iPhone.Build.0 = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|x64.ActiveCfg = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|x64.Build.0 = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|x86.ActiveCfg = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Debug|x86.Build.0 = Debug|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|Any CPU.Build.0 = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|ARM.ActiveCfg = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|ARM.Build.0 = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|ARM64.ActiveCfg = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|ARM64.Build.0 = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|iPhone.ActiveCfg = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|iPhone.Build.0 = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|x64.ActiveCfg = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|x64.Build.0 = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|x86.ActiveCfg = Release|Any CPU + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6}.Release|x86.Build.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|ARM.ActiveCfg = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|ARM.Build.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|ARM.Deploy.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|ARM64.Build.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|ARM64.Deploy.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|iPhone.Build.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|iPhone.Deploy.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|x64.ActiveCfg = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|x64.Build.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|x64.Deploy.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|x86.ActiveCfg = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|x86.Build.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Debug|x86.Deploy.0 = Debug|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|Any CPU.Build.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|Any CPU.Deploy.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|ARM.ActiveCfg = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|ARM.Build.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|ARM.Deploy.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|ARM64.ActiveCfg = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|ARM64.Build.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|ARM64.Deploy.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|iPhone.ActiveCfg = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|iPhone.Build.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|iPhone.Deploy.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|x64.ActiveCfg = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|x64.Build.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|x64.Deploy.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|x86.ActiveCfg = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|x86.Build.0 = Release|Any CPU + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105}.Release|x86.Deploy.0 = Release|Any CPU + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|ARM.Build.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|ARM64.ActiveCfg = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|ARM64.Build.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|iPhone.ActiveCfg = Debug|iPhone + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|iPhone.Build.0 = Debug|iPhone + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|iPhone.Deploy.0 = Debug|iPhone + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|iPhoneSimulator.Deploy.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|x64.Build.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|x64.Deploy.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|x86.Build.0 = Debug|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|Any CPU.Build.0 = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|ARM.ActiveCfg = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|ARM.Build.0 = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|ARM64.ActiveCfg = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|ARM64.Build.0 = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|iPhone.ActiveCfg = Release|iPhone + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|iPhone.Build.0 = Release|iPhone + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|x64.ActiveCfg = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|x64.Build.0 = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|x86.ActiveCfg = Release|iPhoneSimulator + {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|x86.Build.0 = Release|iPhoneSimulator + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|ARM.ActiveCfg = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|ARM.Build.0 = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|ARM64.Build.0 = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|iPhone.Build.0 = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|x64.ActiveCfg = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|x64.Build.0 = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|x86.ActiveCfg = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Debug|x86.Build.0 = Debug|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|Any CPU.Build.0 = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|ARM.ActiveCfg = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|ARM.Build.0 = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|ARM64.ActiveCfg = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|ARM64.Build.0 = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|iPhone.ActiveCfg = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|iPhone.Build.0 = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|x64.ActiveCfg = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|x64.Build.0 = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|x86.ActiveCfg = Release|Any CPU + {8CB95D25-8442-42BC-82BE-319D21138549}.Release|x86.Build.0 = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|ARM.ActiveCfg = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|ARM.Build.0 = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|ARM64.Build.0 = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|iPhone.Build.0 = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|x64.ActiveCfg = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|x64.Build.0 = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|x86.ActiveCfg = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Debug|x86.Build.0 = Debug|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|Any CPU.Build.0 = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|ARM.ActiveCfg = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|ARM.Build.0 = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|ARM64.ActiveCfg = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|ARM64.Build.0 = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|iPhone.ActiveCfg = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|iPhone.Build.0 = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|x64.ActiveCfg = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|x64.Build.0 = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|x86.ActiveCfg = Release|Any CPU + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886}.Release|x86.Build.0 = Release|Any CPU + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|ARM64.ActiveCfg = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|iPhone.ActiveCfg = Debug|iPhone + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|iPhone.Build.0 = Debug|iPhone + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|iPhone.Deploy.0 = Debug|iPhone + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|x64.Build.0 = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|x64.Deploy.0 = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|ARM.ActiveCfg = Release|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|ARM64.ActiveCfg = Release|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|iPhone.ActiveCfg = Release|iPhone + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|iPhone.Build.0 = Release|iPhone + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|x64.ActiveCfg = Release|iPhoneSimulator + {B73EB308-70BE-49FD-91A7-1D1495663D6D}.Release|x86.ActiveCfg = Release|iPhoneSimulator + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|ARM.ActiveCfg = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|ARM.Build.0 = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|ARM64.Build.0 = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|iPhone.Build.0 = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|x64.ActiveCfg = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|x64.Build.0 = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|x86.ActiveCfg = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Debug|x86.Build.0 = Debug|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|Any CPU.Build.0 = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|ARM.ActiveCfg = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|ARM.Build.0 = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|ARM64.ActiveCfg = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|ARM64.Build.0 = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|iPhone.ActiveCfg = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|iPhone.Build.0 = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|x64.ActiveCfg = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|x64.Build.0 = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|x86.ActiveCfg = Release|Any CPU + {81128D28-CFC8-4EA4-B68D-9939339C461A}.Release|x86.Build.0 = Release|Any CPU + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|ARM64.ActiveCfg = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|iPhone.ActiveCfg = Debug|iPhone + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|iPhone.Build.0 = Debug|iPhone + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|iPhone.Deploy.0 = Debug|iPhone + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|x64.Build.0 = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|x64.Deploy.0 = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|ARM.ActiveCfg = Release|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|ARM64.ActiveCfg = Release|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|iPhone.ActiveCfg = Release|iPhone + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|iPhone.Build.0 = Release|iPhone + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|x64.ActiveCfg = Release|iPhoneSimulator + {AB6242B7-634F-4839-A991-7629D0D2C636}.Release|x86.ActiveCfg = Release|iPhoneSimulator + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|ARM.ActiveCfg = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|ARM.Build.0 = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|ARM64.Build.0 = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|iPhone.Build.0 = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|x64.ActiveCfg = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|x64.Build.0 = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|x86.ActiveCfg = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Debug|x86.Build.0 = Debug|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|Any CPU.Build.0 = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|ARM.ActiveCfg = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|ARM.Build.0 = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|ARM64.ActiveCfg = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|ARM64.Build.0 = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|iPhone.ActiveCfg = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|iPhone.Build.0 = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|x64.ActiveCfg = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|x64.Build.0 = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|x86.ActiveCfg = Release|Any CPU + {2C69EB76-02C4-4921-96A1-4D70CB7CE744}.Release|x86.Build.0 = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|ARM.ActiveCfg = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|ARM.Build.0 = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|ARM64.Build.0 = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|iPhone.Build.0 = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|x64.ActiveCfg = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|x64.Build.0 = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|x86.ActiveCfg = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Debug|x86.Build.0 = Debug|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|Any CPU.Build.0 = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|ARM.ActiveCfg = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|ARM.Build.0 = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|ARM64.ActiveCfg = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|ARM64.Build.0 = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|iPhone.ActiveCfg = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|iPhone.Build.0 = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|x64.ActiveCfg = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|x64.Build.0 = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|x86.ActiveCfg = Release|Any CPU + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C}.Release|x86.Build.0 = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|ARM.ActiveCfg = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|ARM.Build.0 = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|ARM64.Build.0 = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|iPhone.Build.0 = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|x64.ActiveCfg = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|x64.Build.0 = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|x86.ActiveCfg = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Debug|x86.Build.0 = Debug|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|Any CPU.Build.0 = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|ARM.ActiveCfg = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|ARM.Build.0 = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|ARM64.ActiveCfg = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|ARM64.Build.0 = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|iPhone.ActiveCfg = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|iPhone.Build.0 = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|x64.ActiveCfg = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|x64.Build.0 = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|x86.ActiveCfg = Release|Any CPU + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424}.Release|x86.Build.0 = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|ARM.ActiveCfg = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|ARM.Build.0 = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|ARM64.Build.0 = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|iPhone.Build.0 = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|x64.ActiveCfg = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|x64.Build.0 = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|x86.ActiveCfg = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Debug|x86.Build.0 = Debug|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|Any CPU.Build.0 = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|ARM.ActiveCfg = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|ARM.Build.0 = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|ARM64.ActiveCfg = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|ARM64.Build.0 = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|iPhone.ActiveCfg = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|iPhone.Build.0 = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|x64.ActiveCfg = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|x64.Build.0 = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|x86.ActiveCfg = Release|Any CPU + {90B727DD-4C7B-4462-950F-61842A87DE8A}.Release|x86.Build.0 = Release|Any CPU + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|ARM64.ActiveCfg = Debug|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|iPhone.ActiveCfg = Debug|iPhone + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|iPhone.Build.0 = Debug|iPhone + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|ARM.ActiveCfg = Release|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|ARM64.ActiveCfg = Release|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|iPhone.ActiveCfg = Release|iPhone + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|iPhone.Build.0 = Release|iPhone + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|x64.ActiveCfg = Release|iPhoneSimulator + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526}.Release|x86.ActiveCfg = Release|iPhoneSimulator + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|ARM.ActiveCfg = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|ARM.Build.0 = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|ARM64.Build.0 = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|iPhone.Build.0 = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|x64.ActiveCfg = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|x64.Build.0 = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|x86.ActiveCfg = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Debug|x86.Build.0 = Debug|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|Any CPU.Build.0 = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|ARM.ActiveCfg = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|ARM.Build.0 = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|ARM64.ActiveCfg = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|ARM64.Build.0 = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|iPhone.ActiveCfg = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|iPhone.Build.0 = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|x64.ActiveCfg = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|x64.Build.0 = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|x86.ActiveCfg = Release|Any CPU + {F2379E0F-524F-47BC-877C-0428E4C836D4}.Release|x86.Build.0 = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|ARM.ActiveCfg = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|ARM.Build.0 = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|ARM64.Build.0 = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|iPhone.Build.0 = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|x64.ActiveCfg = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|x64.Build.0 = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|x86.ActiveCfg = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Debug|x86.Build.0 = Debug|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|Any CPU.Build.0 = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|ARM.ActiveCfg = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|ARM.Build.0 = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|ARM64.ActiveCfg = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|ARM64.Build.0 = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|iPhone.ActiveCfg = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|iPhone.Build.0 = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|x64.ActiveCfg = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|x64.Build.0 = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|x86.ActiveCfg = Release|Any CPU + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E}.Release|x86.Build.0 = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|ARM.ActiveCfg = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|ARM.Build.0 = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|ARM64.Build.0 = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|iPhone.Build.0 = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|x64.ActiveCfg = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|x64.Build.0 = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|x86.ActiveCfg = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Debug|x86.Build.0 = Debug|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|Any CPU.Build.0 = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|ARM.ActiveCfg = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|ARM.Build.0 = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|ARM64.ActiveCfg = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|ARM64.Build.0 = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|iPhone.ActiveCfg = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|iPhone.Build.0 = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|x64.ActiveCfg = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|x64.Build.0 = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|x86.ActiveCfg = Release|Any CPU + {E4CB9988-7348-4D55-A08E-85907732F8DA}.Release|x86.Build.0 = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|Any CPU.Build.0 = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|ARM.ActiveCfg = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|ARM.Build.0 = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|ARM64.Build.0 = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|iPhone.Build.0 = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|x64.ActiveCfg = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|x64.Build.0 = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|x86.ActiveCfg = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Debug|x86.Build.0 = Debug|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|Any CPU.ActiveCfg = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|Any CPU.Build.0 = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|ARM.ActiveCfg = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|ARM.Build.0 = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|ARM64.ActiveCfg = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|ARM64.Build.0 = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|iPhone.ActiveCfg = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|iPhone.Build.0 = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|x64.ActiveCfg = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|x64.Build.0 = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|x86.ActiveCfg = Release|Any CPU + {551B2209-4298-4D60-B55C-79077B8BC244}.Release|x86.Build.0 = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|ARM.ActiveCfg = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|ARM.Build.0 = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|ARM64.Build.0 = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|iPhone.Build.0 = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|x64.ActiveCfg = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|x64.Build.0 = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|x86.ActiveCfg = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Debug|x86.Build.0 = Debug|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|Any CPU.Build.0 = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|ARM.ActiveCfg = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|ARM.Build.0 = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|ARM64.ActiveCfg = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|ARM64.Build.0 = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|iPhone.ActiveCfg = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|iPhone.Build.0 = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|x64.ActiveCfg = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|x64.Build.0 = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|x86.ActiveCfg = Release|Any CPU + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C}.Release|x86.Build.0 = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|ARM.ActiveCfg = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|ARM.Build.0 = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|ARM64.Build.0 = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|iPhone.Build.0 = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|x64.ActiveCfg = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|x64.Build.0 = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|x86.ActiveCfg = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Debug|x86.Build.0 = Debug|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|Any CPU.Build.0 = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|ARM.ActiveCfg = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|ARM.Build.0 = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|ARM64.ActiveCfg = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|ARM64.Build.0 = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|iPhone.ActiveCfg = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|iPhone.Build.0 = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|x64.ActiveCfg = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|x64.Build.0 = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|x86.ActiveCfg = Release|Any CPU + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5}.Release|x86.Build.0 = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|ARM.Build.0 = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|ARM64.Build.0 = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|iPhone.Build.0 = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|x64.ActiveCfg = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|x64.Build.0 = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|x86.ActiveCfg = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Debug|x86.Build.0 = Debug|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|Any CPU.Build.0 = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|ARM.ActiveCfg = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|ARM.Build.0 = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|ARM64.ActiveCfg = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|ARM64.Build.0 = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|iPhone.ActiveCfg = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|iPhone.Build.0 = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|x64.ActiveCfg = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|x64.Build.0 = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|x86.ActiveCfg = Release|Any CPU + {D816B818-F58F-4738-93AE-924EFAB7A07F}.Release|x86.Build.0 = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|ARM.ActiveCfg = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|ARM.Build.0 = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|ARM64.Build.0 = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|iPhone.Build.0 = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|x64.ActiveCfg = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|x64.Build.0 = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|x86.ActiveCfg = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Debug|x86.Build.0 = Debug|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|Any CPU.Build.0 = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|ARM.ActiveCfg = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|ARM.Build.0 = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|ARM64.ActiveCfg = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|ARM64.Build.0 = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|iPhone.ActiveCfg = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|iPhone.Build.0 = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|x64.ActiveCfg = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|x64.Build.0 = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|x86.ActiveCfg = Release|Any CPU + {B5F94CCB-5868-43BD-89B5-B66C97C3A741}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {9AD757F5-E57A-459D-A0A7-E0675E045B84} = {97FA536A-675D-41C7-A90E-97E2F79D1AE2} + {29AC50BF-B4FB-450B-9386-0C5AD4B84226} = {97FA536A-675D-41C7-A90E-97E2F79D1AE2} + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC} = {D5B986A3-7FC9-437E-8030-349AA4698DFD} + {423C21C8-84CB-4A3C-BEB9-1C23D752D90F} = {31721EFD-3238-462B-B501-41F3D2B50E92} + {2ACC7FFA-238F-44FD-93CB-4D9B17D8C4BA} = {31721EFD-3238-462B-B501-41F3D2B50E92} + {29913989-0F70-48D8-8EDE-B1DD217F21D1} = {423C21C8-84CB-4A3C-BEB9-1C23D752D90F} + {271193C1-6E7C-429C-A36D-3F1BE5267231} = {29AC50BF-B4FB-450B-9386-0C5AD4B84226} + {D5B986A3-7FC9-437E-8030-349AA4698DFD} = {9AD757F5-E57A-459D-A0A7-E0675E045B84} + {75A2CD30-BB85-4CA6-AC95-86A8A538A690} = {9AD757F5-E57A-459D-A0A7-E0675E045B84} + {00259593-A283-47A5-ACB7-9C3819B16364} = {75A2CD30-BB85-4CA6-AC95-86A8A538A690} + {BB98A559-62C4-4C98-90A0-9E4D8DF1CA27} = {D5B986A3-7FC9-437E-8030-349AA4698DFD} + {C328C538-B69F-43D2-80EE-3C1EB8254CBA} = {D5B986A3-7FC9-437E-8030-349AA4698DFD} + {7A753001-1C3D-404D-A421-2E052A545EAC} = {2ACC7FFA-238F-44FD-93CB-4D9B17D8C4BA} + {DA9E4D76-8CA4-4CC3-A47C-BA75DFF805C6} = {2ACC7FFA-238F-44FD-93CB-4D9B17D8C4BA} + {A0B8D99F-4C0E-4D47-8182-9E8879A9B105} = {2ACC7FFA-238F-44FD-93CB-4D9B17D8C4BA} + {EE8FC716-27FC-405B-BD27-AF17E01A6671} = {2ACC7FFA-238F-44FD-93CB-4D9B17D8C4BA} + {7E12E071-51C0-4668-9FF3-E2DE9DC51962} = {DFD73007-5DB1-43AD-87A8-BD8622C2B192} + {8CB95D25-8442-42BC-82BE-319D21138549} = {7E12E071-51C0-4668-9FF3-E2DE9DC51962} + {99FDF6CA-DCF8-4CB2-B2EA-E24CCB601232} = {DFD73007-5DB1-43AD-87A8-BD8622C2B192} + {2E0EB4A3-3C4A-4A5E-8D2F-F77C62464886} = {99FDF6CA-DCF8-4CB2-B2EA-E24CCB601232} + {B73EB308-70BE-49FD-91A7-1D1495663D6D} = {99FDF6CA-DCF8-4CB2-B2EA-E24CCB601232} + {81128D28-CFC8-4EA4-B68D-9939339C461A} = {99FDF6CA-DCF8-4CB2-B2EA-E24CCB601232} + {5817A848-0B04-4035-9F7E-B8621B61CBDD} = {DFD73007-5DB1-43AD-87A8-BD8622C2B192} + {AB6242B7-634F-4839-A991-7629D0D2C636} = {5817A848-0B04-4035-9F7E-B8621B61CBDD} + {2C69EB76-02C4-4921-96A1-4D70CB7CE744} = {5817A848-0B04-4035-9F7E-B8621B61CBDD} + {0C1B038F-F5CD-4E3C-B9D7-040F020BA44C} = {5817A848-0B04-4035-9F7E-B8621B61CBDD} + {73100F0D-C0BB-4F16-8FC2-FA3FA8ACD424} = {2ACC7FFA-238F-44FD-93CB-4D9B17D8C4BA} + {806499EB-C2CC-4E85-BC19-613F3DE5E0C3} = {9AD757F5-E57A-459D-A0A7-E0675E045B84} + {90B727DD-4C7B-4462-950F-61842A87DE8A} = {806499EB-C2CC-4E85-BC19-613F3DE5E0C3} + {D51AD52D-C4C6-445A-BD0F-884BE5C1C526} = {806499EB-C2CC-4E85-BC19-613F3DE5E0C3} + {F2379E0F-524F-47BC-877C-0428E4C836D4} = {D5B986A3-7FC9-437E-8030-349AA4698DFD} + {F905B72C-4DF7-408B-8B2B-50F9B8246A5E} = {75A2CD30-BB85-4CA6-AC95-86A8A538A690} + {E4CB9988-7348-4D55-A08E-85907732F8DA} = {0F9BA970-11B1-4ACA-AF41-1021AFC0F29C} + {551B2209-4298-4D60-B55C-79077B8BC244} = {0F9BA970-11B1-4ACA-AF41-1021AFC0F29C} + {4A3BAF64-E9D9-4036-9FDA-8B326C382667} = {15878D2D-B0F1-4EE9-875D-4A643DB0C842} + {F83AC93C-9694-4A01-B9CB-7AA8E514B01F} = {4A3BAF64-E9D9-4036-9FDA-8B326C382667} + {08F720FF-7530-43BF-A252-8946927669E3} = {4A3BAF64-E9D9-4036-9FDA-8B326C382667} + {3E1D0DED-6B13-42C8-AA15-2EDFD8ECE80C} = {08F720FF-7530-43BF-A252-8946927669E3} + {BDFA84D6-6C6B-44C9-ABC5-563CFD0C4DB5} = {F83AC93C-9694-4A01-B9CB-7AA8E514B01F} + {D816B818-F58F-4738-93AE-924EFAB7A07F} = {75A2CD30-BB85-4CA6-AC95-86A8A538A690} + {AE2513CB-4E5E-4E5C-8237-88954D4C9433} = {75A2CD30-BB85-4CA6-AC95-86A8A538A690} + {B5F94CCB-5868-43BD-89B5-B66C97C3A741} = {75A2CD30-BB85-4CA6-AC95-86A8A538A690} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {650AE971-2F29-46A8-822C-FB4FCDC6A9A0} + EndGlobalSection +EndGlobal diff --git a/README.md b/README.md index 3f464372dfde..78090812abbc 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ## Maui.sln ### SDKS required -- Install the SDKs listed here https://github.com/xamarin/net6-samples +- Install the SDKs listed here https://github.com/dotnet/net6-mobile-samples - And/or run the following @@ -50,7 +50,7 @@ dotnet build src\DotNet\DotNet.csproj # Builds the rest of Maui .\bin\dotnet\dotnet build Microsoft.Maui-net6.sln # (Windows-only) to launch Visual Studio -.\eng\dogfood.ps1 +dotnet cake --target=VS-DOGFOOD ``` To build & run .NET 6 sample apps, you will also need to use `.\bin\dotnet\dotnet`: @@ -68,19 +68,22 @@ Try out a "single project", you will need the `-f` switch to choose the platform ## Current News +[April 21, 2021 - WinUI Community Live Stream](https://youtu.be/SyLXctia1B0?t=777) + +[April 21, 2021 - InfoQ Interview with David Ortinau](https://www.infoq.com/articles/net-maui/) + [April 9, 2021 - Announcing .NET Multi-platform App UI Preview 3](https://devblogs.microsoft.com/dotnet/announcing-net-multi-platform-app-ui-preview-3/) [April 9, 2021 - Xamarin Podcast - .NET MAUI Q&A](https://www.xamarinpodcast.com/90) -[March 11, 2021 - Announcing .NET 6 Preview 2](https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-2/) +[April 6, 2021 - On .NET with guest Maddy Leger - A Journey to .NET MAUI](https://www.youtube.com/watch?v=hoC5FIblKz8) -Watch our [March 2021 .NET Community Standup report](https://youtu.be/NEbRo0ltniM?t=1242) for the latest information about our progress on .NET MAUI and .NET 6. - -[![](https://user-images.githubusercontent.com/41873/110172514-e1c76280-7dc2-11eb-8407-50760881d1ec.png -)](https://www.youtube.com/watch?v=5bK2ICHtMxo) +[April 1, 2021 - Xamarin Community Standup with Guest Jonathan Peppers discussing .NET 6 Project System updates](https://www.youtube.com/watch?v=su3ntRjEN1I) Additional live streams and presentations: +* March 11, 2021 - [Announcing .NET 6 Preview 2](https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-2/) +* March 2021 - [.NET Community Standup report](https://youtu.be/NEbRo0ltniM?t=1242) * February 25, 2021 - David Ortinau and Maddy Leger at .NET Conf: Focus on Windows: [The Future of Client App Development in .NET 6](https://www.youtube.com/watch?v=fPEdgXeqhE4) * January 28, 2021 - David Ortinau at .NET Frontend Day: [A .NET MAUI Progress Report](https://youtu.be/RnyZZKjdUxk) * September 19, 2020 - Shane Neuville at ReactiveUI Virtual Conference: [Dual Screen, .NET MAUI, and RxUI](https://www.youtube.com/watch?v=Rkz6Dkk1uWU) @@ -88,77 +91,6 @@ Additional live streams and presentations: * October 3, 2020 - David Ortinau at Xamarin Expert Day: [Introducing .NET MAUI](https://youtu.be/qbHO8J3bId0) * December 2, 2020 - Javier Suarez Ruiz at MonkeyConf: [.NET MAUI Handlers](https://youtu.be/TBMauxRGkiI) (Spanish) -## Status: Active Development - -While [Xamarin.Forms](https://github.com/xamarin/xamarin.forms) continues to be actively supported through November 2022, we are making evolutionary changes based on customer research of what would be most beneficial. Current areas of focus are: - -* Porting renderers to handlers ([spec](https://github.com/dotnet/maui/issues/28)) -* Adapting layouts for handlers -* WinUI 3 preview 3 early spike ([branch](https://github.com/xamarin/Xamarin.Forms/tree/winui3)) -* Mac Catalyst early evaluation ([wiki](https://github.com/xamarin/xamarin-macios/wiki/Mac-Catalyst-(Early-Preview))) - -Active development is happening today to build Android and iOS SDKs against .NET 6. [Samples may be found here](https://github.com/xamarin/net6-samples). - -### Goals - -* Improve app performance -* Improve simplicity of control extensibility -* Improve simplicity of contributing -* Enable developer options to use Model-View-Update (MVU) and Blazor - -### Roadmap - -.NET MAUI and mobile SDK support will ship in concert with .NET 6. At present we do not have a shipping schedule for .NET 6. - -### Milestones - -* .NET MAUI previews Q4 2020 through Q3 2021 - * [Renderer architecture revisions](https://github.com/dotnet/maui/issues/28) - * Source solution and project simplification - * Complete approved proposals - * Implement MVU (experimental) -* .NET MAUI release candidate September 2021 -* .NET MAUI general availability November 2021 - -## Xamarin.Forms vs .NET MAUI - - -| |Xamarin.Forms |.NET MAUI | -|---------|---------|---------| -|**Platforms** | | | -|Android |API 19+ |API 21+ | -|iOS |9-15 |10+ | -|Linux |Community |Community | -|macOS |Community |Microsoft | -|Tizen |Samsung |Samsung | -|Windows |UWP Microsoft
WPF Community |Microsoft* | -|**Features** | | | -|Renderers |Tightly coupled to BindableObject |Loosely coupled, no Xamarin.Forms dependencies | -|App Models |MVVM |MVVM | -| |RxUI |RxUI | -| | |MVU ** | -| | |Blazor ** | -|Single Project |No |Yes | -|Multi-targeting |No |Yes | -|Multi-window |No |Yes | -|**Misc** | | | -|.NET |Xamarin.iOS, Xamarin.Android, Mono, .NET Framework, ... |.NET 6+ | -|XAML Hot Reload|Experimental: SDK 4.x & Visual Studio 2019 prior to version 16.9
Feature Complete: SDK 5.x & Visual Studio 2019 version 16.9 or newer|Yes| -|.NET Hot Reload|iOS/Android – No
UWP – Limited support for runtime edits using .NET “Edit & Continue”|Yes| -|Acquisition |NuGet & Visual Studio Installer |dotnet | -|Project System |Franken-proj |SDK Style | -|dotnet CLI |No |Yes | -|**Tools** | | | -|Visual Studio 2019 |Yes |Yes | -|Visual Studio 2019 for Mac |Yes |Yes | -|Visual Studio Code |No |Experimental*** | - -* The Windows implementation is expected to be WinUI 3, pending GA release. - -** These app models are experimental. - -*** Visual Studio Code will work by virtue of .NET unification, however not all experiences that make .NET MAUI development delightful (intellisense for example) may be enabled at the time of .NET 6 release. - ## FAQs Do you have questions? Do not worry, we have prepared a complete [FAQ](https://github.com/dotnet/maui/wiki/FAQs) answering the most common questions. diff --git a/build.cake b/build.cake index 6a900f996297..97205be517cd 100644 --- a/build.cake +++ b/build.cake @@ -22,6 +22,8 @@ PowerShell: #addin "nuget:?package=Cake.Boots&version=1.0.4.600-preview1" #addin "nuget:?package=Cake.AppleSimulator&version=0.2.0" #addin "nuget:?package=Cake.FileHelpers&version=3.2.1" +#load "eng/cake/dotnet.cake" +#load "eng/cake/helpers.cake" ////////////////////////////////////////////////////////////////////// // TOOLS @@ -37,7 +39,9 @@ string agentName = EnvironmentVariable("AGENT_NAME", ""); bool isCIBuild = !String.IsNullOrWhiteSpace(agentName); string artifactStagingDirectory = EnvironmentVariable("BUILD_ARTIFACTSTAGINGDIRECTORY", "."); string workingDirectory = EnvironmentVariable("SYSTEM_DEFAULTWORKINGDIRECTORY", "."); -var configuration = Argument("BUILD_CONFIGURATION", "Debug"); +string envProgramFiles = EnvironmentVariable("ProgramFiles(x86)"); +var configuration = GetBuildVariable("BUILD_CONFIGURATION", GetBuildVariable("configuration", "DEBUG")); +var msbuildPath = GetBuildVariable("msbuild", $"{envProgramFiles}\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe"); var target = Argument("target", "Default"); if(String.IsNullOrWhiteSpace(target)) @@ -162,6 +166,8 @@ Information ("artifactStagingDirectory: {0}", artifactStagingDirectory); Information("workingDirectory: {0}", workingDirectory); Information("NUNIT_TEST_WHERE: {0}", NUNIT_TEST_WHERE); Information("TARGET: {0}", target); +Information("MSBUILD: {0}", msbuildPath); + var releaseChannel = ReleaseChannel.Stable; if(releaseChannelArg == "Preview") @@ -237,26 +243,27 @@ Information ("iosSDK: {0}", iosSDK); // TASKS ////////////////////////////////////////////////////////////////////// -Task("Clean") - .Description("Deletes all the obj/bin directories") +Task("BuildUnitTests") + .IsDependentOn("BuildTasks") + .Description("Builds all necessary projects to run Unit Tests") .Does(() => { - List foldersToClean = new List(); - - foreach (var item in new [] {"obj", "bin"}) + try { - foreach(string f in System.IO.Directory.GetDirectories(".", item, SearchOption.AllDirectories)) - { - if(f.StartsWith(@".\bin") || f.StartsWith(@".\tools")) - continue; - - // this is here as a safety check - if(!f.StartsWith(@".\src")) - continue; + var msbuildSettings = GetMSBuildSettings(); + var binaryLogger = new MSBuildBinaryLogSettings { + Enabled = isCIBuild + }; - CleanDirectories(f); - } - } + msbuildSettings.BinaryLogger = binaryLogger; + binaryLogger.FileName = $"{artifactStagingDirectory}/Maui.Controls-{configuration}.binlog"; + MSBuild("./Microsoft.Maui.sln", msbuildSettings.WithRestore()); + } + catch(Exception) + { + if(IsRunningOnWindows()) + throw; + } }); Task("provision-macsdk") @@ -678,19 +685,6 @@ Task("provision") .IsDependentOn("provision-windowssdk") .IsDependentOn("provision-monosdk"); // always provision monosdk last otherwise CI might fail -Task("NuGetPack") - .Description("Build and Create Nugets").Does(()=> { - - var settings = new DotNetCoreToolSettings - { - DiagnosticOutput = true, - ArgumentCustomization = args => args.Append($"./eng/package.ps1 -configuration \"{configuration}\"") - }; - - DotNetCoreTool("pwsh", settings); - -});; - Task("provision-powershell").Does(()=> { var settings = new DotNetCoreToolSettings { @@ -728,144 +722,6 @@ Task("WriteGoogleMapsAPIKey") } }); -Task("BuildForNuget") - .IsDependentOn("BuildTasks") - .Description("Builds all necessary projects to create Nuget Packages") - .Does(() => -{ - try - { - var msbuildSettings = GetMSBuildSettings(); - var binaryLogger = new MSBuildBinaryLogSettings { - Enabled = isCIBuild - }; - - msbuildSettings.BinaryLogger = binaryLogger; - binaryLogger.FileName = $"{artifactStagingDirectory}/Maui.Controls-{configuration}.binlog"; - MSBuild(MAUI_SLN, msbuildSettings.WithRestore()); - - // // This currently fails on CI will revisit later - // if(isCIBuild) - // { - // MSBuild("./Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj", GetMSBuildSettings().WithTarget("Restore")); - // MSBuild("./Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj", GetMSBuildSettings()); - // } - - // MSBuild(MAUI_SLN, GetMSBuildSettings().WithTarget("Restore")); - // MSBuild("./Xamarin.Forms.DualScreen.sln", GetMSBuildSettings().WithTarget("Restore")); - - // if(isCIBuild) - // { - // foreach(var platformProject in GetFiles("./Xamarin.*.UnitTests/*.csproj").Select(x=> x.FullPath)) - // { - // if(platformProject.Contains("Xamarin.Forms.Xaml.UnitTests")) - // continue; - - // Information("Building: {0}", platformProject); - // MSBuild(platformProject, - // GetMSBuildSettings().WithRestore()); - // } - // } - - // MSBuild(MAUI_SLN, GetMSBuildSettings().WithTarget("Restore")); - // MSBuild("./Xamarin.Forms.DualScreen.sln", GetMSBuildSettings().WithTarget("Restore")); - - // msbuildSettings.BinaryLogger = binaryLogger; - - // var platformProjects = - // GetFiles("./Xamarin.Forms.Platform.*/*.csproj") - // .Union(GetFiles("./Stubs/*/*.csproj")) - // .Union(GetFiles("./Xamarin.Forms.Maps.*/*.csproj")) - // .Union(GetFiles("./Xamarin.Forms.Pages.*/*.csproj")) - // .Union(GetFiles("./Xamarin.Forms.Material.*/*.csproj")) - // .Union(GetFiles("./Xamarin.Forms.Core.Design/*.csproj")) - // .Union(GetFiles("./Xamarin.Forms.Xaml.Design/*.csproj")) - // .Select(x=> x.FullPath).Distinct() - // .ToList(); - - // foreach(var platformProject in platformProjects) - // { - // if(platformProject.Contains("UnitTests")) - // continue; - - // msbuildSettings = GetMSBuildSettings(); - // string projectName = platformProject - // .Replace(' ', '_') - // .Split('/') - // .Last(); - - // binaryLogger.FileName = $"{artifactStagingDirectory}/{projectName}-{configuration}.binlog"; - // msbuildSettings.BinaryLogger = binaryLogger; - - // Information("Building: {0}", platformProject); - // MSBuild(platformProject, - // msbuildSettings); - // } - - // dual screen - - - // XAML Tests are currently having issues compiling in Release Mode - // if(configuration == "Debug") - // { - // msbuildSettings = GetMSBuildSettings(); - // msbuildSettings.BinaryLogger = binaryLogger; - // binaryLogger.FileName = $"{artifactStagingDirectory}/ControlGallery-{configuration}.binlog"; - // MSBuild(CONTROLGALLERY_SLN, msbuildSettings.WithRestore()); - // } - - if(IsRunningOnWindows()) - { - // msbuildSettings = GetMSBuildSettings(); - // msbuildSettings.BinaryLogger = binaryLogger; - // binaryLogger.FileName = $"{artifactStagingDirectory}/dualscreen-{configuration}-csproj.binlog"; - // MSBuild("./Xamarin.Forms.DualScreen/Xamarin.Forms.DualScreen.csproj", - // msbuildSettings - // .WithRestore() - // .WithTarget("rebuild")); - - - // msbuildSettings = GetMSBuildSettings(); - // msbuildSettings.BinaryLogger = binaryLogger; - // binaryLogger.FileName = $"{artifactStagingDirectory}/win-maps-{configuration}-csproj.binlog"; - // MSBuild("./Xamarin.Forms.Maps.UWP/Xamarin.Forms.Maps.UWP.csproj", - // msbuildSettings - // .WithProperty("UwpMinTargetFrameworks", "uap10.0.14393") - // .WithRestore()); - - // msbuildSettings = GetMSBuildSettings(); - // msbuildSettings.BinaryLogger = binaryLogger; - // binaryLogger.FileName = $"{artifactStagingDirectory}/win-{configuration}-csproj.binlog"; - // MSBuild("./src/Compatibility/Core/src/UAP/Compatibility.UAP.csproj", - // msbuildSettings - // .WithRestore() - // .WithTarget("rebuild") - // .WithProperty("DisableEmbeddedXbf", "false") - // .WithProperty("EnableTypeInfoReflection", "false")); - - // msbuildSettings = GetMSBuildSettings(); - // msbuildSettings.BinaryLogger = binaryLogger; - // binaryLogger.FileName = $"{artifactStagingDirectory}/ios-{configuration}-csproj.binlog"; - // MSBuild("./Xamarin.Forms.Platform.iOS/Xamarin.Forms.Platform.iOS.csproj", - // msbuildSettings - // .WithTarget("rebuild")); - - // msbuildSettings = GetMSBuildSettings(); - // msbuildSettings.BinaryLogger = binaryLogger; - // binaryLogger.FileName = $"{artifactStagingDirectory}/macos-{configuration}-csproj.binlog"; - // MSBuild("./Xamarin.Forms.Platform.MacOS/Xamarin.Forms.Platform.MacOS.csproj", - // msbuildSettings - // .WithTarget("rebuild")); - } - - } - catch(Exception) - { - if(IsRunningOnWindows()) - throw; - } -}); - Task("BuildTasks") .Description($"Build {BUILD_TASKS_PROJ}") .Does(() => @@ -898,35 +754,6 @@ Task("Android100") .WithProperty("AndroidTargetFrameworks", "MonoAndroid10.0")); }); - -Task("VS-NET6") - .Does(() => - { - DotNetCoreBuild("./src/DotNet/Dotnet.csproj"); - var ext = IsRunningOnWindows() ? ".exe" : ""; - DotNetCoreBuild("./Microsoft.Maui.BuildTasks-net6.sln", new DotNetCoreBuildSettings { ToolPath = $"./bin/dotnet/dotnet{ext}" }); - StartVisualStudioForDotNet6(); - }); - - -Task("VS-WINUI") - .IsDependentOn("Clean") - .Does(() => - { - DotNetCoreBuild("./src/DotNet/Dotnet.csproj"); - var ext = IsRunningOnWindows() ? ".exe" : ""; - - StartProcess("powershell", $"./eng/dogfood.ps1 -JustCreateGlobalJSON"); - DotNetCoreBuild("./Microsoft.Maui.BuildTasks-net6.sln", new DotNetCoreBuildSettings { ToolPath = $"./bin/dotnet/dotnet{ext}" }); - - - MSBuild("Microsoft.Maui.WinUI.sln", - GetMSBuildSettings(includePrerelease:true). - WithRestore()); - - StartVisualStudioForDotNet6("./Microsoft.Maui.WinUI.sln"); - }); - Task("VS") .Description("Builds projects necessary so solution compiles on VS") .IsDependentOn("Clean") @@ -1186,9 +1013,7 @@ Task ("cg-ios-deploy") // TASK TARGETS ////////////////////////////////////////////////////////////////////// -Task("Default") - .IsDependentOn("NugetPack") - ; +Task("Default").IsDependentOn("dotnet-pack"); ////////////////////////////////////////////////////////////////////// // EXECUTION @@ -1228,14 +1053,6 @@ void RunTests(string unitTestLibrary, NUnit3Settings settings, ICakeContext ctx) } } -T GetBuildVariable(string key, T defaultValue) -{ - // on MAC all environment variables are upper case regardless of how you specify them in devops - // And then Environment Variable check is case sensitive - T upperCaseReturnValue = Argument(key.ToUpper(), EnvironmentVariable(key.ToUpper(), defaultValue)); - return Argument(key, EnvironmentVariable(key, upperCaseReturnValue)); -} - void StartVisualStudio(string sln = "./Microsoft.Maui.sln") { if(isCIBuild) @@ -1255,22 +1072,6 @@ void StartVisualStudio(string sln = "./Microsoft.Maui.sln") StartProcess("open", new ProcessSettings{ Arguments = sln }); } -void StartVisualStudioForDotNet6(string sln = "./Microsoft.Maui-net6.sln") -{ - if (isCIBuild) - return; - if (!IsRunningOnWindows()) - { - Information("This target is only supported on Windows."); - return; - } - var vsLatest = VSWhereLatest(new VSWhereLatestSettings { IncludePrerelease = true, }); - if (vsLatest == null) - throw new Exception("Unable to find Visual Studio!"); - var devenv = vsLatest.CombineWithFilePath("./Common7/IDE/devenv.exe"); - StartProcess("powershell", $"./eng/dogfood.ps1 -vs '{devenv}' -sln '{sln}'"); -} - MSBuildSettings GetMSBuildSettings( PlatformTarget? platformTarget = PlatformTarget.MSIL, string buildConfiguration = null, @@ -1479,4 +1280,4 @@ public string ParseDevOpsInputs(string nunitWhere) } return returnValue; -} +} \ No newline at end of file diff --git a/eng/AndroidX.targets b/eng/AndroidX.targets index e0f88d9281e7..495deb1ffdee 100644 --- a/eng/AndroidX.targets +++ b/eng/AndroidX.targets @@ -19,6 +19,22 @@ Update="Xamarin.AndroidX.Lifecycle.LiveData" Version="2.3.1-$(_AndroidXVersion)" /> + + + + <_MicrosoftProjectReunionVersion>0.5.0 <_MicrosoftGraphicsWin2DVersion>0.5.0.13 - <_MicrosoftMauiGraphics>6.0.100-preview.3.61 + <_MicrosoftMauiGraphics>6.0.100-preview.4.78 + <_XamarinAndroidGlideVersion>4.11.0.1 @@ -40,6 +41,14 @@ Update="Microsoft.Extensions.Logging" Version="$(_MicrosoftHostingVersion)" /> + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7cb4819df4e4..0b30e8d00e08 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,20 +1,28 @@ - + https://github.com/dotnet/installer - aee38a6dd446b512b1ae510d80d2ed1c1f24e79a + 8e4d77c38be0f061f14c166a4bdc1bbbfa6a2073 - + https://github.com/xamarin/xamarin-android - + 4182e1ff3eb779c499402eb7016fc7de84a0f8f4 - + https://github.com/xamarin/xamarin-macios - + ab14e071461ff773f118112d4e922c421fdc2a80 - + https://github.com/xamarin/xamarin-macios - + ab14e071461ff773f118112d4e922c421fdc2a80 + + + https://github.com/xamarin/xamarin-macios + ab14e071461ff773f118112d4e922c421fdc2a80 + + + https://github.com/xamarin/xamarin-macios + ab14e071461ff773f118112d4e922c421fdc2a80 diff --git a/eng/Versions.props b/eng/Versions.props index 3307b1349ba1..86bb0600ce60 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,9 +1,15 @@ - 6.0.100-preview.3.21202.5 - 11.0.200-preview.3.196 - 14.3.100-preview.3.471 - 14.4.100-preview.3.1326 + 6.0.100-preview.5.21255.8 + 11.0.200-ci.main.260 + 14.5.100-ci.main.803 + 14.5.100-ci.main.803 + 14.5.100-ci.main.803 + 11.3.100-ci.main.803 + + + + $([System.Text.RegularExpressions.Regex]::Replace($(MicrosoftDotnetSdkInternalPackageVersion), `[-+].*$`, "")) diff --git a/eng/automation/LocProject.json b/eng/automation/LocProject.json new file mode 100644 index 000000000000..90bf4c21dec0 --- /dev/null +++ b/eng/automation/LocProject.json @@ -0,0 +1,23 @@ +{ + "Projects": [ + { + "LanguageSet": "VS_Main_Languages", + "LocItems": [ + { + "SourceFile": "src\\Compatibility\\Core\\src\\iOS\\Resources\\StringResources.resx", + "LclFile": "loc\\{Lang}\\src\\Compatibility\\Core\\src\\iOS\\Resources\\StringResources.resx.lcl", + "CopyOption": "LangIDOnName", + "OutputPath": "src\\Compatibility\\Core\\src\\iOS\\Resources\\" + }, + { + "SourceFile": "src\\Controls\\src\\Build.Tasks\\ErrorMessages.resx", + "LclFile": "loc\\{Lang}\\src\\Controls\\src\\Build.Tasks\\ErrorMessages.resx.lcl", + "CopyOption": "LangIDOnName", + "OutputPath": "src\\Controls\\src\\Build.Tasks\\xlf\\" + } + ], + "LssFiles": [], + "CloneLanguageSet": "" + } + ] +} \ No newline at end of file diff --git a/eng/automation/scripts/Invoke-Git.psm1 b/eng/automation/scripts/Invoke-Git.psm1 new file mode 100644 index 000000000000..536163dddace --- /dev/null +++ b/eng/automation/scripts/Invoke-Git.psm1 @@ -0,0 +1,34 @@ +<# +Copyright (c) Microsoft Corporation. All rights reserved. + #> +<# +.SYNOPSIS +Module for invoking git in a safe way that allows for stderr to be written to stdout. +#> +function Invoke-Git { + <# + .Synopsis + Wrapper function that deals with Powershell's peculiar error output when Git uses the error stream. + .Example + Invoke-Git ThrowError + $LASTEXITCODE + #> + [CmdletBinding()] + param( + [parameter(ValueFromRemainingArguments=$true)] + [string[]]$Arguments + ) + & { + [CmdletBinding()] + param( + [parameter(ValueFromRemainingArguments=$true)] + [string[]]$InnerArgs + ) + git.exe $InnerArgs + } -ErrorAction SilentlyContinue -ErrorVariable fail @Arguments + if ($fail) { + $fail.Exception + } +} +#Exports +Export-ModuleMember -Function Invoke-Git \ No newline at end of file diff --git a/eng/cake/.gitignore b/eng/cake/.gitignore new file mode 100644 index 000000000000..c50f923c7b31 --- /dev/null +++ b/eng/cake/.gitignore @@ -0,0 +1 @@ +tools/ diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake new file mode 100644 index 000000000000..19a50e6f1da8 --- /dev/null +++ b/eng/cake/dotnet.cake @@ -0,0 +1,223 @@ +// Contains .NET 6-related Cake targets + +var ext = IsRunningOnWindows() ? ".exe" : ""; +var dotnetPath = $"./bin/dotnet/dotnet{ext}"; + +Task("dotnet") + .Description("Provisions .NET 6 into bin/dotnet based on eng/Versions.props") + .Does(() => + { + var binlog = $"artifacts/dotnet-{configuration}.binlog"; + var settings = new DotNetCoreBuildSettings + { + MSBuildSettings = new DotNetCoreMSBuildSettings() + .EnableBinaryLogger(binlog) + .SetConfiguration(configuration), + }; + DotNetCoreBuild("./src/DotNet/DotNet.csproj", settings); + }); + +Task("dotnet-pack") + .Description("Build and create .NET 6 NuGet packages") + //.IsDependentOn("dotnet") + // .IsDependentOn("dotnet-buildtasks") + .Does(()=> + { + + var settings = new DotNetCoreToolSettings + { + DiagnosticOutput = true, + ArgumentCustomization = args => args.Append($"./eng/package.ps1 -configuration \"{configuration}\"") + }; + + DotNetCoreTool("pwsh", settings); + + // RunMSBuildWithLocalDotNet("Microsoft.Maui-net6.sln", (settings) => + // { + // if (settings is MSBuildSettings msbuildSettings) + // { + // msbuildSettings + // .WithProperty("Packing", "true") + // .WithProperty("CI", "true") + // .WithTarget("build"); + + // } + // else if( settings is DotNetCoreMSBuildSettings dotnetSettings ) + // { + // dotnetSettings + // .WithProperty("Packing", "true") + // .WithProperty("CI", "true") + // .WithTarget("pack"); + + // } + // }); + + + // if (IsRunningOnWindows()) + // { + // RunMSBuildWithLocalDotNet("Microsoft.Maui-net6.sln", (settings) => + // { + // if (settings is MSBuildSettings msbuildSettings) + // { + // msbuildSettings + // .WithProperty("Packing", "true") + // .WithProperty("CI", "true") + // .WithTarget("pack"); + + // } + // }); + // } + }); + +Task("dotnet-buildtasks") + .IsDependentOn("dotnet") + .Does(() => + { + RunMSBuildWithLocalDotNet("./Microsoft.Maui.BuildTasks-net6.sln"); + }); + +Task("VS-DOGFOOD") + .Description("Provisions .NET 6 and launches an instance of Visual Studio using it.") + .IsDependentOn("dotnet") + .Does(() => + { + StartVisualStudioForDotNet6(null); + }); + +Task("VS-NET6") + .Description("Provisions .NET 6 and launches an instance of Visual Studio using it.") + .IsDependentOn("Clean") + .IsDependentOn("dotnet") + .IsDependentOn("dotnet-buildtasks") + .Does(() => + { + StartVisualStudioForDotNet6(); + }); + +Task("VS-WINUI") + .Description("Provisions .NET 6 and launches an instance of Visual Studio with WinUI projects.") + .IsDependentOn("Clean") + .IsDependentOn("dotnet") + .IsDependentOn("dotnet-buildtasks") + .Does(() => + { + RunMSBuildWithLocalDotNet("./Microsoft.Maui.WinUI.sln"); + StartVisualStudioForDotNet6("./Microsoft.Maui.WinUI.sln"); + }); + +Task("VS-ANDROID") + .Description("Provisions .NET 6 and launches an instance of Visual Studio with Android projects.") + .IsDependentOn("Clean") + .IsDependentOn("dotnet") + .IsDependentOn("dotnet-buildtasks") + .Does(() => + { + DotNetCoreRestore("./Microsoft.Maui-net6.sln", new DotNetCoreRestoreSettings + { + ToolPath = dotnetPath + }); + + StartVisualStudioForDotNet6("./Microsoft.Maui.Droid.sln"); + }); + +string FindMSBuild() +{ + if (IsRunningOnWindows()) + { + var vsInstallation = VSWhereLatest(new VSWhereLatestSettings { Requires = "Microsoft.Component.MSBuild", IncludePrerelease = true }); + if (vsInstallation != null) + { + var path = vsInstallation.CombineWithFilePath(@"MSBuild\Current\Bin\MSBuild.exe"); + if (FileExists(path)) + return path.FullPath; + + path = vsInstallation.CombineWithFilePath(@"MSBuild\15.0\Bin\MSBuild.exe"); + if (FileExists(path)) + return path.FullPath; + } + } + return "msbuild"; +} + +void SetDotNetEnvironmentVariables() +{ + var dotnet = MakeAbsolute(Directory("./bin/dotnet/")).ToString(); + var target = EnvironmentVariableTarget.Process; + Environment.SetEnvironmentVariable("DOTNET_INSTALL_DIR", dotnet, target); + Environment.SetEnvironmentVariable("DOTNET_ROOT", dotnet, target); + Environment.SetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR", dotnet, target); + Environment.SetEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0", target); + Environment.SetEnvironmentVariable("MSBuildEnableWorkloadResolver", "true", target); + Environment.SetEnvironmentVariable("PATH", dotnet + System.IO.Path.PathSeparator + EnvironmentVariable("PATH"), target); +} + +void StartVisualStudioForDotNet6(string sln = "./Microsoft.Maui-net6.sln") +{ + if (isCIBuild) + { + Information("This target should not run on CI."); + return; + } + if (!IsRunningOnWindows()) + { + Information("This target is only supported on Windows."); + return; + } + + var vsLatest = VSWhereLatest(new VSWhereLatestSettings { IncludePrerelease = true, }); + if (vsLatest == null) + throw new Exception("Unable to find Visual Studio!"); + SetDotNetEnvironmentVariables(); + Environment.SetEnvironmentVariable("_ExcludeMauiProjectCapability", "true", EnvironmentVariableTarget.Process); + StartProcess(vsLatest.CombineWithFilePath("./Common7/IDE/devenv.exe"), sln); +} + +// NOTE: this method works as long as the DotNet target has already run +void RunMSBuildWithLocalDotNet(string sln, Action settings = null) +{ + var name = System.IO.Path.GetFileNameWithoutExtension(sln); + var binlog = $"artifacts/{name}-{configuration}.binlog"; + + // If we're not on Windows, just use ./bin/dotnet/dotnet, that's it + if (!IsRunningOnWindows()) + { + var dotnetBuildSettings = new DotNetCoreMSBuildSettings + { + BinaryLogger = new MSBuildBinaryLoggerSettings + { + Enabled = true, + FileName = binlog, + }, + }; + + settings?.Invoke(dotnetBuildSettings); + + DotNetCoreBuild(sln, + new DotNetCoreBuildSettings + { + Configuration = configuration, + ToolPath = dotnetPath, + MSBuildSettings = dotnetBuildSettings, + }); + return; + } + + // Otherwise we need to set env variables and run MSBuild + SetDotNetEnvironmentVariables(); + var msbuildSettings = new MSBuildSettings + { + Configuration = configuration, + BinaryLogger = new MSBuildBinaryLogSettings + { + Enabled = true, + FileName = binlog, + }, + ToolPath = FindMSBuild(), + }; + + settings?.Invoke(msbuildSettings); + + MSBuild(sln, + msbuildSettings + .WithRestore()); +} diff --git a/eng/cake/helpers.cake b/eng/cake/helpers.cake new file mode 100644 index 000000000000..aa74e0e11f67 --- /dev/null +++ b/eng/cake/helpers.cake @@ -0,0 +1,31 @@ +Task("Clean") + .Description("Deletes all the obj/bin directories") + .Does(() => +{ + List foldersToClean = new List(); + + foreach (var item in new [] {"obj", "bin"}) + { + foreach(string f in System.IO.Directory.GetDirectories(".", item, SearchOption.AllDirectories)) + { + if(f.StartsWith(@".\bin") || f.StartsWith(@".\tools")) + continue; + + // this is here as a safety check + if(!f.StartsWith(@".\src")) + continue; + + CleanDirectories(f); + } + } +}); + + + +T GetBuildVariable(string key, T defaultValue) +{ + // on MAC all environment variables are upper case regardless of how you specify them in devops + // And then Environment Variable check is case sensitive + T upperCaseReturnValue = Argument(key.ToUpper(), EnvironmentVariable(key.ToUpper(), defaultValue)); + return Argument(key, EnvironmentVariable(key, upperCaseReturnValue)); +} \ No newline at end of file diff --git a/eng/dogfood.ps1 b/eng/dogfood.ps1 deleted file mode 100644 index 0d4ce1fbdc2e..000000000000 --- a/eng/dogfood.ps1 +++ /dev/null @@ -1,119 +0,0 @@ -<# - .SYNOPSIS - *Windows-only* Launches Visual Studio with environment variables to use the local ./bin/dotnet/dotnet.exe. - - .DESCRIPTION - *Windows-only* Launches Visual Studio with environment variables to use the local ./bin/dotnet/dotnet.exe. - Script based on: - https://github.com/dotnet/runtime/blob/1be117d8e7c0cd29ebc55cbcff2a7fa70604ed39/eng/build.ps1#L186-L208 - https://github.com/dotnet/runtime/blob/1be117d8e7c0cd29ebc55cbcff2a7fa70604ed39/eng/common/tools.ps1#L109 - - .PARAMETER vs - The path to Visual Studio or the edition (Community, Enterprise, Preview), defaults to: "Enterprise". - - .PARAMETER sln - The path to a .sln or .project file, defaults to "Microsoft.Maui-net6.sln". - - .PARAMETER modify - Modify the environment variables in the current session. This would - allow the "dotnet" command to work instead of ".\bin\dotnet\dotnet". - However, it would be good to do this in a new terminal session, - since you would have trouble running "dotnet build" if it needs to - provision .NET 6 and the iOS/Android workloads again. - - .EXAMPLE - PS> .\scripts\dogfood.ps1 - - .EXAMPLE - PS> .\scripts\dogfood.ps1 -vs "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" - - .EXAMPLE - PS> .\scripts\dogfood.ps1 -vs "Preview" - - .EXAMPLE - PS> .\scripts\dogfood.ps1 -sln .\path\to\MySolution.sln -#> - -param( - [string]$vs = "Enterprise", - [string]$sln, - [switch]$modify, - [switch]$JustCreateGlobalJSON -) - -if ($vs.Contains("\") -Or $vs.Contains("/")) { - $realVS = $vs -} else { - $realVS = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\$vs\Common7\IDE\devenv.exe" -} - -$dotnet=Join-Path $PSScriptRoot ../bin/dotnet/ -$dotnet=(Get-Item $dotnet).FullName - -if (-Not $sln) { - $sln=Join-Path $PSScriptRoot ../Microsoft.Maui-net6.sln - $sln=(Get-Item $sln).FullName -} - -# Modify global.json, so the IDE can load -$globaljson = Join-Path $PSScriptRoot ../global.json -[xml] $xml = Get-Content (Join-Path $PSScriptRoot Versions.props) -$json = Get-Content $globaljson | ConvertFrom-Json -$json | Add-Member sdk (New-Object -TypeName PSObject) -Force -$json.sdk | Add-Member version $xml.Project.PropertyGroup.MicrosoftDotnetSdkInternalPackageVersion -Force -$json | ConvertTo-Json | Set-Content $globaljson - -# NOTE: I've not found a better way to do this -# see: https://github.com/PowerShell/PowerShell/issues/3316 -$oldDOTNET_INSTALL_DIR=$env:DOTNET_INSTALL_DIR -$oldDOTNET_ROOT=$env:DOTNET_ROOT -$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR -$oldDOTNET_MULTILEVEL_LOOKUP=$env:DOTNET_MULTILEVEL_LOOKUP -$oldMSBuildEnableWorkloadResolver=$env:MSBuildEnableWorkloadResolver -$old_ExcludeMauiProjectCapability=$env:_ExcludeMauiProjectCapability -# $old_MSBuildDisableNodeReuse=$env:MSBuildDisableNodeReuse -$oldPATH=$env:PATH - -try { - $env:DOTNET_INSTALL_DIR=$dotnet - - # This tells .NET to use the bootstrapped runtime - $env:DOTNET_ROOT=$env:DOTNET_INSTALL_DIR - - # This tells MSBuild to load the SDK from the directory of the bootstrapped SDK - $env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_ROOT - - # This tells .NET not to go looking for .NET in other places - $env:DOTNET_MULTILEVEL_LOOKUP=0 - - # This enables workload support inside the IDE - $env:MSBuildEnableWorkloadResolver=$true - - # This disables the Maui @(ProjectCapability), a temporary workaround for 16.9 - $env:_ExcludeMauiProjectCapability=$true - - # # This tells MSBuild not to keep the process around - # $env:MSBuildDisableNodeReuse=1 - - # Put our local dotnet.exe on PATH first so Visual Studio knows which one to use - $env:PATH=($env:DOTNET_ROOT + ";" + $env:PATH) - - if(-Not $JustCreateGlobalJSON) - { - # Launch VS - & "$realVS" "$sln" - } -} finally { - if (-Not $modify) { - $env:DOTNET_INSTALL_DIR = $oldDOTNET_INSTALL_DIR - $env:DOTNET_ROOT=$oldDOTNET_ROOT - $env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR - $env:DOTNET_MULTILEVEL_LOOKUP=$oldDOTNET_MULTILEVEL_LOOKUP - $env:MSBuildEnableWorkloadResolver=$oldMSBuildEnableWorkloadResolver - $env:_ExcludeMauiProjectCapability=$old_ExcludeMauiProjectCapability - # $env:MSBuildDisableNodeReuse=$oldMSBuildDisableNodeReuse - $env:PATH=$oldPATH - } -} - -exit 0 \ No newline at end of file diff --git a/eng/package.ps1 b/eng/package.ps1 index 7ae0e486f611..d0d37ee11fdd 100644 --- a/eng/package.ps1 +++ b/eng/package.ps1 @@ -1,10 +1,14 @@ param( [string] $configuration = 'Debug', - [string] $msbuild = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" + [string] $msbuild = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\MSBuild.exe" ) +$ErrorActionPreference = "Stop" +Write-Host $msbuild + $artifacts = Join-Path $PSScriptRoot ../artifacts $sln = Join-Path $PSScriptRoot ../Microsoft.Maui-net6.sln +$slnTasks = Join-Path $PSScriptRoot ../Microsoft.Maui.BuildTasks-net6.sln # Bootstrap .\bin\dotnet\ $csproj = Join-Path $PSScriptRoot ../src/DotNet/DotNet.csproj @@ -50,6 +54,14 @@ if ($IsWindows) # Put our local dotnet.exe on PATH first so Visual Studio knows which one to use $env:PATH=($env:DOTNET_ROOT + ";" + $env:PATH) + # Have to build the solution tasks + & $msbuild $slnTasks ` + /p:configuration=$configuration ` + /p:SymbolPackageFormat=snupkg ` + /restore ` + /t:build ` + /bl:"$artifacts/maui-build-tasks-$configuration.binlog" + # Have to build the solution first so the xbf files are there for pack & $msbuild $sln ` /p:configuration=$configuration ` @@ -58,6 +70,7 @@ if ($IsWindows) /t:build ` /p:Packing=true ` /bl:"$artifacts/maui-build-$configuration.binlog" + if (!$?) { throw "Build failed." } & $msbuild $sln ` /p:configuration=$configuration ` @@ -65,6 +78,7 @@ if ($IsWindows) /t:pack ` /p:Packing=true ` /bl:"$artifacts/maui-pack-$configuration.binlog" + if (!$?) { throw "Pack failed." } } finally { @@ -86,4 +100,5 @@ else -c:$configuration ` -p:SymbolPackageFormat=snupkg ` -bl:$artifacts/maui-pack-$configuration.binlog -} \ No newline at end of file + if (!$?) { throw "Pack failed." } +} diff --git a/eng/pipelines/common/build-windows.yml b/eng/pipelines/common/build-windows.yml index ffe67b6f271a..f297972d2841 100644 --- a/eng/pipelines/common/build-windows.yml +++ b/eng/pipelines/common/build-windows.yml @@ -36,7 +36,7 @@ steps: inputs: script: 'nuget install NUnit3TestAdapter' - - script: build.cmd -Target BuildForNuget -ScriptArgs '--BUILD_CONFIGURATION="$(BuildConfiguration)"','--Build_ArtifactStagingDirectory="$(Build.ArtifactStagingDirectory)"' + - script: build.cmd -Target BuildUnitTests -ScriptArgs '--configuration="$(BuildConfiguration)"','--Build_ArtifactStagingDirectory="$(Build.ArtifactStagingDirectory)"' name: winbuild displayName: 'Build Projects For Nuget' diff --git a/eng/pipelines/common/controlgallery-android.yml b/eng/pipelines/common/controlgallery-android.yml index 5d2dde3c54be..71227846b08c 100644 --- a/eng/pipelines/common/controlgallery-android.yml +++ b/eng/pipelines/common/controlgallery-android.yml @@ -32,14 +32,14 @@ steps: inputs: targetType: 'filePath' filePath: 'build.sh' - arguments: --target cg-android --ANDROID_RENDERERS="$(renderers)" --GoogleMapsAPIKey="$(GoogleMapsAPIKey)" --BUILD_CONFIGURATION=$(BuildConfiguration) + arguments: --target cg-android --ANDROID_RENDERERS="$(renderers)" --GoogleMapsAPIKey="$(GoogleMapsAPIKey)" --configuration=$(BuildConfiguration) - task: Bash@3 displayName: 'Build Android UITests' inputs: targetType: 'filePath' filePath: 'build.sh' - arguments: --target cg-android-build-tests --BUILD_CONFIGURATION=$(BuildConfiguration) + arguments: --target cg-android-build-tests --configuration=$(BuildConfiguration) - task: CopyFiles@2 displayName: 'Copy Android Files for UITest' diff --git a/eng/pipelines/common/controlgallery-ios.yml b/eng/pipelines/common/controlgallery-ios.yml index 125d41b9fce5..0f6e2d6a9d0e 100644 --- a/eng/pipelines/common/controlgallery-ios.yml +++ b/eng/pipelines/common/controlgallery-ios.yml @@ -52,14 +52,14 @@ steps: inputs: targetType: 'filePath' filePath: 'build.sh' - arguments: --target cg-ios --BUILD_CONFIGURATION=$(BuildConfiguration) + arguments: --target cg-ios --configuration=$(BuildConfiguration) - task: Bash@3 displayName: 'Build iOS UITests Tests' inputs: targetType: 'filePath' filePath: 'build.sh' - arguments: --target cg-ios-build-tests --BUILD_CONFIGURATION=$(BuildConfiguration) + arguments: --target cg-ios-build-tests --configuration=$(BuildConfiguration) - task: CopyFiles@2 displayName: 'Copy iOS Files for UITest' diff --git a/eng/pipelines/common/controlgallery-windows.yml b/eng/pipelines/common/controlgallery-windows.yml new file mode 100644 index 000000000000..c7cc08578b3e --- /dev/null +++ b/eng/pipelines/common/controlgallery-windows.yml @@ -0,0 +1,25 @@ +steps: + - checkout: self + clean: true + + - task: xamops.azdevex.provisionator-task.provisionator@1 + displayName: 'Provisionator' + condition: eq(variables['provisioning'], 'true') + inputs: + provisioning_script: $(provisionator.path) + provisioning_extra_args: $(provisionator.extraArguments) + + - powershell: | + $(System.DefaultWorkingDirectory)/build.ps1 --target provision --TeamProject="$(System.TeamProject)" + displayName: 'Cake Provision' + condition: eq(variables['provisioningCake'], 'true') + + - powershell: | + $(System.DefaultWorkingDirectory)/build.ps1 --target VS-WINUI --TeamProject="$(System.TeamProject)" + displayName: 'Build WinUI Solution' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: ${{ parameters.artifactsName }}' + condition: always() + inputs: + ArtifactName: WINUI diff --git a/eng/pipelines/common/device-tests-steps.yml b/eng/pipelines/common/device-tests-steps.yml index 4abd1f769497..35dbfe2ae121 100644 --- a/eng/pipelines/common/device-tests-steps.yml +++ b/eng/pipelines/common/device-tests-steps.yml @@ -51,7 +51,7 @@ steps: packageType: 'sdk' - pwsh: | - ./build.ps1 --target=BuildTasks --BUILD_CONFIGURATION=Debug --Build_ArtifactStagingDirectory="$(Build.ArtifactStagingDirectory)" + ./build.ps1 --target=BuildTasks --configuration=Debug --Build_ArtifactStagingDirectory="$(Build.ArtifactStagingDirectory)" name: winbuild displayName: 'Build the MSBuild Tasks' diff --git a/eng/pipelines/common/localization-handback.yml b/eng/pipelines/common/localization-handback.yml new file mode 100644 index 000000000000..38289e8bb571 --- /dev/null +++ b/eng/pipelines/common/localization-handback.yml @@ -0,0 +1,84 @@ + +stages: + - stage: localization_handback + displayName: Localization Handback + dependsOn: [] + condition: and(succeeded(), eq(variables.isLocBranch, true)) + + jobs: + - job : generate_resx + displayName: 'Process incoming translations' + pool: $(HostedWinVS2019) + steps: + - checkout: self + persistCredentials: true + clean: true + + - powershell: | + #-- Import Invoke-Git Module function + Import-Module $(Build.SourcesDirectory)\eng\automation\scripts\Invoke-Git.psm1 -Force -DisableNameChecking + git config user.email "vs-mobiletools-engineering-service2@microsoft.com" + git config user.name "VS Mobile Engineering Serice Account" + Invoke-Git checkout main + Invoke-Git merge origin/$(LocBranch) --no-commit + displayName: 'Merge loc Branch' + + - task: cesve.one-loc-build.one-loc-build.OneLocBuild@2 + displayName: 'Localization Build' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + locProj: 'eng/automation/LocProject.json' + outDir: '$(Build.ArtifactStagingDirectory)' + packageSourceAuth: patAuth + patVariable: "$(OneLocBuildPAT)" + isCreatePrSelected: false + repoType: gitHub + prSourceBranchPrefix: $(LocBranchPrefix) + gitHubPatVariable: '$(GitHub.Token)' + gitHubPrMergeMethod: merge + + - powershell: | + #-- Import Invoke-Git Module function + Import-Module $(Build.SourcesDirectory)\eng\automation\scripts\Invoke-Git.psm1 -Force -DisableNameChecking + #--Clear Stage + Invoke-Git reset HEAD -- . + #-- Create new branch + $branchName = "$(LocBranchPrefix)/$(new-guid)" + Invoke-Git checkout -B ${branchName} + Write-Host ("##vso[task.setvariable variable=HANDBACK_BRANCH_NAME;]$branchName") + #-- Stage Build Changes + Invoke-Git add src + #-- Only commit/push if there are changed files. + $changedFiles = $(git status --porcelain | Measure-Object | Select-Object -expand Count) + if ($changedFiles -gt 0) + { + #-- Commit Changes locally + Invoke-Git commit -m "[LOC_HB] string translations" --no-verify + #-- Push changes to VSTS + Invoke-Git push origin HEAD:${branchName} + } + displayName: 'Commit updates' + + - powershell: | + $payload=@{ + title = "[LOC_HB] checkin of localized string files" + head = "$(HANDBACK_BRANCH_NAME)" + base = "main" + maintainer_can_modify = $true + } + + $headers = @{ Authorization = "token $(GitHub.Token)" } + + # let it throw + $response = Invoke-WebRequest -UseBasicParsing -Method POST -Headers $headers -Uri "https://api.github.com/repos/dotnet/maui/pulls" -Body ($payload | ConvertTo-json) + $newPr = $response.Content | ConvertFrom-Json + + Write-Host "Response is $newPr" + displayName: Open Pull Request + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' diff --git a/eng/pipelines/common/localization-handoff.yml b/eng/pipelines/common/localization-handoff.yml new file mode 100644 index 000000000000..c026de5a823b --- /dev/null +++ b/eng/pipelines/common/localization-handoff.yml @@ -0,0 +1,27 @@ +stages: + - stage: localization_handoff + displayName: Localization Handoff + dependsOn: [] + condition: and(succeeded(), eq(variables.isMainBranch, true)) + + jobs: + - job : generate_lci + displayName: 'Process outgoing strings' + pool: $(HostedWinVS2019) + steps: + + - task: cesve.one-loc-build.one-loc-build.OneLocBuild@2 + displayName: 'Localization Build' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + locProj: 'eng/automation/LocProject.json' + outDir: '$(Build.ArtifactStagingDirectory)' + packageSourceAuth: patAuth + patVariable: "$(OneLocBuildPAT)" + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' \ No newline at end of file diff --git a/eng/pipelines/common/merge-translations-update.yml b/eng/pipelines/common/merge-translations-update.yml new file mode 100644 index 000000000000..fd5b4944548d --- /dev/null +++ b/eng/pipelines/common/merge-translations-update.yml @@ -0,0 +1,37 @@ +stages: + - stage: merge_translations_updates + displayName: 'Merge Translations Updates' + dependsOn: [] + condition: and( succeeded(), and( eq(variables.isTargetMainBranch, true), variables.isLocPRBranch ) ) + + jobs: + - job : validate_merge + displayName: 'Validate and Merge Translations' + pool: + name: XamarinForms + variables: + pull_request_number: $(System.PullRequest.PullRequestNumber) + workspace: + clean: all + + steps: + - powershell: | + Write-Host "Validating translations for PR# $(System.PullRequest.PullRequestNumber)" + $srcDir = "$(Build.SourcesDirectory)/maui" + $matches = Select-String -Path "$srcDir/**/*.resx" -Pattern '\[.*\]\s\(https:.*\)' -AllMatches + $matchCount = ($matches | Measure-Object -Line).Lines + Write-Host "Found $matchCount violations." + $matches | Write-Host + if( ($matches | Measure-Object -Line).Lines -eq 0 ) { + Write-Host "Quality Gate Succeeded." + } else { + throw "Quality Gate Failure : Check the logs for details." + } + displayName: 'Validate Markdown Urls' + - task: github-merge-pr@1 + inputs: + github_token: $(GitHub.Token) + repository: 'dotnet/maui' + pr_number: $(pull_request_number) + merge_method: 'rebase' + displayName: Merge PR# $(System.PullRequest.PullRequestNumber) diff --git a/eng/pipelines/common/security_compliance.yml b/eng/pipelines/common/security_compliance.yml new file mode 100644 index 000000000000..efb7a190b2b8 --- /dev/null +++ b/eng/pipelines/common/security_compliance.yml @@ -0,0 +1,43 @@ +stages: + - stage: security_compliance + displayName: Security and Compliance checks + jobs: + - job: run_policheck_security_compliance + displayName: 'Policheck And Credentials Compliance' + pool: $(HostedWinVS2019) + timeoutInMinutes: 60 + cancelTimeoutInMinutes: 5 + steps: + - checkout: self + + - template: security/policheck/v1.yml@xamarin-templates + + - template: security/xa-static-analysis/v2.yml@xamarin-templates + parameters: + credScanSuppressionsFile: $(System.DefaultWorkingDirectory)\eng\automation\CredScanSuppressions.json + + - task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3 + displayName: Run AntiMalware (Defender) Scan + condition: succeededOrFailed() + inputs: + FileDirPath: $(System.DefaultWorkingDirectory) + EnableServices: true + + - task: securedevelopmentteam.vss-secure-development-tools.build-task-report.SdtReport@1 + displayName: Create Security Analysis Report + condition: succeededOrFailed() + inputs: + AllTools: true + + - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2 + displayName: Publish Security Analysis Logs + condition: succeededOrFailed() + inputs: + ArtifactName: CodeAnalysisLogs + + - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1 + displayName: Fail Job if Security Issues are Detected + condition: succeededOrFailed() + inputs: + AllTools: true + diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index 6008d82e3648..2c22bf731cc5 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -6,4 +6,35 @@ variables: - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE value: true - name: DOTNET_VERSION - value: 5.0.102 \ No newline at end of file + value: 5.0.201 +- name: LocBranchPrefix + value: 'loc-hb' +- name: LocBranch + value: 'loc' +- name: isMainBranch + value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')] +- name: isLocBranch + value: $[eq(variables['Build.SourceBranch'], 'refs/heads/loc')] +- name: isTargetMainBranch + value: $[eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/main')] +- name: isTargetLocBranch + value: $[eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/loc')] +- name: isLocPRBranch + value: $[startsWith(variables['System.PullRequest.SourceBranch'], 'loc-hb')] +- name: isPullRequest + value: $[eq(variables['Build.Reason'], 'PullRequest')] +# Common Agent Pools in use +- name: HostedWinVS2019 + value: Hosted Windows 2019 with VS2019 +- name: LogDirectory + value: $(Build.ArtifactStagingDirectory)/logs +- name: provisionator.xcode + value: '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx' +- name: provisionator.path + value: '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx' +- name: provisionator.vs2019 + value: '$(System.DefaultWorkingDirectory)/eng/provisioning/vs2019.csx' +- name: provisionator.extraArguments + value: '--v' +- name: DotNet.Path + value: $(System.DefaultWorkingDirectory)/bin/dotnet/dotnet diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index 309ab8bea072..7d646fc460e9 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -2,6 +2,8 @@ trigger: branches: include: - main + - release/* + - loc tags: include: - '*' @@ -23,6 +25,7 @@ pr: branches: include: - main + - release/* paths: include: - '*' @@ -46,16 +49,6 @@ schedules: variables: - template: /eng/pipelines/common/variables.yml - - name: LogDirectory - value: $(Build.ArtifactStagingDirectory)/logs - - name: provisionator.xcode - value: '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx' - - name: provisionator.path - value: '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx' - - name: provisionator.extraArguments - value: '--v' - - name: DotNet.Path - value: $(System.DefaultWorkingDirectory)/bin/dotnet/dotnet parameters: - name: BuildEverything @@ -129,6 +122,27 @@ stages: steps: - template: common/build-windows.yml + # - stage: windows_controlgallery + # displayName: Build Windows ControlGallery + # dependsOn: [] + # jobs: + # - ${{ each BuildCondition in parameters.BuildConfigurations }}: + # - job: win_hosted_${{ BuildCondition }} + # workspace: + # clean: all + # displayName: Build Windows Phase (${{ BuildCondition }}) + # condition: or( + # ${{ parameters.BuildEverything }}, + # ne(variables['Build.Reason'], 'PullRequest'), + # eq('${{ BuildCondition }}', 'Release')) + # timeoutInMinutes: 60 + # pool: + # name: $(vs2019VmPool) + # vmImage: $(vs2019VmImage) + # demands: [ msbuild ] + # steps: + # - template: common/controlgallery-windows.yml + - stage: build_osx displayName: iOS dependsOn: [] @@ -144,10 +158,6 @@ stages: demands: - sh - Xamarin.iOS - variables: - provisionator.xcode : '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx' - provisionator.path : '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx' - provisionator.extraArguments : '--v' steps: - template: common/controlgallery-ios.yml @@ -166,9 +176,6 @@ stages: variables: renderers: 'FAST' outputfolder: 'newRenderers' - provisionator.xcode : '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx' - provisionator.path : '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx' - provisionator.extraArguments : '--v' steps: - template: common/controlgallery-android.yml @@ -187,6 +194,25 @@ stages: vmImage: ${{ BuildPlatform.vmImage }} steps: - ${{ if eq(BuildPlatform.name, 'macos') }}: + - task: xamops.azdevex.provisionator-task.provisionator@1 + displayName: 'Provision Xcode' + condition: ne(variables['REQUIRED_XCODE'], '') + inputs: + provisioning_script: $(provisionator.xcode) + + - task: xamops.azdevex.provisionator-task.provisionator@1 + displayName: 'Provisionator' + condition: eq(variables['provisioning'], 'true') + inputs: + provisioning_script: $(provisionator.xcode) + provisioning_extra_args: $(provisionator.extraArguments) + + - script: | + echo "##vso[task.prependpath]/Library/Frameworks/Mono.framework/Versions/Current/Commands/" + echo "##vso[task.prependpath]~/Library/Developer/Xamarin/android-sdk-macosx" + displayName: 'Setup SDK Paths' + condition: ne(variables['osx2019VmPool'], 'Azure Pipelines') + - bash: | set -x mkdir -p ~/Library/Preferences/Xamarin @@ -194,9 +220,20 @@ stages: /usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist || true cat ~/Library/Preferences/Xamarin/Settings.plist || true displayName: configure vsmac xcode - - pwsh: ./eng/package.ps1 -configuration Release + + - script: echo '##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_11_X64)' + displayName: set JI_JAVA_HOME + + - ${{ if eq(BuildPlatform.name, 'windows') }}: + - task: xamops.azdevex.provisionator-task.provisionator@1 + displayName: 'Provision VSWindows' + inputs: + provisioning_script: $(provisionator.vs2019) + + - script: dotnet tool restore + displayName: install dotnet tools + - script: dotnet cake --configuration=Release displayName: pack nugets - errorActionPreference: stop - task: CopyFiles@2 displayName: 'Copy SignList.xml Files' inputs: @@ -208,6 +245,14 @@ stages: **/SignList.xml TargetFolder: $(build.artifactstagingdirectory) flattenFolders: true + - task: CopyFiles@2 + displayName: 'Copy Bin Log Files' + condition: always() + inputs: + Contents: | + **/*.binlog + TargetFolder: $(build.artifactstagingdirectory) + flattenFolders: true - task: PublishBuildArtifacts@1 condition: always() displayName: publish artifacts @@ -234,6 +279,25 @@ stages: vmImage: ${{ BuildPlatform.vmImage }} steps: - ${{ if eq(BuildPlatform.name, 'macos') }}: + - task: xamops.azdevex.provisionator-task.provisionator@1 + displayName: 'Provision Xcode' + condition: ne(variables['REQUIRED_XCODE'], '') + inputs: + provisioning_script: $(provisionator.xcode) + + - task: xamops.azdevex.provisionator-task.provisionator@1 + displayName: 'Provisionator' + condition: eq(variables['provisioning'], 'true') + inputs: + provisioning_script: $(provisionator.xcode) + provisioning_extra_args: $(provisionator.extraArguments) + + - script: | + echo "##vso[task.prependpath]/Library/Frameworks/Mono.framework/Versions/Current/Commands/" + echo "##vso[task.prependpath]~/Library/Developer/Xamarin/android-sdk-macosx" + displayName: 'Setup SDK Paths' + condition: ne(variables['osx2019VmPool'], 'Azure Pipelines') + - bash: | set -x mkdir -p ~/Library/Preferences/Xamarin @@ -241,6 +305,15 @@ stages: /usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist || true cat ~/Library/Preferences/Xamarin/Settings.plist || true displayName: configure vsmac xcode + - script: echo '##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_11_X64)' + displayName: set JI_JAVA_HOME + + - ${{ if eq(BuildPlatform.name, 'windows') }}: + - task: xamops.azdevex.provisionator-task.provisionator@1 + displayName: 'Provision VSWindows' + inputs: + provisioning_script: $(provisionator.vs2019) + - pwsh: | & dotnet build src/DotNet/DotNet.csproj -bl:$(LogDirectory)/$(BuildConfiguration)-dotnet.binlog & $(DotNet.Path) build Microsoft.Maui.BuildTasks-net6.sln -c $(BuildConfiguration) -bl:$(LogDirectory)/$(BuildConfiguration)-buildtasks.binlog @@ -268,18 +341,25 @@ stages: android: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests.Android/Core.DeviceTests.Android.csproj ios: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests.iOS/Core.DeviceTests.iOS.csproj - # only sign using the private server - - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: + stages: + + - template: common/security_compliance.yml + - template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff] + - template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback] + - template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback] + + - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: # Sign only using the private server - stage: nuget_signing dependsOn: pack_net6 displayName: Sign Nuget jobs: - template: sign-artifacts/jobs/v2.yml@xamarin-templates parameters: + signType: Real teamName: Maui usePipelineArtifactTasks: false targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed signedArtifactName: nuget signedArtifactPath: signed displayName: Sign Phase - condition: and(succeeded(), ne(variables['signVmImage'], ''), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'],'refs/tags/')))) + condition: and(succeeded(), ne(variables['signVmImage'], ''), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') )))) diff --git a/eng/provisioning/vs2019.csx b/eng/provisioning/vs2019.csx new file mode 100644 index 000000000000..1bb309184723 --- /dev/null +++ b/eng/provisioning/vs2019.csx @@ -0,0 +1,4 @@ +VisualStudio (VisualStudioChannel.Preview, VisualStudioTier.Enterprise, 16, @"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview", true) + .Workload (VisualStudioWorkload.ManagedDesktop) + .Workload (VisualStudioWorkload.NetCrossPlat) + .Workload (VisualStudioWorkload.Universal); \ No newline at end of file diff --git a/eng/scripts/generate-docs.ps1 b/eng/scripts/generate-docs.ps1 deleted file mode 100644 index 9364c14b3586..000000000000 --- a/eng/scripts/generate-docs.ps1 +++ /dev/null @@ -1,164 +0,0 @@ -param( - [string]$branch = "master", - [string]$token -) - -# Yes, this is ignoring the parameter passed in by VSTS; we don't need the -# parameter, but we can't remove it until all the active branches don't need it -$branch = "master" - -$mdoc = '..\..\build\tools\mdoc\mdoc.exe' -$docsUri = "https://$token@github.com/xamarin/Xamarin.Forms-api-docs.git" - -function StripNodes { - Param($file, $xpaths) - - [xml]$xml = Get-Content $file -Encoding UTF8 - - $xpaths | % { - - $node = $xml.SelectSingleNode($_) - - while ($node -ne $null) { - $x = $node.ParentNode.RemoveChild($node) - $node = $xml.SelectSingleNode($_) - } - - } - - $utf8WithoutBom = New-Object System.Text.UTF8Encoding($false) - $streamWriter = New-Object System.IO.StreamWriter($file, $false, $utf8WithoutBom) - - $xml.Save($streamWriter) - $streamWriter.Close() -} - -function ScrubIndex { - Param($indexPath) - - [xml]$index = Get-Content $indexPath -Encoding UTF8 - - $nameSpaces = $index.SelectNodes("//Namespace") - - $nameSpaces | % { - $folder = $_.Name - $types = $_.Type - - $types | % { - $typeName = $_.Name - - $path = Join-Path (Get-Location) "docs\$($folder)\$($typeName).xml" - - if(-not (Test-Path $path)) { - $selector = "//Namespace[@Name='$($folder)']/Type[@Name='$($typeName)']" - $toRemove = $index.SelectSingleNode($selector) - - if($toRemove -ne $null) { - $removed = $toRemove.ParentNode.RemoveChild($toRemove) - } - } - } - } - - $index.Save((Join-Path (Get-Location) $indexPath)) -} - -pushd ..\.. - -if(test-path docstemp){ del docstemp -Recurse -Force } -mkdir docstemp -pushd docstemp - -# Default Language Stuff -# Clone Xamarin.Forms-api-docs in docstemp\Xamarin.Forms-api-docs -git clone -qb $branch --single-branch $docsUri - -pushd .\Xamarin.Forms-api-docs - -# Run mdoc -& $mdoc export-msxdoc .\docs - -# Put the results in the docs folder (where NuGet will find it) -mv Xamarin.Forms.*.xml ..\..\build\docs -Force - -# Return from the default language folder -popd - -# Translations stuff - -$translations = -@{"lang" = "de-de"; "target" = "de"}, -@{"lang" = "es-es"; "target" = "es"}, -@{"lang" = "fr-fr"; "target" = "fr"}, -@{"lang" = "it-it"; "target" = "it"}, -@{"lang" = "ja-jp"; "target" = "ja"}, -@{"lang" = "ko-kr"; "target" = "ko"}, -@{"lang" = "pt-br"; "target" = "pt-BR"}, -@{"lang" = "ru-ru"; "target" = "ru"}, -@{"lang" = "zh-cn"; "target" = "zh-Hans"}, -@{"lang" = "zh-tw"; "target" = "zh-Hant"} - -#@{"lang" = "cs-cz"; "target" = "cs"}, -#@{"lang" = "pl-pl"; "target" = "pl"}, -#@{"lang" = "tr-tr"; "target" = "tr"}, - -$branch = "live" - -$translations | % { - # Generate the URI for each translated version - $translationUri = "https://$token@github.com/xamarin/Xamarin.Forms-api-docs.$($_.lang).git" - $translationFolder = ".\Xamarin.Forms-api-docs.$($_.lang)" - - # Clone the translation repo - git clone -qb $branch --single-branch $translationUri - - # Go into the language-specific folder - pushd $translationFolder\docs - - # Copy everything over the stuff in the default language folder - # (So untranslated bits still remain in the default language) - copy-item -Path . -Destination ..\..\Xamarin.Forms-api-docs -Recurse -Force - - # Return from the language-specific folder - popd - - # Go into the default language folder - pushd .\Xamarin.Forms-api-docs - - # Clean up the index so it's not trying to convert missing docs - Write-Host "Cleaning up the index for $($_.lang)" - ScrubIndex .\docs\index.xml - - Write-Host "Stripping out unused XML for $($_.lang)" - - dir .\docs -R *.xml -Exclude ns-*.xml | Select -ExpandProperty FullName | % { - - $xpaths = "//remarks", - "//summary[text()='To be added.']", - "//param[text()='To be added.']", - "//returns[text()='To be added.']", - "//typeparam[text()='To be added.']", - "//value[text()='To be added.']", - "//related", - "//example" - - StripNodes $_ $xpaths - } - - # Run mdoc - & $mdoc export-msxdoc .\docs - - # And put the results in the language specific folder under docs - $dest = "..\..\docs\$($_.target)" - mkdir $dest - mv Xamarin.Forms.*.xml $dest -Force - - # Return from the default language folder - popd -} - -popd - -del docstemp -R -Force - -popd \ No newline at end of file diff --git a/src/BlazorWebView/src/core/Android/AndroidWebKitWebViewManager.cs b/src/BlazorWebView/src/core/Android/AndroidWebKitWebViewManager.cs index 877ee8deded9..f42161616988 100644 --- a/src/BlazorWebView/src/core/Android/AndroidWebKitWebViewManager.cs +++ b/src/BlazorWebView/src/core/Android/AndroidWebKitWebViewManager.cs @@ -1,8 +1,8 @@ -using Android.Webkit; -using AWebView = Android.Webkit.WebView; -using Microsoft.Extensions.FileProviders; -using System; +using System; using System.IO; +using Android.Webkit; +using Microsoft.Extensions.FileProviders; +using AWebView = Android.Webkit.WebView; namespace Microsoft.AspNetCore.Components.WebView.Maui { diff --git a/src/BlazorWebView/src/core/Android/BlazorWebViewHandler.Android.cs b/src/BlazorWebView/src/core/Android/BlazorWebViewHandler.Android.cs index 569531f29387..02e53bf703f9 100644 --- a/src/BlazorWebView/src/core/Android/BlazorWebViewHandler.Android.cs +++ b/src/BlazorWebView/src/core/Android/BlazorWebViewHandler.Android.cs @@ -1,10 +1,10 @@ -using Android.Webkit; -using static Android.Views.ViewGroup; -using AWebView = Android.Webkit.WebView; +using System; +using System.Collections.ObjectModel; +using Android.Webkit; using Microsoft.Extensions.FileProviders; using Microsoft.Maui.Handlers; -using System; -using System.Collections.ObjectModel; +using static Android.Views.ViewGroup; +using AWebView = Android.Webkit.WebView; using Path = System.IO.Path; namespace Microsoft.AspNetCore.Components.WebView.Maui diff --git a/src/BlazorWebView/src/core/Android/WebKitWebViewClient.cs b/src/BlazorWebView/src/core/Android/WebKitWebViewClient.cs index 4428535f1806..40c6cc674379 100644 --- a/src/BlazorWebView/src/core/Android/WebKitWebViewClient.cs +++ b/src/BlazorWebView/src/core/Android/WebKitWebViewClient.cs @@ -1,9 +1,9 @@ -using Android.Runtime; -using Android.Webkit; -using AWebView = Android.Webkit.WebView; -using System; +using System; using System.Collections.Generic; using System.Linq; +using Android.Runtime; +using Android.Webkit; +using AWebView = Android.Webkit.WebView; namespace Microsoft.AspNetCore.Components.WebView.Maui { diff --git a/src/BlazorWebView/src/core/IBlazorWebView.cs b/src/BlazorWebView/src/core/IBlazorWebView.cs index 8b11403c5b2a..0b4541e58d21 100644 --- a/src/BlazorWebView/src/core/IBlazorWebView.cs +++ b/src/BlazorWebView/src/core/IBlazorWebView.cs @@ -1,6 +1,6 @@ -using Microsoft.Maui; -using System; +using System; using System.Collections.ObjectModel; +using Microsoft.Maui; namespace Microsoft.AspNetCore.Components.WebView.Maui { diff --git a/src/BlazorWebView/src/core/MauiDispatcher.cs b/src/BlazorWebView/src/core/MauiDispatcher.cs index 125063f591a8..7eb6b811161c 100644 --- a/src/BlazorWebView/src/core/MauiDispatcher.cs +++ b/src/BlazorWebView/src/core/MauiDispatcher.cs @@ -1,6 +1,6 @@ -using Microsoft.Maui.Controls; -using System; +using System; using System.Threading.Tasks; +using Microsoft.Maui.Controls; namespace Microsoft.AspNetCore.Components.WebView.Maui { diff --git a/src/BlazorWebView/src/core/RootComponent.cs b/src/BlazorWebView/src/core/RootComponent.cs index 07cf5e6c16b7..92ecada35b7f 100644 --- a/src/BlazorWebView/src/core/RootComponent.cs +++ b/src/BlazorWebView/src/core/RootComponent.cs @@ -1,11 +1,11 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.WebView; using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.WebView; namespace Microsoft.AspNetCore.Components.WebView.Maui { diff --git a/src/BlazorWebView/src/core/iOS/BlazorWebViewHandler.iOS.cs b/src/BlazorWebView/src/core/iOS/BlazorWebViewHandler.iOS.cs index 55fc07bb8c9b..ef2d8a73f741 100644 --- a/src/BlazorWebView/src/core/iOS/BlazorWebViewHandler.iOS.cs +++ b/src/BlazorWebView/src/core/iOS/BlazorWebViewHandler.iOS.cs @@ -1,17 +1,17 @@ -using Foundation; -using UIKit; -using WebKit; -using RectangleF = CoreGraphics.CGRect; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.IO; using System.Linq; +using Foundation; using Microsoft.Extensions.FileProviders; using Microsoft.Maui.Controls; -using Microsoft.Maui.Handlers; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Handlers; +using UIKit; +using WebKit; +using RectangleF = CoreGraphics.CGRect; namespace Microsoft.AspNetCore.Components.WebView.Maui { diff --git a/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs b/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs index 93c21a8a0533..8f183d9f9a68 100644 --- a/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs +++ b/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs @@ -10,6 +10,7 @@ using Microsoft.Maui.Controls.Internals; using System.Threading.Tasks; using System.Net.Http; +using Microsoft.Maui.Handlers; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Android { @@ -56,7 +57,7 @@ protected override void OnCreate(Bundle bundle) FormsMaps.Init(this, bundle); #if ENABLE_TEST_CLOUD - Handlers.ViewHandler + ViewHandler .ViewMapper[nameof(IView.AutomationId)] = (h, v) => { ((global::Android.Views.View)h.NativeView).ContentDescription = v.AutomationId; diff --git a/src/Compatibility/ControlGallery/src/Android/_1909CustomRenderer.cs b/src/Compatibility/ControlGallery/src/Android/_1909CustomRenderer.cs index 620215f87a93..091e77a916bd 100644 --- a/src/Compatibility/ControlGallery/src/Android/_1909CustomRenderer.cs +++ b/src/Compatibility/ControlGallery/src/Android/_1909CustomRenderer.cs @@ -6,6 +6,7 @@ using Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; using Microsoft.Maui.Controls.Compatibility; +using Microsoft.Maui.Controls.Compatibility.Platform.Android; [assembly: ExportRenderer(typeof(Issue1909.FlatButton), typeof(FlatButtonRenderer))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Android @@ -30,7 +31,7 @@ protected override void OnElementChanged(Microsoft.Maui.Controls.Compatibility.P var nativeButton = (global::Android.Widget.Button)Control; nativeButton.SetShadowLayer(0, 0, 0, global::Android.Graphics.Color.Transparent); - Microsoft.Maui.Controls.Compatibility.Platform.Android.ViewExtensions.SetElevation(nativeButton, 0); + ElevationHelper.SetElevation(nativeButton, 0); } } } diff --git a/src/Compatibility/ControlGallery/src/Core/Compatibility.ControlGallery.Core-net6.csproj b/src/Compatibility/ControlGallery/src/Core/Compatibility.ControlGallery.Core-net6.csproj index b32645ecd9bc..b0181fb7ffa8 100644 --- a/src/Compatibility/ControlGallery/src/Core/Compatibility.ControlGallery.Core-net6.csproj +++ b/src/Compatibility/ControlGallery/src/Core/Compatibility.ControlGallery.Core-net6.csproj @@ -20,7 +20,7 @@ 0114;0108;0109;4014;0649;0169;0472;0414;0168;0219;0429 - $(DefineConstants);__UWP__ + $(DefineConstants);WINDOWS diff --git a/src/Compatibility/ControlGallery/src/Core/Compatibility.ControlGallery.Core.csproj b/src/Compatibility/ControlGallery/src/Core/Compatibility.ControlGallery.Core.csproj index 47c155fd1d0f..ac6a7f0086c6 100644 --- a/src/Compatibility/ControlGallery/src/Core/Compatibility.ControlGallery.Core.csproj +++ b/src/Compatibility/ControlGallery/src/Core/Compatibility.ControlGallery.Core.csproj @@ -20,7 +20,7 @@ 0114;0108;0109;4014;0649;0169;0472;0414;0168;0219;0429 - $(DefineConstants);__UWP__ + $(DefineConstants);WINDOWS diff --git a/src/Compatibility/ControlGallery/src/Core/CoreGalleryPages/ButtonCoreGalleryPage.cs b/src/Compatibility/ControlGallery/src/Core/CoreGalleryPages/ButtonCoreGalleryPage.cs index a0a74898dd9f..4ef1ea919fe9 100644 --- a/src/Compatibility/ControlGallery/src/Core/CoreGalleryPages/ButtonCoreGalleryPage.cs +++ b/src/Compatibility/ControlGallery/src/Core/CoreGalleryPages/ButtonCoreGalleryPage.cs @@ -85,7 +85,7 @@ protected override void Build(StackLayout stackLayout) new Button { Text = "Font", - Font = Font.SystemFontOfSize(NamedSize.Large, FontAttributes.Bold) + Font = Font.SystemFontOfSize(Device.GetNamedSize(NamedSize.Micro, typeof(Button), false), FontWeight.Bold) } ); diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/ButtonGallery.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/ButtonGallery.cs index 2c2d598e7090..dcdb97fd8ae1 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/ButtonGallery.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/ButtonGallery.cs @@ -47,7 +47,7 @@ public ButtonGallery() break; } - var font = Font.OfSize(fontName, NamedSize.Medium); + var font = Font.OfSize(fontName, Device.GetNamedSize(NamedSize.Medium, typeof(Button), false)); var themedButton = new Button { diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/CellTypeList.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/CellTypeList.cs index 6a517327b5be..7c0ea5f775cd 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/CellTypeList.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/CellTypeList.cs @@ -71,7 +71,7 @@ public CellTypeList() Navigation.PushAsync(cellNav.Page); _last = cellNav; -#if !__WINDOWS__ +#if !WINDOWS SelectedItem = null; #endif }; diff --git a/src/Compatibility/ControlGallery/src/EmbeddingTestBeds/Embedding.UWP/Embedding.UWP.csproj b/src/Compatibility/ControlGallery/src/EmbeddingTestBeds/Embedding.UWP/Embedding.UWP.csproj index 8fd741937aea..76e3504171ac 100644 --- a/src/Compatibility/ControlGallery/src/EmbeddingTestBeds/Embedding.UWP/Embedding.UWP.csproj +++ b/src/Compatibility/ControlGallery/src/EmbeddingTestBeds/Embedding.UWP/Embedding.UWP.csproj @@ -24,7 +24,7 @@ true bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full x86 @@ -34,7 +34,7 @@ bin\x86\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly @@ -47,7 +47,7 @@ true bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full ARM @@ -57,7 +57,7 @@ bin\ARM\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly @@ -70,7 +70,7 @@ true bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full x64 @@ -80,7 +80,7 @@ bin\x64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29363.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29363.cs index 701322999c8b..d051e4ac504e 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29363.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla29363.cs @@ -29,7 +29,7 @@ protected override void Init() Button modal = new Button { Text = "Modal Push Pop Test", - Font = Font.SystemFontOfSize(25, FontAttributes.Bold), + Font = Font.SystemFontOfSize(25, FontWeight.Bold), HorizontalOptions = LayoutOptions.Center }; modal.Clicked += async (object sender, EventArgs e) => diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla30353.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla30353.cs index 6e98e72eb23a..dfe0b388cc1f 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla30353.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla30353.cs @@ -125,7 +125,7 @@ public override void TearDown() void Back() { -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS RunningApp.Tap(q => q.Marked("Toggle")); #else RunningApp.Back(); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla40408.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla40408.cs index d01b091de0ff..eebfe248232c 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla40408.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla40408.cs @@ -124,7 +124,7 @@ void FlyoutPage1_Appearing(object sender, EventArgs e) } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void OnAppearingEvents() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla41271.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla41271.cs index 1c441877f0bb..a864181c60cc 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla41271.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla41271.cs @@ -123,7 +123,7 @@ protected override void Init() } } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS string Cell; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43519.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43519.cs index c43edf4afe6b..b61abd2650d6 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43519.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43519.cs @@ -79,7 +79,7 @@ protected override void Init() }); } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void TabbedModalNavigation() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43663.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43663.cs index bc85fb201c66..6dfce101dd09 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43663.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla43663.cs @@ -125,7 +125,7 @@ void ModalPopped(object sender, ModalPoppedEventArgs e) DisplayAlert("Popped", Message, Cancel); } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void ModalNavigation() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722.cs index a294f0951d59..17fab3f08822 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722.cs @@ -156,7 +156,7 @@ protected override void OnDisappearing() base.OnDisappearing(); } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void LabelsInListViewTemplatesShouldBeCollected() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722Xaml0.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722Xaml0.xaml.cs index a300e814290a..f0a22256a199 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722Xaml0.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla45722Xaml0.xaml.cs @@ -93,7 +93,7 @@ void RefreshModel() } } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void LabelsInListViewTemplatesShouldBeCollected() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla51825.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla51825.cs index 464b07ed82f4..be24c93b41c5 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla51825.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla51825.cs @@ -61,7 +61,7 @@ public void Bugzilla51825Test() // Windows App Driver and the Search Bar are a bit buggy // It randomly doesn't enter the first letter -#if !__WINDOWS__ +#if !WINDOWS Assert.AreEqual("Hello", label.ReadText()); #endif diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla58779.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla58779.cs index 42cd8fc890ac..d95400f334cc 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla58779.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla58779.cs @@ -25,7 +25,7 @@ protected override void Init() Button button = new Button { Text = "Click Here", - Font = Font.SystemFontOfSize(NamedSize.Large), + Font = Font.SystemFontOfSize(Device.GetNamedSize(NamedSize.Large, typeof(Button), false)), BorderWidth = 1, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.CenterAndExpand, diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla60122.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla60122.cs index 2ab8d2a18226..dee0fff61bdb 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla60122.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Bugzilla60122.cs @@ -52,7 +52,7 @@ public void HandleLongPress(object sender, EventArgs e) } } -#if UITEST && !__WINDOWS__ +#if UITEST && !WINDOWS // This test won't work on Windows right now because we can only test desktop, so touch events // (like LongPress) don't really work. The test should work manually on a touch screen, though. diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/DateTimePickerLocalizationTests.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/DateTimePickerLocalizationTests.cs index d73df7bd95a2..7b14d56cca93 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/DateTimePickerLocalizationTests.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/DateTimePickerLocalizationTests.cs @@ -59,7 +59,7 @@ public string DateString(String format, String date) public void TimePicker24H() { RunningApp.Tap(x => x.Marked("TimePicker")); -#if !__WINDOWS__ +#if !WINDOWS Assert.AreEqual("0.0.0 A", TimeString("H.m.s t", "0, 0")); Assert.AreEqual("13:05 PM", TimeString("HH:mm tt", "13, 5")); Assert.AreEqual("12 PM", TimeString("HH tt", "12, 0")); @@ -70,7 +70,7 @@ public void TimePicker24H() #endif } -#if !__WINDOWS__ +#if !WINDOWS [Test] public void TimePicker12H() { @@ -99,7 +99,7 @@ public void TimePickerOther() public void DatePickerDMY() { RunningApp.Tap(x => x.Marked("DatePicker")); -#if !__WINDOWS__ +#if !WINDOWS Assert.AreEqual("31/1/99", DateString("d/M/y", "1999, 1, 31")); Assert.AreEqual("02-29-00", DateString("MM-dd-yy", "2000, 2, 29")); Assert.AreEqual("2010, Apr, Thu", DateString("yyy, MMM, ddd", "2010, 4, 15")); @@ -118,7 +118,7 @@ public void DatePickerDMY() public void DatePickerMissing() { RunningApp.Tap(x => x.Marked("DatePicker")); -#if !__WINDOWS__ +#if !WINDOWS Assert.AreEqual("October 97", DateString("MMMM yy", "1997, 10, 30")); Assert.AreEqual("Monday", DateString("dddd", "2020, 7, 20")); Assert.AreEqual("2002: Dec", DateString("yyyy: MMM", "2002, 12, 31")); @@ -129,7 +129,7 @@ public void DatePickerMissing() #endif } -#if !__WINDOWS__ +#if !WINDOWS [Test] public void DatePickerLetters() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/GestureBubblingTests.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/GestureBubblingTests.cs index f3e276bc20a7..190b4d32c95f 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/GestureBubblingTests.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/GestureBubblingTests.cs @@ -163,7 +163,7 @@ from Layout element in layout.InternalChildren from Button button in element.InternalChildren let text = button.Text // UwpIgnore -#if __WINDOWS__ +#if WINDOWS where text != "Stepper" && text != "Entry" #endif select new object[] diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Helpers/UITestHelper.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Helpers/UITestHelper.cs index e57bc5bc32b7..2cef291b5e10 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Helpers/UITestHelper.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Helpers/UITestHelper.cs @@ -16,7 +16,7 @@ public static class UITestHelper { public static bool IsWindowClosedException(this Exception exc) { -#if __WINDOWS__ +#if WINDOWS return exc.Message?.Contains("Currently selected window has been closed") ?? false; #else return false; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1704.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1704.cs index 1cbbd5cf9233..fa62f79de7b4 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1704.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1704.cs @@ -490,7 +490,7 @@ public MiscPage() int.TryParse(_stressTestItertionEntry.Text, out _stressTestIterationCount); -#if __UWP__ +#if WINDOWS Task.Run(runStressTest); #else ThreadPool.QueueUserWorkItem(delegate diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1777.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1777.cs index d6c573757346..40bb71fb8300 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1777.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1777.cs @@ -83,7 +83,7 @@ void button_Clicked(object sender, EventArgs e) _pickerNormal.Items.Add("test " + _pickerNormal.Items.Count); } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void Issue1777Test() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1937.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1937.cs index b9df16e7980a..54b8ff6c9e74 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1937.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue1937.cs @@ -92,7 +92,7 @@ protected override void Init() }; } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void Issue1937Test () { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2339.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2339.cs index c9c6d7a5063c..9dad86b9d602 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2339.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2339.cs @@ -84,7 +84,7 @@ protected override void Init() #if UITEST [Test] -#if __WINDOWS__ +#if WINDOWS [Ignore("Focus Behavior is different on UWP")] #endif public void FocusAndUnFocusMultipleTimes() diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2399.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2399.cs index 3c3e78c8ecce..42bb5b24824a 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2399.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2399.cs @@ -15,7 +15,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues [Preserve(AllMembers = true)] [Issue(IssueTracker.Github, 2399, "Label Renderer Dispose never called")] -#if __WINDOWS__ +#if WINDOWS // this test works fine when ran manually but when executed through the test runner // it fails. Not sure the difference [NUnit.Framework.Category(Compatibility.UITests.UITestCategories.ManualReview)] diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2809.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2809.cs index 5def3e50233f..13ac49a6a570 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2809.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2809.cs @@ -47,7 +47,7 @@ void ShouldShowMenu() #if __ANDROID__ //show secondary menu RunningApp.TapOverflowMenuButton(); -#elif __WINDOWS__ +#elif WINDOWS RunningApp.Tap ("MoreButton"); #endif } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2894.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2894.cs index f53b62502987..cd68ded450bf 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2894.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2894.cs @@ -250,7 +250,7 @@ public void VariousSpanGesturePermutation() do { -#if __WINDOWS__ +#if WINDOWS RunningApp.TapCoordinates(target.X + target.Width - 10, target.Y + 2); #else RunningApp.TapCoordinates(target.X + target.CenterX, target.Y + 2); @@ -267,7 +267,7 @@ public void VariousSpanGesturePermutation() RunningApp.Tap($"TestSpan5"); RunningApp.TapCoordinates(target.X + 5, target.Y + 5); -#if __WINDOWS__ +#if WINDOWS RunningApp.TapCoordinates(target.X + target.Width - 10, target.Y + 2); #else RunningApp.TapCoordinates(target.X + target.CenterX, target.Y + 2); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2981.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2981.cs index 449e02833d1c..176c77ae2c57 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2981.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue2981.cs @@ -26,7 +26,7 @@ protected override void Init() Content = listView; } -#if UITEST && !__WINDOWS__ +#if UITEST && !WINDOWS // This test won't work on Windows right now because we can only test desktop, so touch events // (like LongPress) don't really work. The test should work manually on a touch screen, though. diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3139.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3139.cs index cadc03f42550..75bebeb4fa7f 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3139.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3139.cs @@ -44,7 +44,7 @@ protected override async void Init() await alertTask; } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void Issue3139Test () { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3652.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3652.cs index 14539c04d8dc..7b9a64772567 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3652.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3652.cs @@ -114,7 +114,7 @@ public class ListItemViewModel new Command(() => MessagingCenter.Send(this, "Remove", this)); } -#if UITEST && !__WINDOWS__ +#if UITEST && !WINDOWS [Test] public void TestRemovingContextMenuItems() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3840.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3840.cs index 3addb02634ce..d63b281e9f43 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3840.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue3840.cs @@ -87,7 +87,7 @@ public void TranslatingViewKeepsScrollViewPosition() RunningApp.WaitForElement(_failedText); RunningApp.Tap(_button1); RunningApp.Tap(_button2); -#if __WINDOWS__ +#if WINDOWS var label = RunningApp.WaitForElement(_failedText); Assert.AreEqual(0, label[0].Rect.Height); Assert.AreEqual(0, label[0].Rect.Width); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue4597.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue4597.cs index 587e820ea062..d1dd63b462e4 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue4597.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue4597.cs @@ -173,7 +173,7 @@ protected override void Init() } #if UITEST -#if !__WINDOWS__ +#if !WINDOWS [Test] public void ImageFromFileSourceAppearsAndDisappearsCorrectly() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue5412.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue5412.cs index cc474f2c425b..b586da07927c 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue5412.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue5412.cs @@ -25,7 +25,7 @@ protected override async void Init() await Navigation.PushModalAsync(new Issue5412MainPage()); } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void Issue5412Test() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue5886.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue5886.cs index 153d17f7e692..c43427fd82ec 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue5886.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue5886.cs @@ -79,7 +79,7 @@ void Button_Clicked1(object sender, EventArgs e) button1.IsVisible = true; } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void ReplaceRenderer() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue6323.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue6323.cs index f5ae1415403b..eec97bd03e4e 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue6323.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue6323.cs @@ -27,7 +27,7 @@ protected override void Init() }); } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS [Test] public void Issue6323Test() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue7167.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue7167.xaml.cs index 907936545e14..5216920205d0 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue7167.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue7167.xaml.cs @@ -6,7 +6,7 @@ using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Controls.Xaml; -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS using Xamarin.UITest; using Microsoft.Maui.Controls.Compatibility.UITests; using NUnit.Framework; @@ -40,7 +40,7 @@ void MyListView_OnItemSelected(object sender, SelectedItemChangedEventArgs e) } -#if UITEST && __WINDOWS__ +#if UITEST && WINDOWS const string ListViewId = "ListViewId"; const string AddCommandID = "AddCommandID"; const string ClearListCommandId = "ClearListCommandId"; diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue7181.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue7181.cs index 1f75166b50da..d1b2dfc83a42 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue7181.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue7181.cs @@ -60,7 +60,7 @@ protected override void Init() private void OnToolbarClicked() => _toolbarItem.Text = $"{AfterClickToolbarItemText} {_clicks++}"; -#if UITEST && (__ANDROID__ || __WINDOWS__) +#if UITEST && (__ANDROID__ || WINDOWS) [Test] public void ShellToolbarItemTests() { diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8821.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8821.cs index a4bbbbe6ef63..14fe4e0d5b6c 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8821.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8821.cs @@ -74,13 +74,7 @@ async Task CreateImage(string imageUrl) { var bytes = await DownloadImageAsync(imageUrl); - string path; - -#if WINDOWS_UWP - path = Windows.Storage.ApplicationData.Current.LocalFolder.Path; -#else - path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); -#endif + string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); SecondImageSource = IOPath.Combine(path, "Issue8821.gif"); File.WriteAllBytes(SecondImageSource, bytes); diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/TestPages/ScreenshotConditionalApp.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/TestPages/ScreenshotConditionalApp.cs index b6ce01d895d3..357f5f68a7d9 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/TestPages/ScreenshotConditionalApp.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/TestPages/ScreenshotConditionalApp.cs @@ -221,7 +221,7 @@ public void WaitFor(Func predicate, string timeoutMessage = "Timed out wai public AppResult WaitForFirstElement(string marked, string timeoutMessage = "Timed out waiting for element...", TimeSpan? timeout = null, TimeSpan? retryFrequency = null) { -#if __WINDOWS__ +#if WINDOWS return (_app as WinDriverApp).WaitForFirstElement(marked, timeoutMessage, timeout, retryFrequency); #else return _app.WaitForElement(marked, timeoutMessage, timeout, retryFrequency).FirstOrDefault(); @@ -463,7 +463,7 @@ public ITestServer TestServer get { return _app.TestServer; } } -#if __WINDOWS__ +#if WINDOWS public string ReadDatePicker(string marked) { return ((WinDriverApp)_app).ReadDatePicker(marked).ToString(); @@ -490,7 +490,7 @@ public void TestSetup(Type testType, bool isolate) UITestHelper.MarkTestInconclusiveIfNoInternetConnectionIsPresent(testType, _app); -#if __WINDOWS__ +#if WINDOWS RestartIfAppIsClosed(); #endif diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/TestPages/TestPages.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/TestPages/TestPages.cs index bacc0592a11d..77fa1324e935 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/TestPages/TestPages.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/TestPages/TestPages.cs @@ -55,7 +55,7 @@ static IApp InitializeApp() Xamarin.UITest.Desktop.TestAgent.Start(); app = InitializeMacOSApp(); -#elif __WINDOWS__ +#elif WINDOWS app = InitializeUWPApp(); #endif if (app == null) @@ -144,7 +144,7 @@ static IApp InitializeMacOSApp() } #endif -#if __WINDOWS__ +#if WINDOWS static IApp InitializeUWPApp() { return WindowsTestBase.ConfigureApp(); @@ -170,7 +170,7 @@ public static void NavigateToIssue(Type type, IApp app) int maxAttempts = 2; int attempts = 0; -#if __WINDOWS__ +#if WINDOWS bool attemptOneRestart = false; bool waitNoElementAttempt = false; #endif @@ -195,7 +195,7 @@ public static void NavigateToIssue(Type type, IApp app) } #endif -#if __WINDOWS__ +#if WINDOWS // Windows doens't have an 'invoke' option right now for us to do the more direct navigation // we're using for Android/iOS // So we're just going to use the 'Reset' method to bounce the app to the opening screen @@ -223,7 +223,7 @@ public static void NavigateToIssue(Type type, IApp app) app.WaitForElement(q => q.Raw("* marked:'SearchButton'")); app.Tap(q => q.Raw("* marked:'SearchButton'")); -#if __WINDOWS__ +#if WINDOWS try { if (!waitNoElementAttempt) @@ -243,7 +243,7 @@ public static void NavigateToIssue(Type type, IApp app) if (!app.RestartIfAppIsClosed()) return; } -#if __WINDOWS__ +#if WINDOWS catch (Exception we) when (we.IsWindowClosedException() && !attemptOneRestart) { @@ -573,7 +573,7 @@ public virtual void TearDown() public abstract class TestShell : Shell { protected const string FlyoutIconAutomationId = "OK"; -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS protected const string BackButtonAutomationId = "Back"; #else protected const string BackButtonAutomationId = "OK"; @@ -828,7 +828,7 @@ public void TapBackArrow(string backArrowIcon = BackButtonAutomationId) public void TapInFlyout(string text, string flyoutIcon = FlyoutIconAutomationId, bool usingSwipe = false, string timeoutMessage = null, bool makeSureFlyoutStaysOpen = false) { timeoutMessage = timeoutMessage ?? text; -#if __WINDOWS__ +#if WINDOWS RunningApp.WaitForElement(flyoutIcon); #endif diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/VisualControlsPage.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/VisualControlsPage.xaml.cs index e72b73e0539c..3627f7f2d728 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/VisualControlsPage.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/VisualControlsPage.xaml.cs @@ -38,7 +38,7 @@ protected override void Init() { } -#if UITEST && !__WINDOWS__ +#if UITEST && !WINDOWS [Test] public void LoadingVisualGalleryPageDoesNotCrash() { diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/BaseTestFixture.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/BaseTestFixture.cs index f14bb96c7db2..46e863fadb0c 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/BaseTestFixture.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/BaseTestFixture.cs @@ -1,8 +1,8 @@ using System; using System.Diagnostics; -using NUnit.Framework; using Microsoft.Maui.Controls.Compatibility.ControlGallery; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; +using NUnit.Framework; using Xamarin.UITest; using Xamarin.UITest.Queries; @@ -108,7 +108,7 @@ protected void ResetApp() #if __ANDROID__ App.Invoke("Reset"); #endif -#if __WINDOWS__ +#if WINDOWS WindowsTestBase.Reset(); #endif } diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/PlatformQueries.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/PlatformQueries.cs index c7fcfb18616f..b1bb682c437d 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/PlatformQueries.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/PlatformQueries.cs @@ -29,7 +29,7 @@ internal static class PlatformMethodQueries { View.ScaleProperty, Tuple.Create (new[] { "getLayerTransformString" }, true) }, }; -#elif __ANDROID__ || __WINDOWS__ +#elif __ANDROID__ || WINDOWS public static readonly Dictionary> PropertyPlatformMethodDictionary = new Dictionary > { @@ -86,7 +86,7 @@ internal static class PlatformViews public static readonly string TableView = "UITableView"; public static readonly string TimePicker = "UITextField"; public static readonly string WebView = "WKWebView"; -#elif __ANDROID__ || __WINDOWS__ +#elif __ANDROID__ || WINDOWS public static readonly string ActivityIndicator = "android.widget.ProgressBar"; public static readonly string BoxView = "xamarin.forms.platform.android.BoxRenderer"; public static readonly string Button = "android.widget.Button"; @@ -124,7 +124,7 @@ internal static class PlatformQueries public static readonly Func PageWithoutNavigationBar = q => q.Raw("*").Index(7); public static readonly Func NavigationBarBackButton = q => q.Class("UINavigationItemButtonView"); -#elif __ANDROID__ || __WINDOWS__ +#elif __ANDROID__ || WINDOWS public static readonly Func Root = q => q.Id("content"); public static readonly Func RootPageListView = q => q.Raw("ListViewRenderer index:0"); public static readonly Func GalleryListView = q => q.Raw("ListViewRenderer index:1"); diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Queries.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Queries.cs index 019c34a37d77..5d488eb216ac 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Queries.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Queries.cs @@ -112,7 +112,7 @@ internal static class Rects { public static AppRect RootViewRect(this IApp app) { -#if __WINDOWS__ +#if WINDOWS return app.Query(WinDriverApp.AppName)[0].Rect; #else return app.Query(q => q.Raw("* index:0"))[0].Rect; diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ActionSheetUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ActionSheetUITests.cs index 9d78d28062bd..c5cb97532539 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ActionSheetUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ActionSheetUITests.cs @@ -163,7 +163,7 @@ void ScrollAndTap(string actionSheet) { var queryString = $"* text:'{actionSheet}'"; Func actionSheetQuery = q => q.Raw(queryString); -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(actionSheetQuery); #elif __MACOS__ App.Tap(actionSheetQuery); diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ActivityIndicatorUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ActivityIndicatorUITests.cs index 88861cb41f8e..810c752b5e48 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ActivityIndicatorUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ActivityIndicatorUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -55,7 +55,7 @@ public void IsRunning() remote.GoTo(); #if __MACOS__ Assert.Inconclusive("Not tested yet"); -#elif __WINDOWS__ +#elif WINDOWS Assert.Inconclusive(PleaseInspect); #else var isRunning = remote.GetProperty(ActivityIndicator.IsRunningProperty); diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/BoxViewUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/BoxViewUITests.cs index dc69cd782ef3..e2ff61f6cded 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/BoxViewUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/BoxViewUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -54,12 +54,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -78,7 +78,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ButtonUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ButtonUITests.cs index 83ac4ad2bf25..a8fcdab27c73 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ButtonUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ButtonUITests.cs @@ -1,6 +1,6 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Graphics; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -126,7 +126,7 @@ public void Font() Assert.Inconclusive("needs testing"); #else var font = remote.GetProperty(Button.FontProperty); - Assert.True(font.FontAttributes.HasFlag(FontAttributes.Bold)); + Assert.AreEqual (FontWeight.Bold, font.Weight); #endif } @@ -179,12 +179,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -203,7 +203,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/CheckBoxUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/CheckBoxUITests.cs index 4e2a7a753801..e5e781f74760 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/CheckBoxUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/CheckBoxUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -50,12 +50,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -74,7 +74,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/DatePickerUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/DatePickerUITests.cs index f6681fee35c8..596c424e16ec 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/DatePickerUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/DatePickerUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -52,12 +52,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -76,7 +76,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/EditorUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/EditorUITests.cs index b081f036b254..54dac31c6e06 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/EditorUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/EditorUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -52,12 +52,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -76,7 +76,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/EntryUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/EntryUITests.cs index 2ae896be04ef..ed8f53fb0540 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/EntryUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/EntryUITests.cs @@ -1,6 +1,6 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; using Xamarin.UITest; using Xamarin.UITest.Queries; @@ -103,12 +103,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -127,7 +127,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/FrameUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/FrameUITests.cs index b69d5a22fc89..83ae19447318 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/FrameUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/FrameUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -54,12 +54,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -78,7 +78,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ImageButtonUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ImageButtonUITests.cs index d00695ab57a2..1d2665b94a8a 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ImageButtonUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ImageButtonUITests.cs @@ -1,6 +1,6 @@ using System.Threading; -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -161,12 +161,12 @@ public void Image() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -185,7 +185,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ImageUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ImageUITests.cs index 7492cc948d6f..7482e9a4341a 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ImageUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ImageUITests.cs @@ -1,6 +1,6 @@ using System.Threading; -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -58,12 +58,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -82,7 +82,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/LabelUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/LabelUITests.cs index 5fcaecca38f4..13eed50423a0 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/LabelUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/LabelUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -51,12 +51,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -75,7 +75,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/Legacy-CellsUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/Legacy-CellsUITests.cs index d6ca8beac60f..7d98d15c6099 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/Legacy-CellsUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/Legacy-CellsUITests.cs @@ -2,8 +2,8 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -27,7 +27,7 @@ protected override void NavigateToGallery() void SelectTest(string testName) { -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(testName); #else App.ScrollForElement($"* marked:'{testName}'", @@ -58,7 +58,7 @@ public void CellsGalleryTextCellList() string target = "Detail 99"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(1)); #else App.ScrollForElement($"* marked:'{target}'", @@ -84,7 +84,7 @@ public void CellsGalleryTextCellTable() string target = "Detail 12"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(1)); #else App.ScrollForElement($"* marked:'{target}'", @@ -114,7 +114,7 @@ public void CellsGalleryImageCellList() string target = "Detail 99"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(3)); #else var scrollBounds = App.Query(q => q.Marked(CellTestContainerId)).First().Rect; @@ -126,7 +126,7 @@ public void CellsGalleryImageCellList() App.Screenshot("All ImageCells are present"); -#if !__WINDOWS__ +#if !WINDOWS var numberOfImages = App.Query(q => q.Raw(PlatformViews.Image)).Length; // Check that there are images present. In Android, // have to make sure that there are more than 2 for navigation. @@ -188,7 +188,7 @@ public void CellsGalleryImageCellTable() string target = "Detail 12"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(1)); #else App.ScrollForElement($"* marked:'{target}'", @@ -199,7 +199,7 @@ public void CellsGalleryImageCellTable() App.Screenshot("All ImageCells are present"); -#if !__WINDOWS__ +#if !WINDOWS var numberOfImages = App.Query(q => q.Raw(PlatformViews.Image)).Length; // Check that there are images present. In Android, // have to make sure that there are more than 2 for navigation. @@ -223,7 +223,7 @@ public void CellsGallerySwitchCellList() string target = "Label 99"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(1)); #else App.ScrollForElement($"* marked:'{target}'", @@ -252,7 +252,7 @@ public void CellsGallerySwitchCellTable() string target = "text 32"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(1)); #else App.ScrollForElement($"* marked:'{target}'", @@ -281,7 +281,7 @@ public void CellsGalleryEntryCellList() string target = "Label 99"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(3)); #else App.ScrollForElement($"* marked:'{target}'", @@ -305,7 +305,7 @@ public void CellsGalleryEntryCellTable() string target = "Text 32"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(1)); #else App.ScrollForElement($"* marked:'{target}'", @@ -329,7 +329,7 @@ public void CellsGalleryEntryCellCompleted() string target = "Enter text"; -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(target, CellTestContainerId, timeout: TimeSpan.FromMinutes(1)); #else App.ScrollForElement($"* marked:'{target}'", @@ -340,7 +340,7 @@ public void CellsGalleryEntryCellCompleted() App.Screenshot("Before clicking Entry"); -#if !__IOS__ && !__WINDOWS__ +#if !__IOS__ && !WINDOWS App.Tap(PlatformQueries.EntryCellWithPlaceholder("I am a placeholder")); App.EnterText(PlatformQueries.EntryCellWithPlaceholder("I am a placeholder"), "Hi"); App.Screenshot("Entered Text"); diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/MaterialEntryUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/MaterialEntryUITests.cs index 967a6d761f82..befc4ae9db69 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/MaterialEntryUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/MaterialEntryUITests.cs @@ -1,6 +1,6 @@ -using NUnit.Framework; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/PickerUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/PickerUITests.cs index b1810c0a3c10..c9929b07901b 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/PickerUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/PickerUITests.cs @@ -1,6 +1,5 @@ -using NUnit.Framework; - using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -44,12 +43,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -68,7 +67,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ProgressBarUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ProgressBarUITests.cs index 7262c70bf659..2d93081e980a 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ProgressBarUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ProgressBarUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -51,12 +51,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -75,7 +75,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/RadioButtonUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/RadioButtonUITests.cs index 9fe5cfb88aa7..558a035e09ff 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/RadioButtonUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/RadioButtonUITests.cs @@ -1,6 +1,6 @@ using System; -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -55,12 +55,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -79,7 +79,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/RootGalleryUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/RootGalleryUITests.cs index 56398f0010ec..951ef8d3a5ec 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/RootGalleryUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/RootGalleryUITests.cs @@ -73,7 +73,7 @@ public void VisitEachPage() { foreach (var page in rootPages) { -#if __WINDOWS__ +#if WINDOWS App.ScrollDownTo(page.ButtonId, "ChoosePageScrollView"); #else var scrollViewArea = App.Query(q => q.Marked("ChoosePageScrollView")).First().Rect; diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SearchBarUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SearchBarUITests.cs index c15fe49de9e0..9d53ec138ee5 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SearchBarUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SearchBarUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -42,12 +42,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -66,7 +66,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SliderUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SliderUITests.cs index 335127cfae76..1f6d8ea52263 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SliderUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SliderUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -50,12 +50,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -74,7 +74,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/StepperUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/StepperUITests.cs index 7020b6f3b50b..7a78b1ee96af 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/StepperUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/StepperUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -37,7 +37,7 @@ public override void _UnFocus() { } -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] #endif [Category(UITestCategories.UwpIgnore)] @@ -51,7 +51,7 @@ public override void _IsEnabled() [Ignore("This is covered by the platform tests")] public override void _IsVisible() { } #else - [Category(UITestCategories.UwpIgnore)] + [Category(UITestCategories.UwpIgnore)] public override void _IsVisible() { base._IsVisible(); @@ -71,7 +71,7 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -90,7 +90,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SwitchUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SwitchUITests.cs index ce7aaf859342..ab27fc5bfbea 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SwitchUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/SwitchUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -50,12 +50,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -74,7 +74,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/TimePickerUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/TimePickerUITests.cs index 785225f67137..b0fb9bbc0b98 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/TimePickerUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/TimePickerUITests.cs @@ -1,6 +1,6 @@ using System.Threading; -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -53,12 +53,12 @@ protected override void FixtureTeardown() public override void _Opacity() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _IsEnabled() { } #endif -#if __ANDROID__ || __IOS__ || __WINDOWS__ +#if __ANDROID__ || __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Rotation() { } @@ -77,7 +77,7 @@ public override void _TranslationX() { } public override void _TranslationY() { } #endif -#if __IOS__ || __WINDOWS__ +#if __IOS__ || WINDOWS [Ignore("This is covered by the platform tests")] public override void _Scale() { } #endif diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ToolbarItemTests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ToolbarItemTests.cs index c2a04459d0a8..38a55b7b01ca 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ToolbarItemTests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ToolbarItemTests.cs @@ -1,9 +1,9 @@ using System; using System.Linq; using System.Threading; -using NUnit.Framework; using Microsoft.Maui.Controls.Compatibility.ControlGallery; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; using Xamarin.UITest; using Xamarin.UITest.Queries; diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ViewUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ViewUITests.cs index fc5c149c0786..43001c911c50 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ViewUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/ViewUITests.cs @@ -1,7 +1,7 @@  -using NUnit.Framework; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { @@ -127,7 +127,7 @@ public virtual void _Opacity() remote.GoTo(); #if __MACOS__ Assert.Inconclusive("needs testing"); -#elif __WINDOWS__ +#elif WINDOWS Assert.Inconclusive(PleaseInspect); #else float opacity = -1f; @@ -154,7 +154,7 @@ public virtual void _Rotation() Matrix generatedMatrix = NumericExtensions.CalculateRotationMatrixForDegrees(10, Axis.Z); Assert.AreEqual(generatedMatrix, rotationMatrix); #endif -#if __WINDOWS__ +#if WINDOWS Assert.Inconclusive(PleaseInspect); #endif } @@ -176,7 +176,7 @@ public virtual void _RotationX() Matrix matrix = NumericExtensions.CalculateRotationMatrixForDegrees(33.0f, Axis.X); Assert.AreEqual(matrix, rotationXMatrix); #endif -#if __WINDOWS__ +#if WINDOWS Assert.Inconclusive(PleaseInspect); #endif } @@ -198,7 +198,7 @@ public virtual void _RotationY() Matrix matrix = NumericExtensions.CalculateRotationMatrixForDegrees(10.0f, Axis.Y); Assert.AreEqual(matrix, rotationYMatrix); #endif -#if __WINDOWS__ +#if WINDOWS Assert.Inconclusive(PleaseInspect); #endif } @@ -213,7 +213,7 @@ public virtual void _Scale() #if __MACOS__ Assert.Inconclusive("needs testing"); #else -#if __WINDOWS__ +#if WINDOWS Assert.Inconclusive(PleaseInspect); #endif var scaleMatrix = remote.GetProperty(View.ScaleProperty); @@ -230,7 +230,7 @@ public virtual void _TranslationX() { var remote = new ViewContainerRemote(App, Test.VisualElement.TranslationX, PlatformViewType); remote.GoTo(); -#if __WINDOWS__ +#if WINDOWS Assert.Inconclusive(PleaseInspect); #endif } @@ -243,7 +243,7 @@ public virtual void _TranslationY() { var remote = new ViewContainerRemote(App, Test.VisualElement.TranslationY, PlatformViewType); remote.GoTo(); -#if __WINDOWS__ +#if WINDOWS Assert.Inconclusive(PleaseInspect); #endif } diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/WebViewUITests.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/WebViewUITests.cs index a4d2584742b6..e11884e10cbb 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/WebViewUITests.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Tests/WebViewUITests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.CustomAttributes; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.UITests { diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Utilities/AppExtensions.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Utilities/AppExtensions.cs index 5f0e86729333..82086bc960a0 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Utilities/AppExtensions.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Utilities/AppExtensions.cs @@ -1,12 +1,11 @@ using System; using System.Linq; - -using Xamarin.UITest; -using Xamarin.UITest.Queries; using System.Text.RegularExpressions; using System.Threading; using Microsoft.Maui.Controls.Compatibility.ControlGallery; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; +using Xamarin.UITest; +using Xamarin.UITest.Queries; #if __IOS__ using Xamarin.UITest.iOS; @@ -17,7 +16,7 @@ namespace Microsoft.Maui.Controls.Compatibility.UITests using IApp = global::Xamarin.UITest.IApp; internal static class AppExtensions { -#if __WINDOWS__ +#if WINDOWS public static void Restart(this IApp app) { ((ScreenshotConditionalApp)app).Restart(); @@ -25,7 +24,7 @@ public static void Restart(this IApp app) #endif public static bool RestartIfAppIsClosed(this IApp app) { -#if __WINDOWS__ +#if WINDOWS return ((ScreenshotConditionalApp)app).RestartIfAppIsClosed(); #else return false; @@ -165,7 +164,7 @@ public static void SendAppToBackground(this IApp app, TimeSpan timeSpan) public static string ReadDatePicker(this IApp app, string marked) { -#if __WINDOWS__ +#if WINDOWS return ((ScreenshotConditionalApp)app).ReadDatePicker(marked).ToString(); #else return app.WaitForElement(marked)[0].ReadText(); @@ -174,7 +173,7 @@ public static string ReadDatePicker(this IApp app, string marked) public static string ReadTimePicker(this IApp app, string marked) { -#if __WINDOWS__ +#if WINDOWS return ((ScreenshotConditionalApp)app).ReadTimePicker(marked).ToString(); #else return app.WaitForElement(marked)[0].ReadText(); diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Utilities/Gestures.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Utilities/Gestures.cs index 42bbdda9717d..fe4075399870 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Utilities/Gestures.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Utilities/Gestures.cs @@ -108,7 +108,7 @@ public static void ActivateContextMenu(this IApp app, string target) rect.CenterY); #elif __ANDROID__ app.TouchAndHold(target); -#elif __WINDOWS__ +#elif WINDOWS // Since we know we're on desktop for the moment, just use ContextClick. If we get this running // on actual touch devices at some point, we'll need to check for that and use TouchAndHold app.Invoke("ContextClick", target); @@ -123,9 +123,9 @@ public static void DismissContextMenu(this IApp app) app.TapCoordinates(screenbounds.CenterX, screenbounds.CenterY); #elif __ANDROID__ app.Back(); -#elif __WINDOWS__ +#elif WINDOWS var screenbounds = app.RootViewRect(); - app.TapCoordinates (screenbounds.CenterX, screenbounds.CenterY); + app.TapCoordinates(screenbounds.CenterX, screenbounds.CenterY); #endif } } diff --git a/src/Compatibility/ControlGallery/src/WinUI (Package)/Compatibility.ControlGallery.WinUI (Package).wapproj b/src/Compatibility/ControlGallery/src/WinUI (Package)/Compatibility.ControlGallery.WinUI (Package).wapproj index d4b45e30851a..76f80ffbfab3 100644 --- a/src/Compatibility/ControlGallery/src/WinUI (Package)/Compatibility.ControlGallery.WinUI (Package).wapproj +++ b/src/Compatibility/ControlGallery/src/WinUI (Package)/Compatibility.ControlGallery.WinUI (Package).wapproj @@ -3,9 +3,6 @@ 15.0 - - true - Debug diff --git a/src/Compatibility/ControlGallery/src/WinUI/App.xaml.cs b/src/Compatibility/ControlGallery/src/WinUI/App.xaml.cs index 0d8013e51fd2..45c82d7deb6e 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/App.xaml.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/App.xaml.cs @@ -3,11 +3,6 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.Foundation.Metadata; -using Windows.UI; -using Windows.UI.ViewManagement; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls.Primitives; @@ -16,27 +11,32 @@ using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Navigation; using Windows.ApplicationModel; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.Foundation.Metadata; +using Windows.UI; +using Windows.UI.ViewManagement; // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409 namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI { - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - sealed partial class App : Microsoft.UI.Xaml.Application + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Microsoft.UI.Xaml.Application { - private Window m_window; + private UI.Xaml.Window m_window; public static bool RunningAsUITests { get; private set; } /// /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// public App() - { - InitializeComponent(); - //Suspending += OnSuspending; - } + { + InitializeComponent(); + //Suspending += OnSuspending; + } /// /// Invoked when the application is launched normally by the end user. Other entry points @@ -44,8 +44,8 @@ public App() /// /// Details about the launch request and process. protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs e) - { - if (!String.IsNullOrWhiteSpace(e.Arguments) && + { + if (!String.IsNullOrWhiteSpace(e.Arguments) && e.Arguments.Contains("RunningAsUITests")) { RunningAsUITests = true; @@ -56,28 +56,28 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs e) Maui.Controls.Compatibility.Forms.Init(e, m_window as MainPage); } - /// - /// Invoked when Navigation to a certain page fails - /// - /// The Frame which failed navigation - /// Details about the navigation failure - void OnNavigationFailed(object sender, NavigationFailedEventArgs e) - { - throw new Exception("Failed to load Page " + e.SourcePageType.FullName); - } + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } - /// - /// Invoked when application execution is being suspended. Application state is saved - /// without knowing whether the application will be terminated or resumed with the contents - /// of memory still intact. - /// - /// The source of the suspend request. - /// Details about the suspend request. - void OnSuspending(object sender, SuspendingEventArgs e) - { - var deferral = e.SuspendingOperation.GetDeferral(); - //TODO: Save application state and stop any background activity - deferral.Complete(); - } - } + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } } diff --git a/src/Compatibility/ControlGallery/src/WinUI/AttachedStateEffectRenderer.cs b/src/Compatibility/ControlGallery/src/WinUI/AttachedStateEffectRenderer.cs index e7a433a2e342..43b6b4bc4b5f 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/AttachedStateEffectRenderer.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/AttachedStateEffectRenderer.cs @@ -1,8 +1,8 @@ using System; using System.Linq; using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Effects; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; [assembly: ExportEffect(typeof(AttachedStateEffectRenderer), AttachedStateEffect.EffectName)] diff --git a/src/Compatibility/ControlGallery/src/WinUI/BorderEffect.cs b/src/Compatibility/ControlGallery/src/WinUI/BorderEffect.cs index cc3296f2de71..3f905b87f111 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/BorderEffect.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/BorderEffect.cs @@ -1,8 +1,8 @@ -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Media; -using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Media; [assembly: ExportEffect(typeof(BorderEffect), "BorderEffect")] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI diff --git a/src/Compatibility/ControlGallery/src/WinUI/BrokenImageSourceHandler.cs b/src/Compatibility/ControlGallery/src/WinUI/BrokenImageSourceHandler.cs index 17d49da71e0b..ab507fc5c220 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/BrokenImageSourceHandler.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/BrokenImageSourceHandler.cs @@ -2,10 +2,10 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; -using WImageSource = Microsoft.UI.Xaml.Media.ImageSource; - -using Microsoft.Maui.Controls.Compatibility.Platform.UWP; using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; +using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Controls.Platform; +using WImageSource = Microsoft.UI.Xaml.Media.ImageSource; [assembly: ExportRenderer(typeof(_51173Image), typeof(_51173CustomImageRenderer))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI diff --git a/src/Compatibility/ControlGallery/src/WinUI/BrokenNativeControl.cs b/src/Compatibility/ControlGallery/src/WinUI/BrokenNativeControl.cs index 6b607de6b268..c95f6fdf9f66 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/BrokenNativeControl.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/BrokenNativeControl.cs @@ -1,19 +1,20 @@ +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Media; using Windows.Foundation; using Windows.Graphics.Display; using Windows.UI; using Windows.UI.ViewManagement; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Media; -using Microsoft.UI; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI { internal class BrokenNativeControl : Panel { - public BrokenNativeControl () + public BrokenNativeControl() { - _textBlock = new TextBlock { + _textBlock = new TextBlock + { MinHeight = 0, MaxHeight = double.PositiveInfinity, MinWidth = 0, @@ -22,17 +23,17 @@ public BrokenNativeControl () HorizontalAlignment = HorizontalAlignment.Center }; - Children.Add (_textBlock); + Children.Add(_textBlock); Background = - new Microsoft.UI.Xaml.Media.LinearGradientBrush ( - new Microsoft.UI.Xaml.Media.GradientStopCollection { new Microsoft.UI.Xaml.Media.GradientStop { Color = Colors.Green, Offset = 0.5}, new Microsoft.UI.Xaml.Media.GradientStop { Color = Colors.Blue, Offset = 1} }, 0); + new Microsoft.UI.Xaml.Media.LinearGradientBrush( + new Microsoft.UI.Xaml.Media.GradientStopCollection { new Microsoft.UI.Xaml.Media.GradientStop { Color = Colors.Green, Offset = 0.5 }, new Microsoft.UI.Xaml.Media.GradientStop { Color = Colors.Blue, Offset = 1 } }, 0); } - public static readonly DependencyProperty TextProperty = DependencyProperty.Register ( - "Text", typeof(string), typeof(BrokenNativeControl), new PropertyMetadata (default(string), PropertyChangedCallback)); + public static readonly DependencyProperty TextProperty = DependencyProperty.Register( + "Text", typeof(string), typeof(BrokenNativeControl), new PropertyMetadata(default(string), PropertyChangedCallback)); - static void PropertyChangedCallback (DependencyObject dependencyObject, + static void PropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) { ((BrokenNativeControl)dependencyObject)._textBlock.Text = (string)dependencyPropertyChangedEventArgs.NewValue; @@ -40,8 +41,8 @@ static void PropertyChangedCallback (DependencyObject dependencyObject, public string Text { - get { return (string)GetValue (TextProperty); } - set { SetValue (TextProperty, value); } + get { return (string)GetValue(TextProperty); } + set { SetValue(TextProperty, value); } } readonly TextBlock _textBlock; @@ -53,16 +54,16 @@ protected override Windows.Foundation.Size ArrangeOverride(Windows.Foundation.Si } - protected override global::Windows.Foundation.Size MeasureOverride (Windows.Foundation.Size availableSize) + protected override global::Windows.Foundation.Size MeasureOverride(Windows.Foundation.Size availableSize) { - _textBlock.Measure (availableSize); + _textBlock.Measure(availableSize); // This deliberately does something wrong so we can demo fixing it - var bounds = ApplicationView.GetForCurrentView ().VisibleBounds; - double scaleFactor = DisplayInformation.GetForCurrentView ().RawPixelsPerViewPixel; - var size = new Size (bounds.Width * scaleFactor, bounds.Height * scaleFactor); + var bounds = ApplicationView.GetForCurrentView().VisibleBounds; + double scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; + var size = new Size(bounds.Width * scaleFactor, bounds.Height * scaleFactor); - return new Windows.Foundation.Size (size.Width, _textBlock.DesiredSize.Height); + return new Windows.Foundation.Size(size.Width, _textBlock.DesiredSize.Height); } } } \ No newline at end of file diff --git a/src/Compatibility/ControlGallery/src/WinUI/CustomRenderers.cs b/src/Compatibility/ControlGallery/src/WinUI/CustomRenderers.cs index 923d65d8786b..53373a8c3609 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/CustomRenderers.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/CustomRenderers.cs @@ -2,15 +2,16 @@ using System.ComponentModel; using System.Linq; using Microsoft.Maui; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Controls.Platform; +using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Input; using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Shapes; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; -using Microsoft.Maui.Graphics; [assembly: ExportRenderer(typeof(Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues.Bugzilla42602.TextBoxView), typeof(Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI.TextBoxViewRenderer))] [assembly: ExportRenderer(typeof(Issue1683.EntryKeyboardFlags), typeof(EntryRendererKeyboardFlags))] @@ -65,7 +66,8 @@ public static class KeyboardFlagExtensions { public static void TestKeyboardFlags(this FormsTextBox Control, KeyboardFlags? flags) { - if (flags == null) { return; } + if (flags == null) + { return; } if (flags.Value.HasFlag(KeyboardFlags.CapitalizeSentence)) { if (!Control.IsSpellCheckEnabled) @@ -94,7 +96,8 @@ public static void TestKeyboardFlags(this FormsTextBox Control, KeyboardFlags? f public static void SetKeyboardFlags(this FormsTextBox Control, KeyboardFlags? flags) { - if (flags == null) { return; } + if (flags == null) + { return; } var result = new InputScope(); var value = InputScopeNameValue.Default; diff --git a/src/Compatibility/ControlGallery/src/WinUI/CustomSwitchRenderer.cs b/src/Compatibility/ControlGallery/src/WinUI/CustomSwitchRenderer.cs index e79d9fc84e0d..6eabb356bee5 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/CustomSwitchRenderer.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/CustomSwitchRenderer.cs @@ -1,9 +1,10 @@ using System.ComponentModel; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; -using WResourceDictionary = Microsoft.UI.Xaml.ResourceDictionary; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; +using WResourceDictionary = Microsoft.UI.Xaml.ResourceDictionary; [assembly: ExportRenderer(typeof(CustomSwitch), typeof(CustomSwitchRenderer))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI diff --git a/src/Compatibility/ControlGallery/src/WinUI/DisposePageRenderer.cs b/src/Compatibility/ControlGallery/src/WinUI/DisposePageRenderer.cs index 8c64b51d16bf..1ddcda2aaa79 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/DisposePageRenderer.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/DisposePageRenderer.cs @@ -1,6 +1,6 @@ +using Microsoft.Maui.Controls.Compatibility.ControlGallery; using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; -using Microsoft.Maui.Controls.Compatibility.ControlGallery; [assembly: ExportRenderer(typeof(DisposePage), typeof(DisposePageRenderer))] [assembly: ExportRenderer(typeof(DisposeLabel), typeof(DisposeLabelRenderer))] diff --git a/src/Compatibility/ControlGallery/src/WinUI/FocusEffect.cs b/src/Compatibility/ControlGallery/src/WinUI/FocusEffect.cs index 5e0a99f1ce23..f69fa91ac690 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/FocusEffect.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/FocusEffect.cs @@ -4,12 +4,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Windows.UI; -using Microsoft.UI.Xaml.Media; using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; using Microsoft.UI; +using Microsoft.UI.Xaml.Media; +using Windows.UI; [assembly: ExportEffect(typeof(FocusEffect), "FocusEffect")] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI diff --git a/src/Compatibility/ControlGallery/src/WinUI/MainPage.xaml.cs b/src/Compatibility/ControlGallery/src/WinUI/MainPage.xaml.cs index f5ad33f7eed9..44566d44233c 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/MainPage.xaml.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/MainPage.xaml.cs @@ -2,6 +2,12 @@ using System; using System.Globalization; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Compatibility.ControlGallery; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; +using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Controls.Platform; +using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Input; @@ -10,11 +16,6 @@ using Windows.System; using Windows.UI.Core; using Windows.UI.ViewManagement; -using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; -using Microsoft.Maui.Controls.Compatibility.ControlGallery; -using Microsoft.Maui.Controls.Compatibility.Platform.UWP; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI { @@ -78,7 +79,7 @@ void WireUpKeyDown() } }); } - + private void _app_PropertyChanged(object sender, global::System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "MainPage") diff --git a/src/Compatibility/ControlGallery/src/WinUI/NavPageOverrideRenderer.cs b/src/Compatibility/ControlGallery/src/WinUI/NavPageOverrideRenderer.cs index a771bff79e05..bfa1ef8eb178 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/NavPageOverrideRenderer.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/NavPageOverrideRenderer.cs @@ -1,9 +1,10 @@ -using Microsoft.UI.Xaml.Media.Animation; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; +using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; -using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; +using Microsoft.UI.Xaml.Media.Animation; [assembly: ExportRenderer(typeof(NavPageOverrideUWP.CustomNavPageForOverride), typeof(NavPageOverrideRenderer))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI @@ -20,7 +21,7 @@ protected override void OnElementChanged(VisualElementChangedEventArgs e) protected override void SetupPageTransition(Transition transition, bool isAnimated, bool isPopping) { - var newTransition = new EntranceThemeTransition { FromVerticalOffset = 0}; + var newTransition = new EntranceThemeTransition { FromVerticalOffset = 0 }; if (isPopping) { diff --git a/src/Compatibility/ControlGallery/src/WinUI/PlatformSpecificCoreGalleryFactory.cs b/src/Compatibility/ControlGallery/src/WinUI/PlatformSpecificCoreGalleryFactory.cs index 56573bd1cd3c..de127a326ac6 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/PlatformSpecificCoreGalleryFactory.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/PlatformSpecificCoreGalleryFactory.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.ControlGallery; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; [assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))] diff --git a/src/Compatibility/ControlGallery/src/WinUI/Properties/AssemblyInfo.cs b/src/Compatibility/ControlGallery/src/WinUI/Properties/AssemblyInfo.cs index 6fc94401cb88..c9c71ef677c6 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/Properties/AssemblyInfo.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/Properties/AssemblyInfo.cs @@ -2,10 +2,10 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.ControlGallery; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; // Deliberately broken image source and handler so we can test handling of image loading errors [assembly: ExportImageSourceHandler(typeof(FailImageSource), typeof(BrokenImageSourceHandler))] -[assembly: Microsoft.Maui.Controls.ResolutionGroupName (Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues.Effects.ResolutionGroupName)] \ No newline at end of file +[assembly: Microsoft.Maui.Controls.ResolutionGroupName(Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues.Effects.ResolutionGroupName)] \ No newline at end of file diff --git a/src/Compatibility/ControlGallery/src/WinUI/RegistrarValidationService.cs b/src/Compatibility/ControlGallery/src/WinUI/RegistrarValidationService.cs index bb7d7bc2efd2..92c1b40f6b2e 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/RegistrarValidationService.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/RegistrarValidationService.cs @@ -1,6 +1,6 @@ using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.ControlGallery; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; [assembly: Dependency(typeof(RegistrarValidationService))] @@ -17,7 +17,7 @@ public bool Validate(VisualElement element, out string message) var renderer = Platform.UWP.Platform.CreateRenderer(element); - if (renderer == null + if (renderer == null || renderer.GetType().Name == "DefaultRenderer" ) { diff --git a/src/Compatibility/ControlGallery/src/WinUI/SampleNativeControl.cs b/src/Compatibility/ControlGallery/src/WinUI/SampleNativeControl.cs index 61085eb91bb4..b2b603d4cffa 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/SampleNativeControl.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/SampleNativeControl.cs @@ -1,10 +1,10 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Media; -using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; +using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues.Helpers; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Media; [assembly: Dependency(typeof(SampleNativeControl))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI diff --git a/src/Compatibility/ControlGallery/src/WinUI/SecondaryWindowService.cs b/src/Compatibility/ControlGallery/src/WinUI/SecondaryWindowService.cs index 63ddaf52d8f3..9058ec3fa803 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/SecondaryWindowService.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/SecondaryWindowService.cs @@ -1,13 +1,13 @@ using System; using System.Threading.Tasks; -using Windows.ApplicationModel.Core; -using Windows.UI.Core; -using Windows.UI.ViewManagement; -using Microsoft.UI.Xaml; using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.ControlGallery; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.UI.Xaml; +using Windows.ApplicationModel.Core; +using Windows.UI.Core; +using Windows.UI.ViewManagement; [assembly: Dependency(typeof(SecondaryWindowService))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI @@ -25,8 +25,8 @@ await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => //The page instance must be created inside the new UI Thread. ContentPage instance = (ContentPage)Activator.CreateInstance(pageType); frame.Navigate(instance); - Window.Current.Content = frame; - Window.Current.Activate(); + UI.Xaml.Window.Current.Content = frame; + UI.Xaml.Window.Current.Activate(); newViewId = ApplicationView.GetForCurrentView().Id; }); diff --git a/src/Compatibility/ControlGallery/src/WinUI/Tests/PlatformTestSettings.cs b/src/Compatibility/ControlGallery/src/WinUI/Tests/PlatformTestSettings.cs index f1827621638b..4364f438f643 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/Tests/PlatformTestSettings.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/Tests/PlatformTestSettings.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Reflection; -using NUnit; using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI.Tests; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Tests; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI.Tests; +using NUnit; [assembly: Dependency(typeof(PlatformTestSettings))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI.Tests diff --git a/src/Compatibility/ControlGallery/src/WinUI/Tests/TestingPlatformService.cs b/src/Compatibility/ControlGallery/src/WinUI/Tests/TestingPlatformService.cs index b010de89e6b0..d2e0f5f9cee3 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/Tests/TestingPlatformService.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/Tests/TestingPlatformService.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI.Tests; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Tests; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI.Tests; [assembly: Dependency(typeof(TestingPlatformService))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI.Tests diff --git a/src/Compatibility/ControlGallery/src/WinUI/_13109IssueHelper.cs b/src/Compatibility/ControlGallery/src/WinUI/_13109IssueHelper.cs index 6f4499553c61..964676cde79d 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/_13109IssueHelper.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/_13109IssueHelper.cs @@ -1,8 +1,9 @@ using System.Threading.Tasks; using Microsoft.Maui.Controls; -using Microsoft.Maui.Controls.Compatibility.Platform.UWP; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; +using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Controls.Platform; using Bitmap = Microsoft.UI.Xaml.Media.ImageSource; [assembly: Dependency(typeof(_13109IssueHelper))] @@ -29,4 +30,4 @@ internal static Task GetImage(this ImageSource source) return source.GetHandler().LoadImageAsync(source); } } -} \ No newline at end of file +} diff --git a/src/Compatibility/ControlGallery/src/WinUI/_2489CustomRenderer.cs b/src/Compatibility/ControlGallery/src/WinUI/_2489CustomRenderer.cs index 994ccd5979ea..dfbc5f7b0fdd 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/_2489CustomRenderer.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/_2489CustomRenderer.cs @@ -3,6 +3,7 @@ using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Controls.Platform; [assembly: ExportRenderer(typeof(Microsoft.Maui.Controls.Page), typeof(_2489CustomRenderer))] namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI diff --git a/src/Compatibility/ControlGallery/src/WinUI/_57114Renderer.cs b/src/Compatibility/ControlGallery/src/WinUI/_57114Renderer.cs index fa159f262fb6..6e972e97c411 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/_57114Renderer.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/_57114Renderer.cs @@ -1,9 +1,10 @@ -using Microsoft.UI.Xaml.Input; -using Microsoft.UI.Xaml.Media; -using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues; +using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; [assembly: ExportRenderer(typeof(Bugzilla57114._57114View), typeof(_57114Renderer))] @@ -17,7 +18,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e) if (e.NewElement != null) { _customControl = e.NewElement as Bugzilla60122._60122Image; - _gestureRecognizer.GestureSettings = GestureSettings.HoldWithMouse; + _gestureRecognizer.GestureSettings = GestureSettings.HoldWithMouse; Holding += OnHolding; } else diff --git a/src/Compatibility/ControlGallery/src/WinUI/_9087CustomRenderer.cs b/src/Compatibility/ControlGallery/src/WinUI/_9087CustomRenderer.cs index 9ae2b122fc22..3c1be43f7518 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/_9087CustomRenderer.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/_9087CustomRenderer.cs @@ -1,6 +1,7 @@ using System; using Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Controls.Platform; using static Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues.Issue9087; [assembly: ExportRenderer(typeof(_9087Label), typeof(_9087CustomRenderer))] diff --git a/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj b/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj index 23c9fabcc6fa..b7b9d2a2d44a 100644 --- a/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj +++ b/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj @@ -18,7 +18,7 @@ full false bin\Debug\ - TRACE;DEBUG;__WINDOWS__;UITEST + TRACE;DEBUG;WINDOWS;WINDOWS;UITEST prompt 4 0114;0108;4014;0649;0169;0168;0219 @@ -27,7 +27,7 @@ pdbonly true bin\Release\ - TRACE;__WINDOWS__;UITEST + TRACE;WINDOWS;UITEST prompt 4 0114;0108;4014;0649;0169;0168;0219 diff --git a/src/Compatibility/ControlGallery/test/WinUI.UITests/WindowsTestBase.cs b/src/Compatibility/ControlGallery/test/WinUI.UITests/WindowsTestBase.cs index e97762e51f56..8f9d842978b6 100644 --- a/src/Compatibility/ControlGallery/test/WinUI.UITests/WindowsTestBase.cs +++ b/src/Compatibility/ControlGallery/test/WinUI.UITests/WindowsTestBase.cs @@ -31,12 +31,13 @@ public static void StartupApplication() { AppiumOptions options = new AppiumOptions(); options.AddAdditionalCapability("app", "0d4424f6-1e29-4476-ac00-ba22c3789cb6_ph1m9x8skttmg!App"); - + try { Session = new WindowsDriver(new Uri(WindowsApplicationDriverUrl), options); } - catch { + catch + { // This crashes because it can't find the window but it will at least start the application } } diff --git a/src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs index 38f358d62f75..bb490c37a558 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs @@ -171,7 +171,7 @@ void UpdateFont() else { NativeButton.Typeface = font.ToTypeface(); - NativeButton.SetTextSize(ComplexUnitType.Sp, font.ToScaledPixel()); + NativeButton.SetTextSize(ComplexUnitType.Sp, (float)font.FontSize); } } diff --git a/src/Compatibility/Core/src/Android/AppCompat/CarouselPageRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/CarouselPageRenderer.cs index bcd402bfb51a..4624b4b3a614 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/CarouselPageRenderer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/CarouselPageRenderer.cs @@ -4,6 +4,7 @@ using Android.Views; using AndroidX.Fragment.App; using AndroidX.ViewPager.Widget; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat diff --git a/src/Compatibility/Core/src/Android/AppCompat/CheckBoxRendererBase.cs b/src/Compatibility/Core/src/Android/AppCompat/CheckBoxRendererBase.cs index dbaaec74a4ea..58413d15c224 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/CheckBoxRendererBase.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/CheckBoxRendererBase.cs @@ -9,6 +9,7 @@ using AndroidX.Core.Widget; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AAttribute = Android.Resource.Attribute; using AColor = Android.Graphics.Color; diff --git a/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageContainer.cs b/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageContainer.cs index 97dc44048d70..3ae89784ab46 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageContainer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageContainer.cs @@ -4,6 +4,7 @@ using Android.Views; using Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using APlatform = Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat.Platform; using Fragment = AndroidX.Fragment.App.Fragment; diff --git a/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageRenderer.cs index 21e744146220..99b3b7f712de 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageRenderer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageRenderer.cs @@ -10,8 +10,10 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Android { + using global::Android.Graphics.Drawables; using Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; + using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; public class FlyoutPageRenderer : DrawerLayout, IVisualElementRenderer, DrawerLayout.IDrawerListener, IManageFragments, ILifeCycleState @@ -421,11 +423,12 @@ void UpdateBackgroundColor(Page view) void UpdateBackgroundImage(Page view) { - _ = this.ApplyDrawableAsync(view, Page.BackgroundImageSourceProperty, Context, drawable => + this.ApplyDrawableAsync(view, Page.BackgroundImageSourceProperty, Context, + (Drawable drawable) => { if (drawable != null) this.SetBackground(drawable); - }); + }).FireAndForget(e => Internals.Log.Warning(nameof(FlyoutPageRenderer), $"{e}")); } void UpdateDetail() diff --git a/src/Compatibility/Core/src/Android/AppCompat/FormsAppCompatActivity.cs b/src/Compatibility/Core/src/Android/AppCompat/FormsAppCompatActivity.cs index b8368dcdc4c7..e467db2e41e1 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/FormsAppCompatActivity.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/FormsAppCompatActivity.cs @@ -241,7 +241,7 @@ void OnCreate( SetContentView(_layout); Profile.FramePartition("OnStateChanged"); - Microsoft.Maui.Controls.Application.ClearCurrent(); + Microsoft.Maui.Controls.Application.Current = null; _previousState = _currentState; _currentState = AndroidApplicationLifecycleState.OnCreate; diff --git a/src/Compatibility/Core/src/Android/AppCompat/FragmentContainer.cs b/src/Compatibility/Core/src/Android/AppCompat/FragmentContainer.cs index 16ab1c77460e..6c82912417d0 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/FragmentContainer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/FragmentContainer.cs @@ -4,6 +4,7 @@ using Android.Runtime; using Android.Views; using AndroidX.Fragment.App; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.AppCompat; using AView = Android.Views.View; diff --git a/src/Compatibility/Core/src/Android/AppCompat/ImageButtonRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/ImageButtonRenderer.cs index a3dd5f008ce0..e203b764d000 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/ImageButtonRenderer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/ImageButtonRenderer.cs @@ -7,6 +7,7 @@ using AndroidX.AppCompat.Widget; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; @@ -322,7 +323,7 @@ bool IOnTouchListener.OnTouch(AView v, MotionEvent e) => float IBorderVisualElementRenderer.ShadowRadius => Context.ToPixels(OnThisPlatform().GetShadowRadius()); float IBorderVisualElementRenderer.ShadowDx => Context.ToPixels(OnThisPlatform().GetShadowOffset().Width); float IBorderVisualElementRenderer.ShadowDy => Context.ToPixels(OnThisPlatform().GetShadowOffset().Height); - AColor IBorderVisualElementRenderer.ShadowColor => OnThisPlatform().GetShadowColor().ToAndroid(); + AColor IBorderVisualElementRenderer.ShadowColor => OnThisPlatform().GetShadowColor().ToAndroid(Colors.Black); bool IBorderVisualElementRenderer.IsShadowEnabled() => OnThisPlatform().GetIsShadowEnabled(); bool IBorderVisualElementRenderer.UseDefaultPadding() => false; bool IBorderVisualElementRenderer.UseDefaultShadow() => false; diff --git a/src/Compatibility/Core/src/Android/AppCompat/NavigationPageRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/NavigationPageRenderer.cs index 5ad0152e517b..f8f7f7bc8d02 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/NavigationPageRenderer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/NavigationPageRenderer.cs @@ -17,6 +17,7 @@ using AndroidX.AppCompat.Graphics.Drawable; using AndroidX.DrawerLayout.Widget; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using static Android.Views.View; using static Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.AppCompat.NavigationPage; diff --git a/src/Compatibility/Core/src/Android/AppCompat/Platform.cs b/src/Compatibility/Core/src/Android/AppCompat/Platform.cs index b64bd08bc0f2..471d57c195eb 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/Platform.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/Platform.cs @@ -8,6 +8,7 @@ using Android.Views; using Android.Views.Animations; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AView = Android.Views.View; @@ -257,7 +258,7 @@ public static SizeRequest GetNativeSize(VisualElement view, double widthConstrai { returnValue = new SizeRequest(Size.Zero, Size.Zero); } - else if (visualElementRenderer == null && view is IView iView) + else if ((visualElementRenderer == null || visualElementRenderer is HandlerToRendererShim) && view is IView iView) { returnValue = iView.Handler.GetDesiredSize(widthConstraint, heightConstraint); } diff --git a/src/Compatibility/Core/src/Android/AppCompat/RadioButtonRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/RadioButtonRenderer.cs index 6d4f3ce4a691..a480ee3afaa9 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/RadioButtonRenderer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/RadioButtonRenderer.cs @@ -9,6 +9,7 @@ using AndroidX.Core.View; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using AView = Android.Views.View; @@ -273,7 +274,7 @@ void UpdateFont() else { Typeface = font.ToTypeface(); - SetTextSize(ComplexUnitType.Sp, font.ToScaledPixel()); + SetTextSize(ComplexUnitType.Sp, (float)font.FontSize); } } diff --git a/src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs index 44adf8a46b98..15c31a1cbb0c 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs @@ -14,6 +14,7 @@ using Google.Android.Material.BottomSheet; using Google.Android.Material.Tabs; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; diff --git a/src/Compatibility/Core/src/Android/BackgroundManager.cs b/src/Compatibility/Core/src/Android/BackgroundManager.cs index 0ffb23e6cc51..f61e81817d30 100644 --- a/src/Compatibility/Core/src/Android/BackgroundManager.cs +++ b/src/Compatibility/Core/src/Android/BackgroundManager.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AView = Android.Views.View; diff --git a/src/Compatibility/Core/src/Android/BorderBackgroundManager.cs b/src/Compatibility/Core/src/Android/BorderBackgroundManager.cs index e70fbf32da62..fbe124d0e6f7 100644 --- a/src/Compatibility/Core/src/Android/BorderBackgroundManager.cs +++ b/src/Compatibility/Core/src/Android/BorderBackgroundManager.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using Android.Content.Res; using Android.Graphics.Drawables; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using AView = Android.Views.View; diff --git a/src/Compatibility/Core/src/Android/Cells/EntryCellEditText.cs b/src/Compatibility/Core/src/Android/Cells/EntryCellEditText.cs index 135c9c5d3aef..3e91e9630b22 100644 --- a/src/Compatibility/Core/src/Android/Cells/EntryCellEditText.cs +++ b/src/Compatibility/Core/src/Android/Cells/EntryCellEditText.cs @@ -27,7 +27,7 @@ public override bool OnKeyPreIme(Keycode keyCode, KeyEvent e) protected override void OnFocusChanged(bool gainFocus, FocusSearchDirection direction, ARect previouslyFocusedRect) { - Window window = Context.GetActivity().Window; + var window = Context.GetActivity().Window; if (gainFocus) { _startingMode = window.Attributes.SoftInputMode; diff --git a/src/Compatibility/Core/src/Android/CollectionView/IndicatorViewRenderer.cs b/src/Compatibility/Core/src/Android/CollectionView/IndicatorViewRenderer.cs index 959fced7782d..150918c08114 100644 --- a/src/Compatibility/Core/src/Android/CollectionView/IndicatorViewRenderer.cs +++ b/src/Compatibility/Core/src/Android/CollectionView/IndicatorViewRenderer.cs @@ -5,6 +5,7 @@ using Android.Views; using Android.Widget; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using AShapes = Android.Graphics.Drawables.Shapes; diff --git a/src/Compatibility/Core/src/Android/CollectionView/ItemsViewRenderer.cs b/src/Compatibility/Core/src/Android/CollectionView/ItemsViewRenderer.cs index d3a8b8ea2200..47351691b02d 100644 --- a/src/Compatibility/Core/src/Android/CollectionView/ItemsViewRenderer.cs +++ b/src/Compatibility/Core/src/Android/CollectionView/ItemsViewRenderer.cs @@ -6,6 +6,7 @@ using Microsoft.Maui.Controls.Compatibility.Platform.Android.CollectionView; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using ARect = Android.Graphics.Rect; using AViewCompat = AndroidX.Core.View.ViewCompat; diff --git a/src/Compatibility/Core/src/Android/Compatibility.Android.csproj b/src/Compatibility/Core/src/Android/Compatibility.Android.csproj index ef0eaae62bfc..fe0a2b01cc3b 100644 --- a/src/Compatibility/Core/src/Android/Compatibility.Android.csproj +++ b/src/Compatibility/Core/src/Android/Compatibility.Android.csproj @@ -32,8 +32,6 @@ - - diff --git a/src/Compatibility/Core/src/Android/Elevation.cs b/src/Compatibility/Core/src/Android/Elevation.cs index 89eb9472bb0b..7403abc5500b 100644 --- a/src/Compatibility/Core/src/Android/Elevation.cs +++ b/src/Compatibility/Core/src/Android/Elevation.cs @@ -13,6 +13,16 @@ public static void SetElevation(global::Android.Views.View view, VisualElement e } var elevation = GetElevation(element, view.Context); + SetElevation(view, elevation); + } + + public static void SetElevation(global::Android.Views.View view, float? elevation) + { + if (view == null || !Forms.IsLollipopOrNewer) + { + return; + } + if (!elevation.HasValue) { return; diff --git a/src/Compatibility/Core/src/Android/Extensions/JavaObjectExtensions.cs b/src/Compatibility/Core/src/Android/Extensions/JavaObjectExtensions.cs deleted file mode 100644 index 402ff18c39d3..000000000000 --- a/src/Compatibility/Core/src/Android/Extensions/JavaObjectExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.Android -{ - internal static class JavaObjectExtensions - { - public static bool IsDisposed(this Java.Lang.Object obj) - { - return obj.Handle == IntPtr.Zero; - } - - public static bool IsAlive(this Java.Lang.Object obj) - { - if (obj == null) - return false; - - return !obj.IsDisposed(); - } - - public static bool IsDisposed(this global::Android.Runtime.IJavaObject obj) - { - return obj.Handle == IntPtr.Zero; - } - - public static bool IsAlive(this global::Android.Runtime.IJavaObject obj) - { - if (obj == null) - return false; - - return !obj.IsDisposed(); - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/Android/FastRenderers/ButtonRenderer.cs b/src/Compatibility/Core/src/Android/FastRenderers/ButtonRenderer.cs index 0b2aa41a3b49..04994b23196f 100644 --- a/src/Compatibility/Core/src/Android/FastRenderers/ButtonRenderer.cs +++ b/src/Compatibility/Core/src/Android/FastRenderers/ButtonRenderer.cs @@ -7,6 +7,7 @@ using AndroidX.AppCompat.Widget; using AndroidX.Core.View; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific; using AColor = Android.Graphics.Color; using AView = Android.Views.View; @@ -337,7 +338,7 @@ void UpdateFont() else { Typeface = font.ToTypeface(); - SetTextSize(ComplexUnitType.Sp, font.ToScaledPixel()); + SetTextSize(ComplexUnitType.Sp, (float)font.FontSize); } } diff --git a/src/Compatibility/Core/src/Android/FastRenderers/FrameRenderer.cs b/src/Compatibility/Core/src/Android/FastRenderers/FrameRenderer.cs index e18dd001d5fa..82bf172939bf 100644 --- a/src/Compatibility/Core/src/Android/FastRenderers/FrameRenderer.cs +++ b/src/Compatibility/Core/src/Android/FastRenderers/FrameRenderer.cs @@ -6,6 +6,7 @@ using Android.Views; using AndroidX.CardView.Widget; using AndroidX.Core.View; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using AView = Android.Views.View; diff --git a/src/Compatibility/Core/src/Android/FastRenderers/ImageRenderer.cs b/src/Compatibility/Core/src/Android/FastRenderers/ImageRenderer.cs index 0ad7fee81e48..88fcd1c557ea 100644 --- a/src/Compatibility/Core/src/Android/FastRenderers/ImageRenderer.cs +++ b/src/Compatibility/Core/src/Android/FastRenderers/ImageRenderer.cs @@ -5,6 +5,7 @@ using Android.Views; using AndroidX.Core.View; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AImageView = Android.Widget.ImageView; using AView = Android.Views.View; diff --git a/src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs b/src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs index d345458f44ae..7cd72f540224 100644 --- a/src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs +++ b/src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs @@ -7,6 +7,7 @@ using Android.Util; using Android.Views; using AndroidX.Core.View; +using Microsoft.Maui.Controls.Platform; using AView = Android.Views.View; using Color = Microsoft.Maui.Graphics.Color; using Size = Microsoft.Maui.Graphics.Size; @@ -323,7 +324,7 @@ void UpdateFont() _lastTypeface = newTypeface; } - float newTextSize = f.ToScaledPixel(); + float newTextSize = (float)f.FontSize; if (newTextSize != _lastTextSize) { SetTextSize(ComplexUnitType.Sp, newTextSize); diff --git a/src/Compatibility/Core/src/Android/Forms.cs b/src/Compatibility/Core/src/Android/Forms.cs index 9854bd14d257..8351b2145067 100644 --- a/src/Compatibility/Core/src/Android/Forms.cs +++ b/src/Compatibility/Core/src/Android/Forms.cs @@ -62,7 +62,6 @@ public static class Forms static bool? s_isNougatOrNewer; static bool? s_isOreoOrNewer; static bool? s_isPieOrNewer; - static FontManager s_fontManager; // One per process; does not change, suitable for loading resources (e.g., ResourceProvider) internal static Context ApplicationContext { get; private set; } = global::Android.App.Application.Context; @@ -155,9 +154,6 @@ internal static bool IsPieOrNewer } } - internal static IFontManager FontManager => - s_fontManager ??= new FontManager(Registrar.FontRegistrar); - public static float GetFontSizeNormal(Context context) { float size = 50; @@ -875,7 +871,8 @@ public async Task GetStreamAsync(Uri uri, CancellationToken cancellation public IIsolatedStorageFile GetUserStoreForApplication() { - return new _IsolatedStorageFile(IsolatedStorageFile.GetUserStoreForApplication()); + throw new NotImplementedException("GetUserStoreForApplication currently not available https://github.com/dotnet/runtime/issues/52332"); + //return new _IsolatedStorageFile(IsolatedStorageFile.GetUserStoreForApplication()); } public bool IsInvokeRequired diff --git a/src/Compatibility/Core/src/Android/PopupManager.cs b/src/Compatibility/Core/src/Android/PopupManager.cs index 7798f3d275cf..7b376797e3ee 100644 --- a/src/Compatibility/Core/src/Android/PopupManager.cs +++ b/src/Compatibility/Core/src/Android/PopupManager.cs @@ -9,6 +9,7 @@ using Microsoft.Maui.Controls.Internals; using AppCompatActivity = AndroidX.AppCompat.App.AppCompatActivity; using AppCompatAlertDialog = AndroidX.AppCompat.App.AlertDialog; +using AWindow = Android.Views.Window; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android { @@ -487,7 +488,7 @@ public void SetView(global::Android.Views.View view) } } - public Window Window => _useAppCompat ? _appcompatAlertDialog.Window : _legacyAlertDialog.Window; + public AWindow Window => _useAppCompat ? _appcompatAlertDialog.Window : _legacyAlertDialog.Window; public void Show() { diff --git a/src/Compatibility/Core/src/Android/RendererPool.cs b/src/Compatibility/Core/src/Android/RendererPool.cs index aa6077f633e1..e4b00aa35f24 100644 --- a/src/Compatibility/Core/src/Android/RendererPool.cs +++ b/src/Compatibility/Core/src/Android/RendererPool.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Android.Views; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android { diff --git a/src/Compatibility/Core/src/Android/RendererToHandlerShim.cs b/src/Compatibility/Core/src/Android/RendererToHandlerShim.cs index a8758cd72abc..43dc07da4275 100644 --- a/src/Compatibility/Core/src/Android/RendererToHandlerShim.cs +++ b/src/Compatibility/Core/src/Android/RendererToHandlerShim.cs @@ -22,7 +22,7 @@ public static IViewHandler CreateShim(object renderer) return new RendererToHandlerShim(); } - public RendererToHandlerShim() : base(Handlers.ViewHandler.ViewMapper) + public RendererToHandlerShim() : base(ViewHandler.ViewMapper) { } @@ -113,15 +113,15 @@ public override Size GetDesiredSize(double widthConstraint, double heightConstra VisualElementRenderer, widthConstraint, heightConstraint); } - public override void SetFrame(Rectangle frame) + public override void NativeArrange(Rectangle frame) { // This is a hack to force the shimmed control to actually do layout; without this, some controls won't actually // call OnLayout after SetFrame if their sizes haven't changed (e.g., ScrollView) // Luckily, measuring with MeasureSpecMode.Exactly is pretty fast, since it just returns the value you give it. - NativeView.Measure(MeasureSpecMode.Exactly.MakeMeasureSpec((int)frame.Width), + NativeView?.Measure(MeasureSpecMode.Exactly.MakeMeasureSpec((int)frame.Width), MeasureSpecMode.Exactly.MakeMeasureSpec((int)frame.Height)); - base.SetFrame(frame); + base.NativeArrange(frame); } } } diff --git a/src/Compatibility/Core/src/Android/Renderers/AndroidGIFImageParser.cs b/src/Compatibility/Core/src/Android/Renderers/AndroidGIFImageParser.cs index 1242e6e79d05..75ac1463e6d7 100644 --- a/src/Compatibility/Core/src/Android/Renderers/AndroidGIFImageParser.cs +++ b/src/Compatibility/Core/src/Android/Renderers/AndroidGIFImageParser.cs @@ -218,18 +218,18 @@ public override bool SelectDrawable(int index) public static async Task LoadImageAnimationAsync(UriImageSource imagesource, Context context, CancellationToken cancelationToken = default(CancellationToken)) { - Uri uri = imagesource?.Uri; FormsAnimationDrawable animation = null; - if (uri != null) + if (imagesource is IStreamImageSource streamImageSource) { - var options = new BitmapFactory.Options + using var stream = await streamImageSource.GetStreamAsync(cancelationToken).ConfigureAwait(false); + if (stream != null) { - InJustDecodeBounds = true - }; + var options = new BitmapFactory.Options + { + InJustDecodeBounds = true + }; - using (Stream stream = await imagesource.GetStreamAsync(cancelationToken).ConfigureAwait(false)) - { using (var decoder = new AndroidGIFImageParser(context, options.InDensity, options.InTargetDensity)) { try @@ -247,11 +247,11 @@ public override bool SelectDrawable(int index) animation = null; } } - } - if (animation == null) - { - Log.Warning(nameof(FileImageSourceHandler), "Could not retrieve image or image data was invalid: {0}", imagesource); + if (animation == null) + { + Log.Warning(nameof(FileImageSourceHandler), "Could not retrieve image or image data was invalid: {0}", imagesource); + } } } diff --git a/src/Compatibility/Core/src/Android/Renderers/BorderDrawable.cs b/src/Compatibility/Core/src/Android/Renderers/BorderDrawable.cs index acc73af8ca52..b297c2893a2a 100644 --- a/src/Compatibility/Core/src/Android/Renderers/BorderDrawable.cs +++ b/src/Compatibility/Core/src/Android/Renderers/BorderDrawable.cs @@ -2,6 +2,7 @@ using System.Linq; using Android.Graphics; using Android.Graphics.Drawables; +using Microsoft.Maui.Controls.Platform; using AColor = Android.Graphics.Color; using APath = Android.Graphics.Path; using Color = Microsoft.Maui.Graphics.Color; @@ -289,7 +290,7 @@ public void DrawOutline(Canvas canvas, int width, int height) path.AddRoundRect(rect, borderRadius, borderRadius, APath.Direction.Cw); paint.StrokeWidth = borderWidth; paint.SetStyle(Paint.Style.Stroke); - paint.Color = BorderElement.BorderColor.ToAndroid(); + paint.Color = BorderElement.BorderColor.ToAndroid(Graphics.Colors.Black); canvas.DrawPath(path, paint); } diff --git a/src/Compatibility/Core/src/Android/Renderers/BottomNavigationViewUtils.cs b/src/Compatibility/Core/src/Android/Renderers/BottomNavigationViewUtils.cs index 1952208f0637..da5a6f8225fc 100644 --- a/src/Compatibility/Core/src/Android/Renderers/BottomNavigationViewUtils.cs +++ b/src/Compatibility/Core/src/Android/Renderers/BottomNavigationViewUtils.cs @@ -7,6 +7,7 @@ using Android.Widget; using Google.Android.Material.BottomNavigation; using Google.Android.Material.BottomSheet; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using ALabelVisibilityMode = Google.Android.Material.BottomNavigation.LabelVisibilityMode; diff --git a/src/Compatibility/Core/src/Android/Renderers/BoxRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/BoxRenderer.cs index 23f545246872..d162d935ce63 100644 --- a/src/Compatibility/Core/src/Android/Renderers/BoxRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/BoxRenderer.cs @@ -2,6 +2,7 @@ using Android.Content; using Android.Graphics.Drawables; using Android.Views; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android diff --git a/src/Compatibility/Core/src/Android/Renderers/CarouselPageAdapter.cs b/src/Compatibility/Core/src/Android/Renderers/CarouselPageAdapter.cs index a7e5869deb65..51d17ec3a46d 100644 --- a/src/Compatibility/Core/src/Android/Renderers/CarouselPageAdapter.cs +++ b/src/Compatibility/Core/src/Android/Renderers/CarouselPageAdapter.cs @@ -6,6 +6,7 @@ using AndroidX.Core.View; using AndroidX.ViewPager.Widget; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Object = Java.Lang.Object; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android diff --git a/src/Compatibility/Core/src/Android/Renderers/CircularProgress.cs b/src/Compatibility/Core/src/Android/Renderers/CircularProgress.cs index 22fc9b6d549d..8bba52672658 100644 --- a/src/Compatibility/Core/src/Android/Renderers/CircularProgress.cs +++ b/src/Compatibility/Core/src/Android/Renderers/CircularProgress.cs @@ -6,6 +6,7 @@ using Android.OS; using Android.Util; using Android.Views; +using Microsoft.Maui.Controls.Platform; using AColor = Android.Graphics.Color; using AProgressBar = Android.Widget.ProgressBar; using Color = Microsoft.Maui.Graphics.Color; diff --git a/src/Compatibility/Core/src/Android/Renderers/EntryRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/EntryRenderer.cs index 9aca16339331..a37ab4036dbb 100644 --- a/src/Compatibility/Core/src/Android/Renderers/EntryRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/EntryRenderer.cs @@ -76,6 +76,7 @@ public EntryRendererBase(Context context) : base(context) AutoPackage = false; } + [PortHandler("Still pending the code related to Keyboard.")] bool TextView.IOnEditorActionListener.OnEditorAction(TextView v, ImeAction actionId, KeyEvent e) { // Fire Completed and dismiss keyboard for hardware / physical keyboards diff --git a/src/Compatibility/Core/src/Android/Renderers/FontExtensions.cs b/src/Compatibility/Core/src/Android/Renderers/FontExtensions.cs index 968011bd8fbe..bf1bffd7f92e 100644 --- a/src/Compatibility/Core/src/Android/Renderers/FontExtensions.cs +++ b/src/Compatibility/Core/src/Android/Renderers/FontExtensions.cs @@ -5,14 +5,11 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Android { public static class FontExtensions { - public static float ToScaledPixel(this Font self) - => Forms.FontManager.GetScaledPixel(self); - public static Typeface ToTypeface(this Font self) - => Forms.FontManager.GetTypeface(self); + => CompatServiceProvider.FontManager.GetTypeface(self); internal static Typeface ToTypeface(this string fontfamily, FontAttributes attr = FontAttributes.None) - => Forms.FontManager.GetTypeface(Font.OfSize(fontfamily, 0.0).WithAttributes(attr)); + => CompatServiceProvider.FontManager.GetTypeface(Font.OfSize(fontfamily, 0.0).WithAttributes(attr)); internal static bool IsDefault(this IFontElement self) => self.FontFamily == null && self.FontSize == Device.GetNamedSize(NamedSize.Default, typeof(Label), true) && self.FontAttributes == FontAttributes.None; @@ -20,11 +17,11 @@ internal static bool IsDefault(this IFontElement self) internal static Typeface ToTypeface(this IFontElement self) { if (self.IsDefault()) - return Forms.FontManager.DefaultTypeface; + return CompatServiceProvider.FontManager.DefaultTypeface; var font = Font.OfSize(self.FontFamily, self.FontSize).WithAttributes(self.FontAttributes); - return Forms.FontManager.GetTypeface(font); + return CompatServiceProvider.FontManager.GetTypeface(font); } } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/Android/Renderers/FormattedStringExtensions.cs b/src/Compatibility/Core/src/Android/Renderers/FormattedStringExtensions.cs index 0130cac849f0..540bb7d0b021 100644 --- a/src/Compatibility/Core/src/Android/Renderers/FormattedStringExtensions.cs +++ b/src/Compatibility/Core/src/Android/Renderers/FormattedStringExtensions.cs @@ -102,7 +102,7 @@ public override void UpdateMeasureState(TextPaint p) void Apply(Paint paint) { paint.SetTypeface(Font.ToTypeface()); - float value = Font.ToScaledPixel(); + float value = (float)Font.FontSize; paint.TextSize = TypedValue.ApplyDimension(ComplexUnitType.Sp, value, TextView.Resources.DisplayMetrics); if (Forms.IsLollipopOrNewer) { diff --git a/src/Compatibility/Core/src/Android/Renderers/ImageExtensions.cs b/src/Compatibility/Core/src/Android/Renderers/ImageExtensions.cs deleted file mode 100644 index afb5c968319a..000000000000 --- a/src/Compatibility/Core/src/Android/Renderers/ImageExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Android.Widget; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.Android -{ - internal static class ImageExtensions - { - static ImageView.ScaleType s_fill; - static ImageView.ScaleType s_aspectFill; - static ImageView.ScaleType s_aspectFit; - - public static ImageView.ScaleType ToScaleType(this Aspect aspect) - { - switch (aspect) - { - case Aspect.Fill: - return s_fill ?? (s_fill = ImageView.ScaleType.FitXy); - case Aspect.AspectFill: - return s_aspectFill ?? (s_aspectFill = ImageView.ScaleType.CenterCrop); - default: - case Aspect.AspectFit: - return s_aspectFit ?? (s_aspectFit = ImageView.ScaleType.FitCenter); - } - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/Android/Renderers/ImageLoaderSourceHandler.cs b/src/Compatibility/Core/src/Android/Renderers/ImageLoaderSourceHandler.cs index 709c5753126e..48871e6acec9 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ImageLoaderSourceHandler.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ImageLoaderSourceHandler.cs @@ -11,17 +11,20 @@ public sealed class ImageLoaderSourceHandler : IAnimationSourceHandler, IImageSo { public async Task LoadImageAsync(ImageSource imagesource, Context context, CancellationToken cancelationToken = default(CancellationToken)) { - var imageLoader = imagesource as UriImageSource; Bitmap bitmap = null; - if (imageLoader?.Uri != null) + + if (imagesource is IStreamImageSource imageLoader) { - using (Stream imageStream = await imageLoader.GetStreamAsync(cancelationToken).ConfigureAwait(false)) + using var imageStream = await imageLoader.GetStreamAsync(cancelationToken).ConfigureAwait(false); + if (imageStream != null) + { bitmap = await BitmapFactory.DecodeStreamAsync(imageStream).ConfigureAwait(false); - } - if (bitmap == null) - { - Log.Warning(nameof(ImageLoaderSourceHandler), "Could not retrieve image or image data was invalid: {0}", imageLoader); + if (bitmap == null) + { + Log.Warning(nameof(ImageLoaderSourceHandler), "Could not retrieve image or image data was invalid: {0}", imagesource); + } + } } return bitmap; diff --git a/src/Compatibility/Core/src/Android/Renderers/LabelRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/LabelRenderer.cs index ec612adacde0..301d118ca85a 100644 --- a/src/Compatibility/Core/src/Android/Renderers/LabelRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/LabelRenderer.cs @@ -201,7 +201,7 @@ void UpdateFont() _lastTypeface = newTypeface; } - float newTextSize = f.ToScaledPixel(); + float newTextSize = (float)f.FontSize; if (newTextSize != _lastTextSize) { _view.SetTextSize(ComplexUnitType.Sp, newTextSize); diff --git a/src/Compatibility/Core/src/Android/Renderers/MasterDetailContainer.cs b/src/Compatibility/Core/src/Android/Renderers/MasterDetailContainer.cs index 3d94f8bd0e5d..577600751866 100644 --- a/src/Compatibility/Core/src/Android/Renderers/MasterDetailContainer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/MasterDetailContainer.cs @@ -4,6 +4,7 @@ using Android.Runtime; using Android.Views; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android diff --git a/src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs index b15fada7c1d2..38f5a0c8492f 100644 --- a/src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs @@ -4,6 +4,7 @@ using Android.Views; using Android.Views.Accessibility; using AndroidX.Core.Content; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using AColorRes = Android.Resource.Color; diff --git a/src/Compatibility/Core/src/Android/Renderers/RefreshViewRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/RefreshViewRenderer.cs index 765f7d52c761..50466db06645 100644 --- a/src/Compatibility/Core/src/Android/Renderers/RefreshViewRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/RefreshViewRenderer.cs @@ -9,6 +9,7 @@ using AndroidX.RecyclerView.Widget; using AndroidX.SwipeRefreshLayout.Widget; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AView = Android.Views.View; using AWebView = Android.Webkit.WebView; diff --git a/src/Compatibility/Core/src/Android/Renderers/ScrollViewContainer.cs b/src/Compatibility/Core/src/Android/Renderers/ScrollViewContainer.cs index 7dc2f2540e10..455dfdb74d4c 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ScrollViewContainer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ScrollViewContainer.cs @@ -1,5 +1,6 @@ using Android.Content; using Android.Views; +using Microsoft.Maui.Controls.Platform; using AView = Android.Views.View; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android diff --git a/src/Compatibility/Core/src/Android/Renderers/ScrollViewRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/ScrollViewRenderer.cs index b6efd2e241a1..a9b3d9952e96 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ScrollViewRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ScrollViewRenderer.cs @@ -8,6 +8,7 @@ using Android.Widget; using AndroidX.Core.Widget; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AView = Android.Views.View; using Point = Microsoft.Maui.Graphics.Point; diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellBottomNavViewAppearanceTracker.cs b/src/Compatibility/Core/src/Android/Renderers/ShellBottomNavViewAppearanceTracker.cs index 3f99af543113..ee8c80a89355 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellBottomNavViewAppearanceTracker.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellBottomNavViewAppearanceTracker.cs @@ -2,6 +2,7 @@ using Android.Content.Res; using Android.Graphics.Drawables; using Google.Android.Material.BottomNavigation; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using R = Android.Resource; diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellFlyoutRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/ShellFlyoutRenderer.cs index 5da0d68f8a18..a7eede9eadfc 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellFlyoutRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellFlyoutRenderer.cs @@ -6,6 +6,7 @@ using Android.Views; using AndroidX.DrawerLayout.Widget; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AView = Android.Views.View; using Color = Microsoft.Maui.Graphics.Color; diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellFlyoutTemplatedContentRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/ShellFlyoutTemplatedContentRenderer.cs index 9ac78e26c6ce..631783318e8b 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellFlyoutTemplatedContentRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellFlyoutTemplatedContentRenderer.cs @@ -10,6 +10,7 @@ using AndroidX.RecyclerView.Widget; using Google.Android.Material.AppBar; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using AView = Android.Views.View; using LP = Android.Views.ViewGroup.LayoutParams; diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellItemRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/ShellItemRenderer.cs index 9ab6241c7189..65ffb8055a6c 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellItemRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellItemRenderer.cs @@ -9,6 +9,7 @@ using Android.Widget; using Google.Android.Material.BottomNavigation; using Google.Android.Material.BottomSheet; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using AView = Android.Views.View; diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellItemRendererBase.cs b/src/Compatibility/Core/src/Android/Renderers/ShellItemRendererBase.cs index 95d9af496b4d..cdb511a13388 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellItemRendererBase.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellItemRendererBase.cs @@ -7,6 +7,7 @@ using Android.Views; using AndroidX.Fragment.App; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/ShellRenderer.cs index 3b669719decb..5c8b153787b6 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellRenderer.cs @@ -8,6 +8,7 @@ using AndroidX.DrawerLayout.Widget; using AndroidX.Fragment.App; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using ARect = Android.Graphics.Rect; diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellSearchView.cs b/src/Compatibility/Core/src/Android/Renderers/ShellSearchView.cs index d17843f17fcc..9febabe89e30 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellSearchView.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellSearchView.cs @@ -12,6 +12,7 @@ using AndroidX.CardView.Widget; using Java.Lang; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; +using Microsoft.Maui.Controls.Platform; using AColor = Android.Graphics.Color; using AImageButton = Android.Widget.ImageButton; using ASupportDrawable = AndroidX.AppCompat.Graphics.Drawable; diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellTabLayoutAppearanceTracker.cs b/src/Compatibility/Core/src/Android/Renderers/ShellTabLayoutAppearanceTracker.cs index d450a911a1b6..5582a4c00886 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellTabLayoutAppearanceTracker.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellTabLayoutAppearanceTracker.cs @@ -1,5 +1,6 @@ using Android.Graphics.Drawables; using Google.Android.Material.Tabs; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellToolbarAppearanceTracker.cs b/src/Compatibility/Core/src/Android/Renderers/ShellToolbarAppearanceTracker.cs index 6bbff15fa8a5..46e2bcb201f2 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellToolbarAppearanceTracker.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellToolbarAppearanceTracker.cs @@ -1,5 +1,6 @@ using Android.Graphics.Drawables; using AndroidX.AppCompat.Widget; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellToolbarTracker.cs b/src/Compatibility/Core/src/Android/Renderers/ShellToolbarTracker.cs index 4f0de383c6de..df9b2a77221b 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellToolbarTracker.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellToolbarTracker.cs @@ -14,6 +14,7 @@ using AndroidX.DrawerLayout.Widget; using Google.Android.Material.AppBar; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AColor = Android.Graphics.Color; using ActionBarDrawerToggle = AndroidX.AppCompat.App.ActionBarDrawerToggle; diff --git a/src/Compatibility/Core/src/Android/Renderers/ShellViewRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/ShellViewRenderer.cs index c98630d24460..cfacbb16b235 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ShellViewRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ShellViewRenderer.cs @@ -4,6 +4,7 @@ using Android.Util; using Android.Views; using Google.Android.Material.AppBar; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AView = Android.Views.View; using LP = Android.Views.ViewGroup.LayoutParams; diff --git a/src/Compatibility/Core/src/Android/Renderers/SwipeViewRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/SwipeViewRenderer.cs index cc639793cebd..ffe76677dcea 100644 --- a/src/Compatibility/Core/src/Android/Renderers/SwipeViewRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/SwipeViewRenderer.cs @@ -11,6 +11,7 @@ using AndroidX.RecyclerView.Widget; using Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific; using Microsoft.Maui.Graphics; using AButton = AndroidX.AppCompat.Widget.AppCompatButton; diff --git a/src/Compatibility/Core/src/Android/ViewExtensions.cs b/src/Compatibility/Core/src/Android/ViewExtensions.cs index 24978437c6cb..78a32d24dac2 100644 --- a/src/Compatibility/Core/src/Android/ViewExtensions.cs +++ b/src/Compatibility/Core/src/Android/ViewExtensions.cs @@ -12,100 +12,8 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Android { - public static class ViewExtensions + internal static class ViewExtensions { - static readonly int s_apiLevel; - - static ViewExtensions() - { - s_apiLevel = (int)Forms.SdkInt; - } - - public static void RemoveFromParent(this AView view) - { - if (view == null) - return; - if (view.Parent == null) - return; - ((ViewGroup)view.Parent).RemoveView(view); - } - - public static void SetBackground(this AView view, Drawable drawable) - { - if (s_apiLevel < 16) - { -#pragma warning disable 618 // Using older method for compatibility with API 15 - view.SetBackgroundDrawable(drawable); -#pragma warning restore 618 - } - else - { - view.Background = drawable; - } - - } - - public static void SetWindowBackground(this AView view) - { - Context context = view.Context; - using (var background = new TypedValue()) - { - if (context.Theme.ResolveAttribute(global::Android.Resource.Attribute.WindowBackground, background, true)) - { - string type = context.Resources.GetResourceTypeName(background.ResourceId).ToLower(); - switch (type) - { - case "color": - var color = new AColor(ContextCompat.GetColor(context, background.ResourceId)); - view.SetBackgroundColor(color); - break; - case "drawable": - using (Drawable drawable = ContextCompat.GetDrawable(context, background.ResourceId)) - view.SetBackground(drawable); - break; - } - } - } - } - - public static void EnsureId(this AView view) - { - if (view.IsDisposed()) - { - return; - } - - if (view.Id == AView.NoId) - { - view.Id = AppCompat.Platform.GenerateViewId(); - } - } - - public static bool GetClipToOutline(this AView view) - { - if (view.IsDisposed() || !Forms.IsLollipopOrNewer) - return false; - - return view.ClipToOutline; - } - - public static void SetClipToOutline(this AView view, bool value) - { - if (view.IsDisposed() || !Forms.IsLollipopOrNewer) - return; - - view.ClipToOutline = value; - } - - public static bool SetElevation(this AView view, float value) - { - if (view.IsDisposed() || !Forms.IsLollipopOrNewer) - return false; - - view.Elevation = value; - return true; - } - internal static void MaybeRequestLayout(this AView view) { var isInLayout = false; diff --git a/src/Compatibility/Core/src/Android/ViewRenderer.cs b/src/Compatibility/Core/src/Android/ViewRenderer.cs index 571060be8478..fbeee2e8a4a5 100644 --- a/src/Compatibility/Core/src/Android/ViewRenderer.cs +++ b/src/Compatibility/Core/src/Android/ViewRenderer.cs @@ -3,6 +3,7 @@ using Android.Content; using Android.Views; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AView = Android.Views.View; @@ -96,7 +97,7 @@ void AView.IOnFocusChangeListener.OnFocusChange(AView v, bool hasFocus) if (isInViewCell) { - Window window = Context.GetActivity().Window; + var window = Context.GetActivity().Window; if (hasFocus) { _startingInputMode = window.Attributes.SoftInputMode; diff --git a/src/Compatibility/Core/src/Android/VisualElementPackager.cs b/src/Compatibility/Core/src/Android/VisualElementPackager.cs index 67fb7b5dd0f4..29bc023ffde8 100644 --- a/src/Compatibility/Core/src/Android/VisualElementPackager.cs +++ b/src/Compatibility/Core/src/Android/VisualElementPackager.cs @@ -3,6 +3,7 @@ using System.Collections.ObjectModel; using Android.Views; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using AView = Android.Views.View; namespace Microsoft.Maui.Controls.Compatibility.Platform.Android diff --git a/src/Compatibility/Core/src/Android/VisualElementRenderer.cs b/src/Compatibility/Core/src/Android/VisualElementRenderer.cs index 52d7de5d8b04..058ee15ca4c6 100644 --- a/src/Compatibility/Core/src/Android/VisualElementRenderer.cs +++ b/src/Compatibility/Core/src/Android/VisualElementRenderer.cs @@ -9,6 +9,7 @@ using AndroidX.Core.View; using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using AView = Android.Views.View; using Color = Microsoft.Maui.Graphics.Color; diff --git a/src/Compatibility/Core/src/Android/VisualElementTracker.cs b/src/Compatibility/Core/src/Android/VisualElementTracker.cs index d37da8819f65..1dc281f38f8b 100644 --- a/src/Compatibility/Core/src/Android/VisualElementTracker.cs +++ b/src/Compatibility/Core/src/Android/VisualElementTracker.cs @@ -105,7 +105,7 @@ public void UpdateLayout() else if (aview is LayoutViewGroup && width == 0 && height == 0) { // Nothing to do here; just chill. - } + } else { Performance.Start(reference, "Measure"); @@ -332,6 +332,7 @@ void UpdateClip() aView?.Invalidate(); } + [PortHandler] void UpdateIsVisible() { VisualElement view = _renderer.Element; diff --git a/src/Compatibility/Core/src/AppHostBuilderExtensions.cs b/src/Compatibility/Core/src/AppHostBuilderExtensions.cs index 54edb25b2d22..1a18c6a5ebd4 100644 --- a/src/Compatibility/Core/src/AppHostBuilderExtensions.cs +++ b/src/Compatibility/Core/src/AppHostBuilderExtensions.cs @@ -1,13 +1,43 @@ +#nullable enable using System; using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Maui.Hosting; namespace Microsoft.Maui.Controls.Compatibility { public static class AppHostBuilderExtensions { - // This won't really be a thing once we have all the handlers built - static readonly List ControlsWithHandlers = new List + public static IAppHostBuilder UseFormsCompatibility(this IAppHostBuilder builder, bool registerRenderers = true) + { + // TODO: this hideousness is just until the dynamic handler registration is merged + FormsCompatBuilder? compatBuilder = null; + IMauiHandlersCollection? handlersCollection = null; + builder.ConfigureMauiHandlers(handlers => + { + handlersCollection = handlers; + compatBuilder?.SetHandlersCollection(handlersCollection); + }); + + builder.ConfigureServices(compat => + { + // TODO: this hideousness is just until the dynamic handler registration is merged + compatBuilder = compat; + if (handlersCollection != null) + compatBuilder.SetHandlersCollection(handlersCollection); + + compat.UseCompatibilityRenderers = registerRenderers; + }); + + return builder; + } + } + + class FormsCompatBuilder : IMauiServiceBuilder + { + // TODO: This won't really be a thing once we have all the handlers built + static readonly List ControlsWithHandlers = new() { typeof(Button), typeof(ContentPage), @@ -15,6 +45,7 @@ public static class AppHostBuilderExtensions typeof(Label), typeof(CheckBox), typeof(Entry), + typeof(Image), typeof(Switch), typeof(Editor), typeof(ActivityIndicator), @@ -27,10 +58,25 @@ public static class AppHostBuilderExtensions typeof(TimePicker), }; - public static IAppHostBuilder UseFormsCompatibility(this IAppHostBuilder builder, bool registerRenderers = true) + static readonly List<(Type Control, Type Renderer)> PendingRenderers = new(); + + IMauiHandlersCollection? _handlers; + + public bool UseCompatibilityRenderers { get; set; } + + public void SetHandlersCollection(IMauiHandlersCollection handlersCollection) => + _handlers = handlersCollection; + + public static void AddRenderer(Type control, Type renderer) => + PendingRenderers.Add((control, renderer)); + + public void ConfigureServices(HostBuilderContext context, IServiceCollection services) + { + } + + public void Configure(HostBuilderContext context, IServiceProvider services) { - // TODO: This should not be immediately run, but rather a registered delegate with values - // of the Context and LaunchActivatedEventArgs passed in. + CompatServiceProvider.SetServiceProvider(services); #if __ANDROID__ var options = new InitializationOptions(global::Android.App.Application.Context, null, null); @@ -44,29 +90,28 @@ public static IAppHostBuilder UseFormsCompatibility(this IAppHostBuilder builder Forms.Init(options); - if (registerRenderers) - builder.UseCompatibilityRenderers(); - - return builder; - } - - public static IAppHostBuilder UseCompatibilityRenderers(this IAppHostBuilder builder) - { - Forms.RegisterCompatRenderers( - new[] { typeof(RendererToHandlerShim).Assembly }, - typeof(RendererToHandlerShim).Assembly, - (controlType) => - { - foreach (var type in ControlsWithHandlers) + if (UseCompatibilityRenderers) + { + Forms.RegisterCompatRenderers( + new[] { typeof(RendererToHandlerShim).Assembly }, + typeof(RendererToHandlerShim).Assembly, + (controlType) => { - if (type.IsAssignableFrom(controlType)) - return; - } + foreach (var type in ControlsWithHandlers) + { + if (type.IsAssignableFrom(controlType)) + return; + } - builder.ConfigureMauiHandlers((_, handlersCollection) => handlersCollection.AddHandler(controlType, typeof(RendererToHandlerShim))); - }); + _handlers?.AddHandler(controlType, typeof(RendererToHandlerShim)); + }); + } - return builder; + // register renderer with old registrar so it can get shimmed + foreach (var (control, renderer) in PendingRenderers) + { + Internals.Registrar.Registered.Register(control, renderer); + } } } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/Compatibility-net6.csproj b/src/Compatibility/Core/src/Compatibility-net6.csproj index 552c28389a8f..0df5eed659c8 100644 --- a/src/Compatibility/Core/src/Compatibility-net6.csproj +++ b/src/Compatibility/Core/src/Compatibility-net6.csproj @@ -15,7 +15,7 @@ $(NoWarn);CA1416;CS8305 - $(DefineConstants);WINDOWS_UWP;WINDOWS + $(DefineConstants);WINDOWS win10-x86;win10-x64;win10-arm64 @@ -75,17 +75,11 @@ - - Crc64.cs - - - StreamWrapper.cs - - + @@ -95,8 +89,4 @@ - - - - diff --git a/src/Compatibility/Core/src/GTK/Compatibility.GTK.csproj b/src/Compatibility/Core/src/GTK/Compatibility.GTK.csproj index d590e5baab81..4175f802f74d 100644 --- a/src/Compatibility/Core/src/GTK/Compatibility.GTK.csproj +++ b/src/Compatibility/Core/src/GTK/Compatibility.GTK.csproj @@ -98,12 +98,6 @@ - - Crc64.cs - - - StreamWrapper.cs - diff --git a/src/Compatibility/Core/src/MacOS/Compatibility.macOS.csproj b/src/Compatibility/Core/src/MacOS/Compatibility.macOS.csproj index b4cf4f76e98c..002a434d93a1 100644 --- a/src/Compatibility/Core/src/MacOS/Compatibility.macOS.csproj +++ b/src/Compatibility/Core/src/MacOS/Compatibility.macOS.csproj @@ -76,12 +76,6 @@ - - Crc64.cs - - - StreamWrapper.cs - Extensions\LabelExtensions.cs diff --git a/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs b/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs index 16c813d38671..bde838b776a9 100644 --- a/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs +++ b/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs @@ -7,11 +7,7 @@ public static class MauiHandlersCollectionExtensions { public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, Type rendererType) { - // register renderer with old registrar so it can get shimmed - // This will move to some extension method - Microsoft.Maui.Controls.Internals.Registrar.Registered.Register( - controlType, - rendererType); + FormsCompatBuilder.AddRenderer(controlType, rendererType); handlersCollection.AddHandler(controlType, typeof(RendererToHandlerShim)); @@ -21,11 +17,7 @@ public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandler public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection) where TMauiType : IFrameworkElement { - // register renderer with old registrar so it can get shimmed - // This will move to some extension method - Controls.Internals.Registrar.Registered.Register( - typeof(TControlType), - typeof(TRenderer)); + FormsCompatBuilder.AddRenderer(typeof(TControlType), typeof(TRenderer)); handlersCollection.AddHandler(); diff --git a/src/Compatibility/Core/src/WinUI/AccessibilityExtensions.cs b/src/Compatibility/Core/src/WinUI/AccessibilityExtensions.cs index d7dc9c07763e..32b334ac86ab 100644 --- a/src/Compatibility/Core/src/WinUI/AccessibilityExtensions.cs +++ b/src/Compatibility/Core/src/WinUI/AccessibilityExtensions.cs @@ -6,91 +6,6 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { public static class AccessibilityExtensions { - public static void SetAutomationPropertiesAutomationId(this FrameworkElement Control, string id) - { - Control.SetValue(NativeAutomationProperties.AutomationIdProperty, id); - } - - public static string SetAutomationPropertiesName(this FrameworkElement Control, Element Element, string _defaultAutomationPropertiesName = null) - { - if (Element == null) - return _defaultAutomationPropertiesName; - - if (_defaultAutomationPropertiesName == null) - _defaultAutomationPropertiesName = (string)Control.GetValue(NativeAutomationProperties.NameProperty); - - var elemValue = (string)Element.GetValue(AutomationProperties.NameProperty); - - if (!string.IsNullOrWhiteSpace(elemValue)) - Control.SetValue(NativeAutomationProperties.NameProperty, elemValue); - else - Control.SetValue(NativeAutomationProperties.NameProperty, _defaultAutomationPropertiesName); - - return _defaultAutomationPropertiesName; - } - - public static AccessibilityView? SetAutomationPropertiesAccessibilityView(this FrameworkElement Control, Element Element, AccessibilityView? _defaultAutomationPropertiesAccessibilityView = null) - { - if (Element == null) - return _defaultAutomationPropertiesAccessibilityView; - - if (!_defaultAutomationPropertiesAccessibilityView.HasValue) - _defaultAutomationPropertiesAccessibilityView = (AccessibilityView)Control.GetValue(NativeAutomationProperties.AccessibilityViewProperty); - - var newValue = _defaultAutomationPropertiesAccessibilityView; - - var elemValue = (bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty); - - if (elemValue == true) - newValue = AccessibilityView.Content; - else if (elemValue == false) - newValue = AccessibilityView.Raw; - - Control.SetValue(NativeAutomationProperties.AccessibilityViewProperty, newValue); - - return _defaultAutomationPropertiesAccessibilityView; - - } - public static string SetAutomationPropertiesHelpText(this FrameworkElement Control, Element Element, string _defaultAutomationPropertiesHelpText = null) - { - if (Element == null) - return _defaultAutomationPropertiesHelpText; - - if (_defaultAutomationPropertiesHelpText == null) - _defaultAutomationPropertiesHelpText = (string)Control.GetValue(NativeAutomationProperties.HelpTextProperty); - - var elemValue = (string)Element.GetValue(AutomationProperties.HelpTextProperty); - - if (!string.IsNullOrWhiteSpace(elemValue)) - Control.SetValue(NativeAutomationProperties.HelpTextProperty, elemValue); - else - Control.SetValue(NativeAutomationProperties.HelpTextProperty, _defaultAutomationPropertiesHelpText); - - return _defaultAutomationPropertiesHelpText; - } - - public static UIElement SetAutomationPropertiesLabeledBy(this FrameworkElement Control, Element Element, UIElement _defaultAutomationPropertiesLabeledBy = null) - { - if (Element == null) - return _defaultAutomationPropertiesLabeledBy; - - if (_defaultAutomationPropertiesLabeledBy == null) - _defaultAutomationPropertiesLabeledBy = (UIElement)Control.GetValue(NativeAutomationProperties.LabeledByProperty); - - var elemValue = (VisualElement)Element.GetValue(AutomationProperties.LabeledByProperty); - - var renderer = elemValue?.GetOrCreateRenderer(); - - var nativeElement = renderer?.GetNativeElement(); - - if (nativeElement != null) - Control.SetValue(AutomationProperties.LabeledByProperty, nativeElement); - else - Control.SetValue(NativeAutomationProperties.LabeledByProperty, _defaultAutomationPropertiesLabeledBy); - - return _defaultAutomationPropertiesLabeledBy; - } - // TODO: This is not having any effect on anything I've tested yet. See if we need it // after we test the FP and NP w/ back button explicitly enabled. public static void SetBackButtonTitle(this PageControl Control, Element Element) @@ -106,7 +21,7 @@ public static void SetBackButtonTitle(this PageControl Control, Element Element) static string ConcatenateNameAndHint(Element Element) { string separator; - + var name = (string)Element.GetValue(AutomationProperties.NameProperty); var hint = (string)Element.GetValue(AutomationProperties.HelpTextProperty); @@ -122,17 +37,5 @@ static string ConcatenateNameAndHint(Element Element) return string.Join(separator, name, hint); } - - internal static void SetAutomationProperties( - this FrameworkElement frameworkElement, - Element element, - string defaultName = null) - { - frameworkElement.SetAutomationPropertiesAutomationId(element?.AutomationId); - frameworkElement.SetAutomationPropertiesName(element, defaultName); - frameworkElement.SetAutomationPropertiesHelpText(element); - frameworkElement.SetAutomationPropertiesLabeledBy(element); - frameworkElement.SetAutomationPropertiesAccessibilityView(element); - } } } diff --git a/src/Compatibility/Core/src/WinUI/ActivityIndicatorRenderer.cs b/src/Compatibility/Core/src/WinUI/ActivityIndicatorRenderer.cs index 145c3f2f72db..d29f3fe46077 100644 --- a/src/Compatibility/Core/src/WinUI/ActivityIndicatorRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/ActivityIndicatorRenderer.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -55,7 +56,7 @@ void UpdateColor() } else { - Control.Foreground = color.ToBrush(); + Control.Foreground = Maui.ColorExtensions.ToNative(color); } } diff --git a/src/Compatibility/Core/src/WinUI/AlignmentExtensions.cs b/src/Compatibility/Core/src/WinUI/AlignmentExtensions.cs index 1126276d13a3..ebfe86cb5aaf 100644 --- a/src/Compatibility/Core/src/WinUI/AlignmentExtensions.cs +++ b/src/Compatibility/Core/src/WinUI/AlignmentExtensions.cs @@ -37,6 +37,7 @@ internal static VerticalAlignment ToNativeVerticalAlignment(this TextAlignment a } } + [PortHandler] internal static HorizontalAlignment ToNativeHorizontalAlignment(this TextAlignment alignment) { switch (alignment) diff --git a/src/Compatibility/Core/src/WinUI/BackgroundTracker.cs b/src/Compatibility/Core/src/WinUI/BackgroundTracker.cs index 5241cf756486..305b79ceaec2 100644 --- a/src/Compatibility/Core/src/WinUI/BackgroundTracker.cs +++ b/src/Compatibility/Core/src/WinUI/BackgroundTracker.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Media; @@ -64,7 +65,7 @@ async void UpdateBackground() Color backgroundColor = Element.BackgroundColor; if (!backgroundColor.IsDefault()) { - element.SetValue(_backgroundProperty, backgroundColor.ToBrush()); + element.SetValue(_backgroundProperty, Maui.ColorExtensions.ToNative(backgroundColor)); } else { diff --git a/src/Compatibility/Core/src/WinUI/BoxViewBorderRenderer.cs b/src/Compatibility/Core/src/WinUI/BoxViewBorderRenderer.cs index cf6522a67461..df11e4f84f30 100644 --- a/src/Compatibility/Core/src/WinUI/BoxViewBorderRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/BoxViewBorderRenderer.cs @@ -3,6 +3,7 @@ using Microsoft.UI.Xaml.Automation.Peers; using Microsoft.UI.Xaml.Controls; using WShape = Microsoft.UI.Xaml.Shapes.Shape; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -66,7 +67,7 @@ protected override void UpdateBackgroundColor() backgroundColor = Element.BackgroundColor; } - Control.Background = backgroundColor.IsDefault() ? null : backgroundColor.ToBrush(); + Control.Background = backgroundColor.IsDefault() ? null : Maui.ColorExtensions.ToNative(backgroundColor); } protected override void UpdateBackground() @@ -81,7 +82,7 @@ protected override void UpdateBackground() Color backgroundColor = Element.BackgroundColor; if (!backgroundColor.IsDefault()) - Control.Background = backgroundColor.ToBrush(); + Control.Background = Maui.ColorExtensions.ToNative(backgroundColor); else { if (Element.Color.IsDefault()) @@ -97,7 +98,7 @@ void SetColor(Color color) if (color.IsDefault()) UpdateBackground(); else - Control.Background = color.ToBrush(); + Control.Background = Maui.ColorExtensions.ToNative(color); } void SetCornerRadius(CornerRadius cornerRadius) diff --git a/src/Compatibility/Core/src/WinUI/BrushConverter.cs b/src/Compatibility/Core/src/WinUI/BrushConverter.cs index 27e3c69ccb23..87d0c308132e 100644 --- a/src/Compatibility/Core/src/WinUI/BrushConverter.cs +++ b/src/Compatibility/Core/src/WinUI/BrushConverter.cs @@ -1,4 +1,5 @@ using System; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP @@ -10,7 +11,7 @@ public object Convert(object value, Type targetType, object parameter, string la var brush = value as Brush; var color = (Color)parameter; - return Brush.IsNullOrEmpty(brush) ? color.ToBrush() : brush.ToBrush(); + return Brush.IsNullOrEmpty(brush) ? Maui.ColorExtensions.ToNative(color) : brush.ToBrush(); } public object ConvertBack(object value, Type targetType, object parameter, string language) diff --git a/src/Compatibility/Core/src/WinUI/BrushHelpers.cs b/src/Compatibility/Core/src/WinUI/BrushHelpers.cs index 5d9b9defaa2d..ec5fd42ccec2 100644 --- a/src/Compatibility/Core/src/WinUI/BrushHelpers.cs +++ b/src/Compatibility/Core/src/WinUI/BrushHelpers.cs @@ -1,4 +1,5 @@ using System; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using WBrush = Microsoft.UI.Xaml.Media.Brush; @@ -32,7 +33,7 @@ public static void UpdateColor(Color color, ref WBrush defaultbrush, Func getter, Action setter) diff --git a/src/Compatibility/Core/src/WinUI/ButtonRenderer.cs b/src/Compatibility/Core/src/WinUI/ButtonRenderer.cs index bf7322e7acc9..c9a90784bffa 100644 --- a/src/Compatibility/Core/src/WinUI/ButtonRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/ButtonRenderer.cs @@ -8,8 +8,8 @@ using WImage = Microsoft.UI.Xaml.Controls.Image; using WStretch = Microsoft.UI.Xaml.Media.Stretch; using WThickness = Microsoft.UI.Xaml.Thickness; -using Microsoft.Maui.Controls.Compatibility.Platform.UAP.Extensions; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -169,14 +169,14 @@ void OnPointerPressed(object sender, RoutedEventArgs e) void UpdateBackgroundBrush() { if (Brush.IsNullOrEmpty(Element.Background)) - Control.BackgroundColor = Element.BackgroundColor.IsNotDefault() ? Element.BackgroundColor.ToBrush() : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"]; + Control.BackgroundColor = Element.BackgroundColor.IsNotDefault() ? Maui.ColorExtensions.ToNative(Element.BackgroundColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"]; else Control.BackgroundColor = Element.Background.ToBrush(); } void UpdateBorderColor() { - Control.BorderBrush = !Element.BorderColor.IsDefault() ? Element.BorderColor.ToBrush() : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBorderThemeBrush"]; + Control.BorderBrush = !Element.BorderColor.IsDefault() ? Maui.ColorExtensions.ToNative(Element.BorderColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBorderThemeBrush"]; } void UpdateBorderRadius() @@ -301,7 +301,7 @@ void UpdateFont() if (Element.Font == Font.Default && !_fontApplied) return; - Font fontToApply = Element.Font == Font.Default ? Font.SystemFontOfSize(NamedSize.Medium) : Element.Font; + Font fontToApply = Element.Font == Font.Default ? Font.SystemFontOfSize(Device.GetNamedSize(NamedSize.Medium, Element.GetType(), false)) : Element.Font; Control.ApplyFont(fontToApply); _fontApplied = true; @@ -309,7 +309,7 @@ void UpdateFont() void UpdateTextColor() { - Control.Foreground = Element.TextColor.IsNotDefault() ? Element.TextColor.ToBrush() : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["DefaultTextForegroundThemeBrush"]; + Control.Foreground = Element.TextColor.IsNotDefault() ? Maui.ColorExtensions.ToNative(Element.TextColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["DefaultTextForegroundThemeBrush"]; } void UpdatePadding() diff --git a/src/Compatibility/Core/src/WinUI/CarouselPageRenderer.cs b/src/Compatibility/Core/src/WinUI/CarouselPageRenderer.cs index d6bc57dcdcae..a175f787f6ae 100644 --- a/src/Compatibility/Core/src/WinUI/CarouselPageRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/CarouselPageRenderer.cs @@ -6,6 +6,7 @@ using Microsoft.Maui.Controls.Internals; using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/CheckBoxRenderer.cs b/src/Compatibility/Core/src/WinUI/CheckBoxRenderer.cs index f04dd8336d0e..9b6c672dfc07 100644 --- a/src/Compatibility/Core/src/WinUI/CheckBoxRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/CheckBoxRenderer.cs @@ -2,12 +2,13 @@ using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml; using WBrush = Microsoft.UI.Xaml.Media.Brush; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { public class CheckBoxRenderer : ViewRenderer { - static WBrush _tintDefaultBrush = Colors.Blue.ToBrush(); + static WBrush _tintDefaultBrush = Maui.ColorExtensions.ToNative(Colors.Blue); bool _disposed = false; protected virtual FormsCheckBox CreateNativeControl() diff --git a/src/Compatibility/Core/src/WinUI/CollectionView/CarouselViewRenderer.cs b/src/Compatibility/Core/src/WinUI/CollectionView/CarouselViewRenderer.cs index fe883432616d..7e275e40bf7d 100644 --- a/src/Compatibility/Core/src/WinUI/CollectionView/CarouselViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/CollectionView/CarouselViewRenderer.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Threading.Tasks; +using Microsoft.Maui.Controls.Platform; using Microsoft.UI.Composition; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Data; diff --git a/src/Compatibility/Core/src/WinUI/CollectionView/FormsGridView.cs b/src/Compatibility/Core/src/WinUI/CollectionView/FormsGridView.cs index 46cc6fb20844..c376c45c7659 100644 --- a/src/Compatibility/Core/src/WinUI/CollectionView/FormsGridView.cs +++ b/src/Compatibility/Core/src/WinUI/CollectionView/FormsGridView.cs @@ -4,6 +4,7 @@ using UWPApp = Microsoft.UI.Xaml.Application; using UWPControls = Microsoft.UI.Xaml.Controls; using WScrollMode = Microsoft.UI.Xaml.Controls.ScrollMode; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -41,11 +42,11 @@ public int Span public static readonly DependencyProperty EmptyViewVisibilityProperty = DependencyProperty.Register(nameof(EmptyViewVisibility), typeof(Visibility), - typeof(FormsGridView), new PropertyMetadata(Visibility.Collapsed)); + typeof(FormsGridView), new PropertyMetadata(WVisibility.Collapsed)); - public Visibility EmptyViewVisibility + public WVisibility EmptyViewVisibility { - get { return (Visibility)GetValue(EmptyViewVisibilityProperty); } + get { return (WVisibility)GetValue(EmptyViewVisibilityProperty); } set { SetValue(EmptyViewVisibilityProperty, value); } } diff --git a/src/Compatibility/Core/src/WinUI/CollectionView/FormsListView.cs b/src/Compatibility/Core/src/WinUI/CollectionView/FormsListView.cs index b5890f0787c4..c15ef7f2d0ed 100644 --- a/src/Compatibility/Core/src/WinUI/CollectionView/FormsListView.cs +++ b/src/Compatibility/Core/src/WinUI/CollectionView/FormsListView.cs @@ -4,6 +4,7 @@ using UwpApp = Microsoft.UI.Xaml.Application; using UwpControlTemplate = Microsoft.UI.Xaml.Controls.ControlTemplate; using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -25,11 +26,11 @@ public FormsListView() public static readonly DependencyProperty EmptyViewVisibilityProperty = DependencyProperty.Register(nameof(EmptyViewVisibility), typeof(Visibility), - typeof(FormsListView), new PropertyMetadata(Visibility.Collapsed)); + typeof(FormsListView), new PropertyMetadata(WVisibility.Collapsed)); - public Visibility EmptyViewVisibility + public WVisibility EmptyViewVisibility { - get { return (Visibility)GetValue(EmptyViewVisibilityProperty); } + get { return (WVisibility)GetValue(EmptyViewVisibilityProperty); } set { SetValue(EmptyViewVisibilityProperty, value); } } diff --git a/src/Compatibility/Core/src/WinUI/CollectionView/IEmptyView.cs b/src/Compatibility/Core/src/WinUI/CollectionView/IEmptyView.cs index aa0c21535395..ffe237e83e61 100644 --- a/src/Compatibility/Core/src/WinUI/CollectionView/IEmptyView.cs +++ b/src/Compatibility/Core/src/WinUI/CollectionView/IEmptyView.cs @@ -1,10 +1,11 @@ using Microsoft.UI.Xaml; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { internal interface IEmptyView { - Visibility EmptyViewVisibility { get; set; } + WVisibility EmptyViewVisibility { get; set; } void SetEmptyView(FrameworkElement emptyView, View formsEmptyView); } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/WinUI/CollectionView/ItemContentControl.cs b/src/Compatibility/Core/src/WinUI/CollectionView/ItemContentControl.cs index 6b456229c40b..c40c5d210041 100644 --- a/src/Compatibility/Core/src/WinUI/CollectionView/ItemContentControl.cs +++ b/src/Compatibility/Core/src/WinUI/CollectionView/ItemContentControl.cs @@ -5,6 +5,7 @@ using WThickness = Microsoft.UI.Xaml.Thickness; using WSize = Windows.Foundation.Size; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/CollectionView/ItemsViewRenderer.cs b/src/Compatibility/Core/src/WinUI/CollectionView/ItemsViewRenderer.cs index 77c98e77896e..17b6a0038254 100644 --- a/src/Compatibility/Core/src/WinUI/CollectionView/ItemsViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/CollectionView/ItemsViewRenderer.cs @@ -12,6 +12,8 @@ using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility; using WRect = Windows.Foundation.Rect; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -471,7 +473,7 @@ protected virtual void UpdateEmptyViewVisibility() if (_emptyView != null && ListViewBase is IEmptyView emptyView) { - emptyView.EmptyViewVisibility = Visibility.Visible; + emptyView.EmptyViewVisibility = WVisibility.Visible; if (ActualWidth >= 0 && ActualHeight >= 0) _formsEmptyView?.Layout(new Rectangle(0, 0, ActualWidth, ActualHeight)); @@ -484,7 +486,7 @@ protected virtual void UpdateEmptyViewVisibility() if (_emptyViewDisplayed) { if (_emptyView != null && ListViewBase is IEmptyView emptyView) - emptyView.EmptyViewVisibility = Visibility.Collapsed; + emptyView.EmptyViewVisibility = WVisibility.Collapsed; ItemsView.RemoveLogicalChild(_formsEmptyView); } @@ -581,7 +583,7 @@ bool IsElementVisibleInContainer(FrameworkElement element, FrameworkElement cont if (element == null || container == null) return false; - if (element.Visibility != Visibility.Visible) + if (element.Visibility != WVisibility.Visible) return false; var elementBounds = element.TransformToVisual(container).TransformBounds(new WRect(0, 0, element.ActualWidth, element.ActualHeight)); diff --git a/src/Compatibility/Core/src/WinUI/CollectionView/StructuredItemsViewRenderer.cs b/src/Compatibility/Core/src/WinUI/CollectionView/StructuredItemsViewRenderer.cs index 6140b80d0129..fbf3f5b9d650 100644 --- a/src/Compatibility/Core/src/WinUI/CollectionView/StructuredItemsViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/CollectionView/StructuredItemsViewRenderer.cs @@ -1,6 +1,6 @@ using System; using System.ComponentModel; - +using Microsoft.Maui.Controls.Platform; using Microsoft.UI.Xaml.Controls; using UWPApp = Microsoft.UI.Xaml.Application; diff --git a/src/Compatibility/Core/src/WinUI/ColorConverter.cs b/src/Compatibility/Core/src/WinUI/ColorConverter.cs index 11ced5914ea4..9bd25803bf62 100644 --- a/src/Compatibility/Core/src/WinUI/ColorConverter.cs +++ b/src/Compatibility/Core/src/WinUI/ColorConverter.cs @@ -1,4 +1,5 @@ using System; +using Microsoft.Maui.Controls.Platform; using Microsoft.UI; using Windows.UI; using WBrush = Microsoft.UI.Xaml.Media.Brush; @@ -15,7 +16,7 @@ public object Convert(object value, Type targetType, object parameter, string la WBrush defaultBrush = defaultColorKey != null ? (WBrush)Microsoft.UI.Xaml.Application.Current.Resources[defaultColorKey] : new WSolidColorBrush(Colors.Transparent); - return color.IsDefault() ? defaultBrush : color.ToBrush(); + return color.IsDefault() ? defaultBrush : Maui.ColorExtensions.ToNative(color); } public object ConvertBack(object value, Type targetType, object parameter, string language) diff --git a/src/Compatibility/Core/src/WinUI/ColorExtensions.cs b/src/Compatibility/Core/src/WinUI/ColorExtensions.cs deleted file mode 100644 index ca6031e241a0..000000000000 --- a/src/Compatibility/Core/src/WinUI/ColorExtensions.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using Windows.UI; -using Microsoft.UI; -using Microsoft.Maui.Graphics; -using WBrush = Microsoft.UI.Xaml.Media.Brush; -using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP -{ - public static class ColorExtensions - { - public static Windows.UI.Color GetContrastingColor(this Windows.UI.Color color) - { - var nThreshold = 105; - int bgLuminance = Convert.ToInt32(color.R * 0.2 + color.G * 0.7 + color.B * 0.1); - - Windows.UI.Color contrastingColor = 255 - bgLuminance < nThreshold ? UI.Colors.Black : UI.Colors.White; - return contrastingColor; - } - - public static Graphics.Color ToFormsColor(this Windows.UI.Color color) - { - return Graphics.Color.FromRgba(color.R, color.G, color.B, color.A); - } - - public static Graphics.Color ToFormsColor(this WSolidColorBrush solidColorBrush) - { - return solidColorBrush.Color.ToFormsColor(); - } - - public static WBrush ToBrush(this Graphics.Color color) - { - return new WSolidColorBrush(color.ToWindowsColor()); - } - - public static Windows.UI.Color ToWindowsColor(this Graphics.Color color) - { - return Windows.UI.Color.FromArgb((byte)(color.Alpha * 255), (byte)(color.Red * 255), (byte)(color.Green * 255), (byte)(color.Blue * 255)); - } - } -} diff --git a/src/Compatibility/Core/src/WinUI/Compatibility.UAP.csproj b/src/Compatibility/Core/src/WinUI/Compatibility.UAP.csproj index ea9077fb2854..4c8d29098993 100644 --- a/src/Compatibility/Core/src/WinUI/Compatibility.UAP.csproj +++ b/src/Compatibility/Core/src/WinUI/Compatibility.UAP.csproj @@ -1,14 +1,15 @@ + net5.0-windows10.0.18362.0 netstandard2.0 10.0.17134.0 Microsoft.Maui.Controls.Compatibility.UAP win10-x86;win10-x64;win10-arm64 - $(DefineConstants);DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP;UWP_16299;UWP_18362;UWP_17134 + $(DefineConstants);DEBUG;TRACE;NETFX_CORE;WINDOWS;UWP_16299;UWP_18362;UWP_17134 $(NoWarn);NU5104 - + false false @@ -17,11 +18,7 @@ - - - - - + @@ -29,4 +26,9 @@ + + + + + diff --git a/src/Compatibility/Core/src/WinUI/DatePickerRenderer.cs b/src/Compatibility/Core/src/WinUI/DatePickerRenderer.cs index 617062cea71f..08771edfa0ad 100644 --- a/src/Compatibility/Core/src/WinUI/DatePickerRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/DatePickerRenderer.cs @@ -10,6 +10,7 @@ using Microsoft.Maui.Controls.Internals; using WBrush = Microsoft.UI.Xaml.Media.Brush; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -144,6 +145,7 @@ bool CheckDateFormat() return String.IsNullOrWhiteSpace(Element.Format) || Element.Format.Equals("d"); } + [PortHandler] void UpdateDate(DateTime date) { if (Control != null) @@ -154,6 +156,7 @@ void UpdateDate(DateTime date) UpdateYear(); } + [PortHandler] void UpdateMonth() { Control.MonthVisible = true; @@ -179,6 +182,7 @@ void UpdateMonth() } } + [PortHandler] void UpdateDay() { Control.DayVisible = true; @@ -204,6 +208,7 @@ void UpdateDay() } } + [PortHandler] void UpdateYear() { Control.YearVisible = true; @@ -298,7 +303,7 @@ void UpdateMinimumDate() void UpdateTextColor() { Color color = Element.TextColor; - Control.Foreground = color.IsDefault() ? (_defaultBrush ?? color.ToBrush()) : color.ToBrush(); + Control.Foreground = color.IsDefault() ? (_defaultBrush ?? Maui.ColorExtensions.ToNative(color)) : Maui.ColorExtensions.ToNative(color); } } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/WinUI/EditorRenderer.cs b/src/Compatibility/Core/src/WinUI/EditorRenderer.cs index d3dd0a063610..cf280f897991 100644 --- a/src/Compatibility/Core/src/WinUI/EditorRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/EditorRenderer.cs @@ -8,6 +8,7 @@ using WBrush = Microsoft.UI.Xaml.Media.Brush; using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.InputView; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -156,11 +157,13 @@ protected override void UpdateBackground() () => Control.BackgroundFocusBrush, brush => Control.BackgroundFocusBrush = brush); } + [PortHandler] void OnLostFocus(object sender, RoutedEventArgs e) { ElementController.SendCompleted(); } + [PortHandler] void UpdatePlaceholderText() { Control.PlaceholderText = Element.Placeholder ?? ""; @@ -275,6 +278,7 @@ void UpdateCharacterSpacing() Control.CharacterSpacing = Element.CharacterSpacing.ToEm(); } + [PortHandler] void UpdateText() { string newText = _transformedText = Element.UpdateFormsText(Element.Text, Element.TextTransform); @@ -304,6 +308,7 @@ void UpdateFlowDirection() Control.UpdateFlowDirection(Element); } + [PortHandler] void UpdateMaxLength() { Control.MaxLength = Element.MaxLength; @@ -329,6 +334,7 @@ void UpdateDetectReadingOrderFromContent() } } + [PortHandler] void UpdateIsReadOnly() { Control.IsReadOnly = Element.IsReadOnly; diff --git a/src/Compatibility/Core/src/WinUI/EmbeddedFontLoader.cs b/src/Compatibility/Core/src/WinUI/EmbeddedFontLoader.cs deleted file mode 100644 index a15ba14ce021..000000000000 --- a/src/Compatibility/Core/src/WinUI/EmbeddedFontLoader.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using Windows.Storage; -using IOPath = System.IO.Path; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP -{ - public class EmbeddedFontLoader : IEmbeddedFontLoader - { - const string _fontCacheFolderName = "fonts"; - public (bool success, string filePath) LoadFont(EmbeddedFont font) - { - try - { - var t = ApplicationData.Current.LocalFolder.CreateFolderAsync(_fontCacheFolderName, CreationCollisionOption.OpenIfExists); - var tmpdir = t.AsTask().Result; - - var file = tmpdir.TryGetItemAsync(font.FontName).AsTask().Result; - string filePath = ""; - if (file != null) - { - filePath = file.Path; - return (true, CleanseFilePath(filePath)); - } - - try - { - - var f = tmpdir.CreateFileAsync(font.FontName).AsTask().Result; - filePath = f.Path; - using (var fileStream = File.Open(f.Path, FileMode.Open)) - { - font.ResourceStream.CopyTo(fileStream); - } - return (true, CleanseFilePath(filePath)); - } - catch (Exception ex) - { - Debug.WriteLine(ex); - File.Delete(filePath); - } - } - catch (Exception e) - { - Debug.WriteLine(e); - } - return (false, null); - } - - static string CleanseFilePath(string filePath) - { - var fontName = IOPath.GetFileName(filePath); - filePath = IOPath.Combine("local", _fontCacheFolderName, fontName); - var baseUri = new Uri("ms-appdata://"); - var uri = new Uri(baseUri, filePath); - var relativePath = uri.ToString().TrimEnd('/'); - return relativePath; - } - } -} diff --git a/src/Compatibility/Core/src/WinUI/EntryRenderer.cs b/src/Compatibility/Core/src/WinUI/EntryRenderer.cs index ec4f19cb293b..ed0395b9e4dc 100644 --- a/src/Compatibility/Core/src/WinUI/EntryRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/EntryRenderer.cs @@ -10,6 +10,7 @@ using WBrush = Microsoft.UI.Xaml.Media.Brush; using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.InputView; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -279,6 +280,7 @@ void UpdateIsPassword() Control.IsPassword = Element.IsPassword; } + [PortHandler] void UpdatePlaceholder() { Control.PlaceholderText = Element.Placeholder ?? ""; @@ -295,6 +297,7 @@ void UpdatePlaceholderColor() () => Control.PlaceholderForegroundFocusBrush, brush => Control.PlaceholderForegroundFocusBrush = brush); } + [PortHandler] void UpdateText() { Control.Text = _transformedText = Element.UpdateFormsText(Element.Text, Element.TextTransform); @@ -311,6 +314,7 @@ void UpdateTextColor() () => Control.ForegroundFocusBrush, brush => Control.ForegroundFocusBrush = brush); } + [PortHandler] void UpdateMaxLength() { var maxLength = Element.MaxLength; @@ -472,6 +476,7 @@ void SetSelectionLengthFromRenderer(int selectionLength) } } + [PortHandler] void UpdateIsReadOnly() { Control.IsReadOnly = Element.IsReadOnly; diff --git a/src/Compatibility/Core/src/WinUI/Extensions/ClipExtensions.cs b/src/Compatibility/Core/src/WinUI/Extensions/ClipExtensions.cs index b2d0af0d0cc0..09a6e5bf528c 100644 --- a/src/Compatibility/Core/src/WinUI/Extensions/ClipExtensions.cs +++ b/src/Compatibility/Core/src/WinUI/Extensions/ClipExtensions.cs @@ -6,6 +6,7 @@ using Microsoft.UI.Xaml.Hosting; using Microsoft.Maui.Controls.Shapes; using WRectangleGeometry = Microsoft.UI.Xaml.Media.RectangleGeometry; +using Microsoft.Maui.Controls.Platform; #if UWP_18362 using WVector2 = System.Numerics.Vector2; @@ -17,7 +18,7 @@ internal static class ClipExtensions { public static void Clip(this FrameworkElement frameworkElement, Geometry geometry) { - var wGeometry = geometry.ToWindows(); + var wGeometry = geometry.ToNative(); if (wGeometry is WRectangleGeometry wRectangleGeometry && frameworkElement.Clip != wRectangleGeometry) frameworkElement.Clip = wRectangleGeometry; diff --git a/src/Compatibility/Core/src/WinUI/Extensions/ImageExtensions.cs b/src/Compatibility/Core/src/WinUI/Extensions/ImageExtensions.cs index 4c8ac8733108..f71cc89d9a0a 100644 --- a/src/Compatibility/Core/src/WinUI/Extensions/ImageExtensions.cs +++ b/src/Compatibility/Core/src/WinUI/Extensions/ImageExtensions.cs @@ -11,6 +11,7 @@ using Microsoft.UI.Xaml.Media; using Microsoft.Maui.Controls.Internals; using WImageSource = Microsoft.UI.Xaml.Media.ImageSource; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/FileImageSourceHandler.cs b/src/Compatibility/Core/src/WinUI/FileImageSourceHandler.cs index 8c99ea9fdadb..d0baecfd3e1a 100644 --- a/src/Compatibility/Core/src/WinUI/FileImageSourceHandler.cs +++ b/src/Compatibility/Core/src/WinUI/FileImageSourceHandler.cs @@ -5,6 +5,7 @@ using Microsoft.UI.Xaml.Media.Imaging; using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; using IOPath = System.IO.Path; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/FlyoutPageControl.cs b/src/Compatibility/Core/src/WinUI/FlyoutPageControl.cs index f82c84fda98d..51ec23442755 100644 --- a/src/Compatibility/Core/src/WinUI/FlyoutPageControl.cs +++ b/src/Compatibility/Core/src/WinUI/FlyoutPageControl.cs @@ -5,6 +5,7 @@ using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; using WBrush = Microsoft.UI.Xaml.Media.Brush; using WImageSource = Microsoft.UI.Xaml.Media.ImageSource; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -82,7 +83,7 @@ public FlyoutPageControl() { DefaultStyleKey = typeof(FlyoutPageControl); - DetailTitleVisibility = Visibility.Collapsed; + DetailTitleVisibility = WVisibility.Collapsed; CollapseStyle = CollapseStyle.Full; } @@ -133,9 +134,9 @@ public View DetailTitleView set { SetValue(DetailTitleViewProperty, value); } } - public Visibility DetailTitleVisibility + public WVisibility DetailTitleVisibility { - get { return (Visibility)GetValue(DetailTitleVisibilityProperty); } + get { return (WVisibility)GetValue(DetailTitleVisibilityProperty); } set { SetValue(DetailTitleVisibilityProperty, value); } } @@ -187,15 +188,15 @@ public string FlyoutTitle set { SetValue(FlyoutTitleProperty, value); } } - public Visibility FlyoutTitleVisibility + public WVisibility FlyoutTitleVisibility { - get { return (Visibility)GetValue(FlyoutTitleVisibilityProperty); } + get { return (WVisibility)GetValue(FlyoutTitleVisibilityProperty); } set { SetValue(FlyoutTitleVisibilityProperty, value); } } - public Visibility FlyoutToolbarVisibility + public WVisibility FlyoutToolbarVisibility { - get { return (Visibility)GetValue(FlyoutToolbarVisibilityProperty); } + get { return (WVisibility)GetValue(FlyoutToolbarVisibilityProperty); } set { SetValue(FlyoutToolbarVisibilityProperty, value); } } @@ -231,9 +232,9 @@ public bool ToolbarDynamicOverflowEnabled } } - public Visibility ContentTogglePaneButtonVisibility + public WVisibility ContentTogglePaneButtonVisibility { - get { return (Visibility)GetValue(ContentTogglePaneButtonVisibilityProperty); } + get { return (WVisibility)GetValue(ContentTogglePaneButtonVisibilityProperty); } set { SetValue(ContentTogglePaneButtonVisibilityProperty, value); } } @@ -349,20 +350,20 @@ void UpdateMode() { // If we've determined that the pane will always be open, then there's no // reason to display the show/hide pane button in the master - FlyoutToolbarVisibility = Visibility.Collapsed; + FlyoutToolbarVisibility = WVisibility.Collapsed; } // If we're in compact mode or the pane is always open, // we don't need to display the content pane's toggle button ContentTogglePaneButtonVisibility = _split.DisplayMode == SplitViewDisplayMode.Overlay - ? Visibility.Visible - : Visibility.Collapsed; + ? WVisibility.Visible + : WVisibility.Collapsed; - if (ContentTogglePaneButtonVisibility == Visibility.Visible) - DetailTitleVisibility = Visibility.Visible; + if (ContentTogglePaneButtonVisibility == WVisibility.Visible) + DetailTitleVisibility = WVisibility.Visible; - if (DetailTitleVisibility == Visibility.Visible && !ShouldShowNavigationBar) - DetailTitleVisibility = Visibility.Collapsed; + if (DetailTitleVisibility == WVisibility.Visible && !ShouldShowNavigationBar) + DetailTitleVisibility = WVisibility.Collapsed; _firstLoad = true; } @@ -401,13 +402,13 @@ public string MasterTitle set => FlyoutTitle = value; } - public Visibility MasterTitleVisibility + public WVisibility MasterTitleVisibility { get => FlyoutTitleVisibility; set => FlyoutTitleVisibility = value; } - public Visibility MasterToolbarVisibility + public WVisibility MasterToolbarVisibility { get => FlyoutToolbarVisibility; set => FlyoutToolbarVisibility = value; diff --git a/src/Compatibility/Core/src/WinUI/FlyoutPageRenderer.cs b/src/Compatibility/Core/src/WinUI/FlyoutPageRenderer.cs index d2a4abcdd28a..351723c3bc8d 100644 --- a/src/Compatibility/Core/src/WinUI/FlyoutPageRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/FlyoutPageRenderer.cs @@ -10,6 +10,8 @@ using WBrush = Microsoft.UI.Xaml.Media.Brush; using WImageSource = Microsoft.UI.Xaml.Media.ImageSource; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -75,7 +77,7 @@ bool ITitleProvider.ShowTitle return; _showTitle = value; - Control.DetailTitleVisibility = _showTitle ? Visibility.Visible : Visibility.Collapsed; + Control.DetailTitleVisibility = _showTitle ? WVisibility.Visible : WVisibility.Collapsed; } } @@ -184,7 +186,7 @@ protected virtual void OnElementChanged(ElementChangedEventArgs e) _defaultAutomationPropertiesName = Control.SetAutomationPropertiesName(Element, _defaultAutomationPropertiesName); _defaultAutomationPropertiesHelpText = Control.SetAutomationPropertiesHelpText(Element, _defaultAutomationPropertiesHelpText); - _defaultAutomationPropertiesLabeledBy = Control.SetAutomationPropertiesLabeledBy(Element, _defaultAutomationPropertiesLabeledBy); + _defaultAutomationPropertiesLabeledBy = Control.SetAutomationPropertiesLabeledBy(Element, Element.Handler?.MauiContext ?? Forms.MauiContext, _defaultAutomationPropertiesLabeledBy); _defaultAutomationPropertiesAccessibilityView = Control.SetAutomationPropertiesAccessibilityView(Element, _defaultAutomationPropertiesAccessibilityView); } } @@ -212,7 +214,7 @@ protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEv else if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName) _defaultAutomationPropertiesHelpText = Control.SetAutomationPropertiesHelpText(Element, _defaultAutomationPropertiesHelpText); else if (e.PropertyName == AutomationProperties.LabeledByProperty.PropertyName) - _defaultAutomationPropertiesLabeledBy = Control.SetAutomationPropertiesLabeledBy(Element, _defaultAutomationPropertiesLabeledBy); + _defaultAutomationPropertiesLabeledBy = Control.SetAutomationPropertiesLabeledBy(Element, Element.Handler?.MauiContext ?? Forms.MauiContext, _defaultAutomationPropertiesLabeledBy); else if (e.PropertyName == AutomationProperties.IsInAccessibleTreeProperty.PropertyName) _defaultAutomationPropertiesAccessibilityView = Control.SetAutomationPropertiesAccessibilityView(Element, _defaultAutomationPropertiesAccessibilityView); } diff --git a/src/Compatibility/Core/src/WinUI/FontExtensions.cs b/src/Compatibility/Core/src/WinUI/FontExtensions.cs index 2e1d4f7863b9..026ea0b8a696 100644 --- a/src/Compatibility/Core/src/WinUI/FontExtensions.cs +++ b/src/Compatibility/Core/src/WinUI/FontExtensions.cs @@ -1,6 +1,6 @@ +using System; using Microsoft.Maui.Controls.Internals; using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Documents; using Microsoft.UI.Xaml.Media; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP @@ -8,28 +8,40 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP public static class FontExtensions { public static void ApplyFont(this Control self, Font font) => - self.UpdateFont(font, Forms.FontManager); + self.UpdateFont(font, CompatServiceProvider.FontManager); public static void ApplyFont(this TextBlock self, Font font) => - self.UpdateFont(font, Forms.FontManager); + self.UpdateFont(font, CompatServiceProvider.FontManager); public static FontFamily ToFontFamily(this Font font) => - Forms.FontManager.GetFontFamily(font); + CompatServiceProvider.FontManager.GetFontFamily(font); public static FontFamily ToFontFamily(this string fontFamily) => - Forms.FontManager.GetFontFamily(Font.OfSize(fontFamily, 0.0)); + CompatServiceProvider.FontManager.GetFontFamily(Font.OfSize(fontFamily, 0.0)); internal static void ApplyFont(this Control self, IFontElement element) => - self.UpdateFont(element.AsFont(), Forms.FontManager); + self.UpdateFont(element.AsFont(), CompatServiceProvider.FontManager); internal static void ApplyFont(this TextBlock self, IFontElement element) => - self.UpdateFont(element.AsFont(), Forms.FontManager); - - internal static void ApplyFont(this TextElement self, IFontElement element) => - self.UpdateFont(element.AsFont(), Forms.FontManager); - - internal static double GetFontSize(this NamedSize size) => - Forms.FontManager.GetFontSize(Font.OfSize(null, size)); + self.UpdateFont(element.AsFont(), CompatServiceProvider.FontManager); + + internal static void ApplyFont(this UI.Xaml.Documents.TextElement self, IFontElement element) => + self.UpdateFont(element.AsFont(), CompatServiceProvider.FontManager); + + internal static double GetFontSize(this NamedSize size) => size switch + { + NamedSize.Default => CompatServiceProvider.FontManager.DefaultFontSize, + NamedSize.Micro => 15.667, + NamedSize.Small => 18.667, + NamedSize.Medium => 22.667, + NamedSize.Large => 32, + NamedSize.Body => 14, + NamedSize.Caption => 12, + NamedSize.Header => 46, + NamedSize.Subtitle => 20, + NamedSize.Title => 24, + _ => throw new ArgumentOutOfRangeException(nameof(size)), + }; internal static bool IsDefault(this IFontElement self) => self.FontFamily == null && self.FontSize == Device.GetNamedSize(NamedSize.Default, typeof(Label), true) && self.FontAttributes == FontAttributes.None; diff --git a/src/Compatibility/Core/src/WinUI/FontImageSourceHandler.cs b/src/Compatibility/Core/src/WinUI/FontImageSourceHandler.cs index c32cb67fdf19..3c22f09eb81f 100644 --- a/src/Compatibility/Core/src/WinUI/FontImageSourceHandler.cs +++ b/src/Compatibility/Core/src/WinUI/FontImageSourceHandler.cs @@ -4,6 +4,7 @@ using Microsoft.Graphics.Canvas; using Microsoft.Graphics.Canvas.Text; using Microsoft.Graphics.Canvas.UI.Xaml; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; @@ -68,7 +69,7 @@ public sealed class FontImageSourceHandler : IImageSourceHandler, IIconElementHa { Glyph = fontImageSource.Glyph, FontSize = fontImageSource.Size, - Foreground = fontImageSource.Color.ToBrush() + Foreground = Maui.ColorExtensions.ToNative(fontImageSource.Color) }; var uwpFontFamily = fontImageSource.FontFamily.ToFontFamily(); @@ -90,7 +91,7 @@ public sealed class FontImageSourceHandler : IImageSourceHandler, IIconElementHa { Glyph = fontImageSource.Glyph, FontSize = fontImageSource.Size, - Foreground = fontImageSource.Color.ToBrush() + Foreground = Maui.ColorExtensions.ToNative(fontImageSource.Color) }; var uwpFontFamily = fontImageSource.FontFamily.ToFontFamily(); diff --git a/src/Compatibility/Core/src/WinUI/Forms.cs b/src/Compatibility/Core/src/WinUI/Forms.cs index 69b49ce340bc..d161400cfd9f 100644 --- a/src/Compatibility/Core/src/WinUI/Forms.cs +++ b/src/Compatibility/Core/src/WinUI/Forms.cs @@ -27,14 +27,10 @@ public static partial class Forms { const string LogFormat = "[{0}] {1}"; private static ApplicationExecutionState s_state; - private static IFontManager s_fontManager; //TODO WINUI3 This is set by main page currently because // it's only a single window - public static Window MainWindow { get; set; } - - internal static IFontManager FontManager => - s_fontManager ??= new FontManager(Registrar.FontRegistrar); + public static UI.Xaml.Window MainWindow { get; set; } public static bool IsInitialized { get; private set; } public static IMauiContext MauiContext { get; private set; } @@ -66,15 +62,12 @@ static void SetupInit( Registrar.RegisterRendererToHandlerShim(RendererToHandlerShim.CreateShim); var accent = (WSolidColorBrush)Microsoft.UI.Xaml.Application.Current.Resources["SystemColorControlAccentBrush"]; - KnownColor.SetAccent(accent.ToFormsColor()); + KnownColor.SetAccent(accent.ToColor()); if (!IsInitialized) { -#if !UWP_16299 Log.Listeners.Add(new DelegateLogListener((c, m) => Debug.WriteLine(LogFormat, c, m))); -#else - Log.Listeners.Add(new DelegateLogListener((c, m) => Trace.WriteLine(m, c))); -#endif + } if (!UI.Xaml.Application.Current.Resources.ContainsKey("RootContainerStyle")) diff --git a/src/Compatibility/Core/src/WinUI/FormsButton.cs b/src/Compatibility/Core/src/WinUI/FormsButton.cs index baf56bbe0a52..32351437ad04 100644 --- a/src/Compatibility/Core/src/WinUI/FormsButton.cs +++ b/src/Compatibility/Core/src/WinUI/FormsButton.cs @@ -1,3 +1,4 @@ +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; diff --git a/src/Compatibility/Core/src/WinUI/FormsCommandBar.cs b/src/Compatibility/Core/src/WinUI/FormsCommandBar.cs index 474c232cd4de..01534427cf95 100644 --- a/src/Compatibility/Core/src/WinUI/FormsCommandBar.cs +++ b/src/Compatibility/Core/src/WinUI/FormsCommandBar.cs @@ -4,6 +4,7 @@ using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Media; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -60,26 +61,26 @@ void UpdateVisibility() { // If there's no title to display (e.g., toolbarplacement is set to bottom) // or the title is collapsed (e.g., because it's empty) - if (frameworkElement == null || frameworkElement.Visibility != Visibility.Visible) + if (frameworkElement == null || frameworkElement.Visibility != WVisibility.Visible) { // Just collapse the whole thing - Visibility = Visibility.Collapsed; + Visibility = WVisibility.Collapsed; return; } // The title needs to be visible, but we're not allowed to show a toolbar // So we need to hide the toolbar items - Visibility = Visibility.Visible; + Visibility = WVisibility.Visible; if (_moreButton != null) { - _moreButton.Visibility = Visibility.Collapsed; + _moreButton.Visibility = WVisibility.Collapsed; } if (_primaryItemsControl != null) { - _primaryItemsControl.Visibility = Visibility.Collapsed; + _primaryItemsControl.Visibility = WVisibility.Collapsed; } return; @@ -90,11 +91,11 @@ void UpdateVisibility() if (_primaryItemsControl != null) { // This is normally visible by default, but it might have been collapsed by the toolbar consistency rules above - _primaryItemsControl.Visibility = Visibility.Visible; + _primaryItemsControl.Visibility = WVisibility.Visible; } // Are there any commands to display? - var visibility = PrimaryCommands.Count + SecondaryCommands.Count > 0 ? Visibility.Visible : Visibility.Collapsed; + var visibility = PrimaryCommands.Count + SecondaryCommands.Count > 0 ? WVisibility.Visible : WVisibility.Collapsed; if (_moreButton != null) { @@ -105,10 +106,10 @@ void UpdateVisibility() // but it became available in 10.0.14393.0 and we have to support 10.0.10240 } - if (frameworkElement != null && frameworkElement.Visibility != Visibility.Collapsed) + if (frameworkElement != null && frameworkElement.Visibility != WVisibility.Collapsed) { // If there's a title to display, we have to be visible whether or not we have commands - Visibility = Visibility.Visible; + Visibility = WVisibility.Visible; } else { diff --git a/src/Compatibility/Core/src/WinUI/FormsFlyout.xaml.cs b/src/Compatibility/Core/src/WinUI/FormsFlyout.xaml.cs index 5bfa46a558ff..351c8178a263 100644 --- a/src/Compatibility/Core/src/WinUI/FormsFlyout.xaml.cs +++ b/src/Compatibility/Core/src/WinUI/FormsFlyout.xaml.cs @@ -3,6 +3,7 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.Maui.Controls.Internals; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -54,8 +55,8 @@ public FormsFlyout(ActionSheetArguments sheetOptions) RightBtn.Content = options.Destruction; } - LeftBtn.Visibility = LeftBtn.Content == null ? Visibility.Collapsed : Visibility.Visible; - RightBtn.Visibility = RightBtn.Content == null ? Visibility.Collapsed : Visibility.Visible; + LeftBtn.Visibility = LeftBtn.Content == null ? WVisibility.Collapsed : WVisibility.Visible; + RightBtn.Visibility = RightBtn.Content == null ? WVisibility.Collapsed : WVisibility.Visible; } void ListItemSelected (object sender, ItemClickEventArgs e) diff --git a/src/Compatibility/Core/src/WinUI/FormsRadioButton.cs b/src/Compatibility/Core/src/WinUI/FormsRadioButton.cs index 2abaa58d92eb..1b0888cdf1e7 100644 --- a/src/Compatibility/Core/src/WinUI/FormsRadioButton.cs +++ b/src/Compatibility/Core/src/WinUI/FormsRadioButton.cs @@ -1,3 +1,4 @@ +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml; using WBrush = Microsoft.UI.Xaml.Media.Brush; diff --git a/src/Compatibility/Core/src/WinUI/FormsSlider.cs b/src/Compatibility/Core/src/WinUI/FormsSlider.cs index 7b4a7dec3f35..74d7c5463ed2 100644 --- a/src/Compatibility/Core/src/WinUI/FormsSlider.cs +++ b/src/Compatibility/Core/src/WinUI/FormsSlider.cs @@ -4,6 +4,7 @@ using Microsoft.UI.Xaml.Controls.Primitives; using Microsoft.UI.Xaml.Media.Imaging; using WImageSource = Microsoft.UI.Xaml.Media.ImageSource; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -32,13 +33,13 @@ static void SwapThumbs(FormsSlider slider) if (slider.ThumbImageSource != null) { - slider.Thumb.Visibility = Visibility.Collapsed; - slider.ImageThumb.Visibility = Visibility.Visible; + slider.Thumb.Visibility = WVisibility.Collapsed; + slider.ImageThumb.Visibility = WVisibility.Visible; } else { - slider.Thumb.Visibility = Visibility.Visible; - slider.ImageThumb.Visibility = Visibility.Collapsed; + slider.Thumb.Visibility = WVisibility.Visible; + slider.ImageThumb.Visibility = WVisibility.Collapsed; } } diff --git a/src/Compatibility/Core/src/WinUI/FrameRenderer.cs b/src/Compatibility/Core/src/WinUI/FrameRenderer.cs index 36d23a3094ea..46c3fe094118 100644 --- a/src/Compatibility/Core/src/WinUI/FrameRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/FrameRenderer.cs @@ -3,6 +3,7 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Automation.Peers; using Microsoft.UI.Xaml.Controls; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -67,7 +68,7 @@ protected override void UpdateBackgroundColor() if (Control != null) { Control.Background = backgroundColor.IsDefault() ? - new Microsoft.UI.Xaml.Media.SolidColorBrush((Windows.UI.Color)Resources["SystemAltHighColor"]) : backgroundColor.ToBrush(); + new Microsoft.UI.Xaml.Media.SolidColorBrush((Windows.UI.Color)Resources["SystemAltHighColor"]) : Maui.ColorExtensions.ToNative(backgroundColor); } } @@ -80,7 +81,7 @@ protected override void UpdateBackground() { if (Brush.IsNullOrEmpty(background)) Control.Background = backgroundColor.IsDefault() ? - new Microsoft.UI.Xaml.Media.SolidColorBrush((Windows.UI.Color)Resources["SystemAltHighColor"]) : backgroundColor.ToBrush(); + new Microsoft.UI.Xaml.Media.SolidColorBrush((Windows.UI.Color)Resources["SystemAltHighColor"]) : Maui.ColorExtensions.ToNative(backgroundColor); else Control.Background = background.ToBrush(); } @@ -99,12 +100,12 @@ void UpdateBorder() { if (Element.BorderColor.IsNotDefault()) { - Control.BorderBrush = Element.BorderColor.ToBrush(); + Control.BorderBrush = Maui.ColorExtensions.ToNative(Element.BorderColor); Control.BorderThickness = WinUIHelpers.CreateThickness(1); } else { - Control.BorderBrush = new Color(0, 0, 0, 0).ToBrush(); + Control.BorderBrush = Maui.ColorExtensions.ToNative(new Color(0, 0, 0, 0)); } } diff --git a/src/Compatibility/Core/src/WinUI/HandlerToRendererShim.cs b/src/Compatibility/Core/src/WinUI/HandlerToRendererShim.cs index 2c1a59c59666..aea95c42ee47 100644 --- a/src/Compatibility/Core/src/WinUI/HandlerToRendererShim.cs +++ b/src/Compatibility/Core/src/WinUI/HandlerToRendererShim.cs @@ -4,6 +4,7 @@ using Microsoft.Maui.Controls.Compatibility.Platform.UWP; using Microsoft.UI.Xaml; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility { @@ -55,7 +56,7 @@ public void SetElement(VisualElement element) void OnBatchCommitted(object sender, EventArg e) { - ViewHandler?.SetFrame(Element.Bounds); + ViewHandler?.NativeArrange(Element.Bounds); } void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) diff --git a/src/Compatibility/Core/src/WinUI/IDontGetFocus.cs b/src/Compatibility/Core/src/WinUI/IDontGetFocus.cs deleted file mode 100644 index 58311370770a..000000000000 --- a/src/Compatibility/Core/src/WinUI/IDontGetFocus.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP -{ - public interface IDontGetFocus - { - } -} diff --git a/src/Compatibility/Core/src/WinUI/ITabStopOnDescendants.cs b/src/Compatibility/Core/src/WinUI/ITabStopOnDescendants.cs deleted file mode 100644 index 0f6dcbef0a93..000000000000 --- a/src/Compatibility/Core/src/WinUI/ITabStopOnDescendants.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP -{ - public interface ITabStopOnDescendants: IDontGetFocus - { - } -} diff --git a/src/Compatibility/Core/src/WinUI/IVisualElementRenderer.cs b/src/Compatibility/Core/src/WinUI/IVisualElementRenderer.cs index 7ca4eec57cc3..45d7a501bac2 100644 --- a/src/Compatibility/Core/src/WinUI/IVisualElementRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/IVisualElementRenderer.cs @@ -1,4 +1,5 @@ using System; +using Microsoft.Maui.Controls.Platform; using Microsoft.UI.Xaml; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP diff --git a/src/Compatibility/Core/src/WinUI/ImageButtonRenderer.cs b/src/Compatibility/Core/src/WinUI/ImageButtonRenderer.cs index 9998c7fa6e87..fe413103b3d8 100644 --- a/src/Compatibility/Core/src/WinUI/ImageButtonRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/ImageButtonRenderer.cs @@ -10,6 +10,7 @@ using WStretch = Microsoft.UI.Xaml.Media.Stretch; using WThickness = Microsoft.UI.Xaml.Thickness; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -251,14 +252,14 @@ void OnPointerPressed(object sender, RoutedEventArgs e) void UpdateImageButtonBackground() { if (Brush.IsNullOrEmpty(Element.Background)) - Control.BackgroundColor = Element.BackgroundColor.IsNotDefault() ? Element.BackgroundColor.ToBrush() : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"]; + Control.BackgroundColor = Element.BackgroundColor.IsNotDefault() ? Maui.ColorExtensions.ToNative(Element.BackgroundColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"]; else Control.BackgroundColor = Element.Background.ToBrush(); } void UpdateBorderColor() { - Control.BorderBrush = Element.BorderColor.IsNotDefault() ? Element.BorderColor.ToBrush() : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBorderThemeBrush"]; + Control.BorderBrush = Element.BorderColor.IsNotDefault() ? Maui.ColorExtensions.ToNative(Element.BorderColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBorderThemeBrush"]; } void UpdateBorderRadius() diff --git a/src/Compatibility/Core/src/WinUI/ImageElementManager.cs b/src/Compatibility/Core/src/WinUI/ImageElementManager.cs index f34e1d1fcb0c..65da9d3f0ea2 100644 --- a/src/Compatibility/Core/src/WinUI/ImageElementManager.cs +++ b/src/Compatibility/Core/src/WinUI/ImageElementManager.cs @@ -6,6 +6,7 @@ using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; using WStretch = Microsoft.UI.Xaml.Media.Stretch; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/ImageRenderer.cs b/src/Compatibility/Core/src/WinUI/ImageRenderer.cs index 4b7b6184198f..aaf61113d241 100644 --- a/src/Compatibility/Core/src/WinUI/ImageRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/ImageRenderer.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using Microsoft.UI.Xaml; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -87,13 +88,13 @@ void OnImageOpened(object sender, RoutedEventArgs routedEventArgs) ImageElementManager.RefreshImage(this); } - Element?.SetIsLoading(false); + ((IImageController)Element)?.SetIsLoading(false); } protected virtual void OnImageFailed(object sender, ExceptionRoutedEventArgs exceptionRoutedEventArgs) { Log.Warning("Image Loading", $"Image failed to load: {exceptionRoutedEventArgs.ErrorMessage}"); - Element?.SetIsLoading(false); + ((IImageController)Element)?.SetIsLoading(false); } protected virtual async Task TryUpdateSource() diff --git a/src/Compatibility/Core/src/WinUI/IndicatorViewRenderer.cs b/src/Compatibility/Core/src/WinUI/IndicatorViewRenderer.cs index d066210c1bad..8b55ff481017 100644 --- a/src/Compatibility/Core/src/WinUI/IndicatorViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/IndicatorViewRenderer.cs @@ -8,6 +8,7 @@ using WEllipse = Microsoft.UI.Xaml.Shapes.Ellipse; using WRectangle = Microsoft.UI.Xaml.Shapes.Rectangle; using WShape = Microsoft.UI.Xaml.Shapes.Shape; +using Microsoft.Maui.Controls.Platform; using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP diff --git a/src/Compatibility/Core/src/WinUI/LabelRenderer.cs b/src/Compatibility/Core/src/WinUI/LabelRenderer.cs index 8d09894bead3..29916837157f 100644 --- a/src/Compatibility/Core/src/WinUI/LabelRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/LabelRenderer.cs @@ -9,12 +9,12 @@ using Microsoft.UI.Xaml.Documents; using Windows.UI.Text; using Microsoft.Maui.Controls.Compatibility.Platform.UAP; -using Microsoft.Maui.Controls.Compatibility.Platform.UAP.Extensions; using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Label; using WRect = Windows.Foundation.Rect; using WThickness = Microsoft.UI.Xaml.Thickness; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -25,7 +25,7 @@ public static Run ToRun(this Span span) var run = new Run { Text = span.Text ?? string.Empty }; if (span.TextColor.IsNotDefault()) - run.Foreground = span.TextColor.ToBrush(); + run.Foreground = Maui.ColorExtensions.ToNative(span.TextColor); if (!span.IsDefault()) run.ApplyFont(span); @@ -247,7 +247,7 @@ void UpdateColor(TextBlock textBlock) Label label = Element; if (label != null && label.TextColor.IsNotDefault()) { - textBlock.Foreground = label.TextColor.ToBrush(); + textBlock.Foreground = Maui.ColorExtensions.ToNative(label.TextColor); } else { @@ -267,7 +267,7 @@ void UpdateFont(TextBlock textBlock) return; if (label.IsDefault() && _isInitiallyDefault) - textBlock.ApplyFont(Font.SystemFontOfSize(NamedSize.Medium)); + textBlock.ApplyFont(Font.SystemFontOfSize(Device.GetNamedSize(NamedSize.Medium, Element.GetType(), false))); else textBlock.ApplyFont(label); diff --git a/src/Compatibility/Core/src/WinUI/LayoutRenderer.cs b/src/Compatibility/Core/src/WinUI/LayoutRenderer.cs index 6e3e1b0584a6..ade47c3f9a25 100644 --- a/src/Compatibility/Core/src/WinUI/LayoutRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/LayoutRenderer.cs @@ -6,6 +6,7 @@ using WRect = Windows.Foundation.Rect; using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush; using Microsoft.UI; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/ListViewRenderer.cs b/src/Compatibility/Core/src/WinUI/ListViewRenderer.cs index 4ad43768a022..fab01fb474ca 100644 --- a/src/Compatibility/Core/src/WinUI/ListViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/ListViewRenderer.cs @@ -21,6 +21,7 @@ using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListView; using System.Collections.ObjectModel; +using Microsoft.Maui.Controls.Platform; using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility; using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs; diff --git a/src/Compatibility/Core/src/WinUI/MasterBackgroundConverter.cs b/src/Compatibility/Core/src/WinUI/MasterBackgroundConverter.cs index 63b427b2e529..4be2b83c36bf 100644 --- a/src/Compatibility/Core/src/WinUI/MasterBackgroundConverter.cs +++ b/src/Compatibility/Core/src/WinUI/MasterBackgroundConverter.cs @@ -38,7 +38,7 @@ public object Convert(object value, Type targetType, object parameter, string la brush = value as WSolidColorBrush; if (brush != null) { - Maui.Graphics.Color color = brush.ToFormsColor(); + Maui.Graphics.Color color = brush.ToColor(); double delta = Shift; if (color.GetLuminosity() > .6) diff --git a/src/Compatibility/Core/src/WinUI/NativeViewWrapperRenderer.cs b/src/Compatibility/Core/src/WinUI/NativeViewWrapperRenderer.cs index cb9e2f2dc636..b13e90946da3 100644 --- a/src/Compatibility/Core/src/WinUI/NativeViewWrapperRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/NativeViewWrapperRenderer.cs @@ -1,5 +1,6 @@ using Microsoft.UI.Xaml; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/NavigationPageRenderer.cs b/src/Compatibility/Core/src/WinUI/NavigationPageRenderer.cs index a014c698006c..07d072672d10 100644 --- a/src/Compatibility/Core/src/WinUI/NavigationPageRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/NavigationPageRenderer.cs @@ -16,6 +16,7 @@ using WBrush = Microsoft.UI.Xaml.Media.Brush; using WImageSource = Microsoft.UI.Xaml.Media.ImageSource; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -281,7 +282,7 @@ WBrush GetBarBackgroundColorBrush() if (Element.BarBackgroundColor.IsDefault() && defaultColor != null) return (WBrush)defaultColor; - return Element.BarBackgroundColor.ToBrush(); + return Maui.ColorExtensions.ToNative(Element.BarBackgroundColor); } WBrush GetBarBackgroundBrush() @@ -303,7 +304,7 @@ WBrush GetBarForegroundBrush() object defaultColor = Microsoft.UI.Xaml.Application.Current.Resources["ApplicationForegroundThemeBrush"]; if (Element.BarTextColor.IsDefault()) return (WBrush)defaultColor; - return Element.BarTextColor.ToBrush(); + return Maui.ColorExtensions.ToNative(Element.BarTextColor); } bool GetIsNavBarPossible() diff --git a/src/Compatibility/Core/src/WinUI/PageControl.cs b/src/Compatibility/Core/src/WinUI/PageControl.cs index 444efc6548f9..71e925179b14 100644 --- a/src/Compatibility/Core/src/WinUI/PageControl.cs +++ b/src/Compatibility/Core/src/WinUI/PageControl.cs @@ -4,12 +4,13 @@ using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; using WBrush = Microsoft.UI.Xaml.Media.Brush; using WImageSource = Microsoft.UI.Xaml.Media.ImageSource; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { public sealed class PageControl : ContentControl, IToolbarProvider, ITitleViewRendererController { - public static readonly DependencyProperty TitleVisibilityProperty = DependencyProperty.Register(nameof(TitleVisibility), typeof(Visibility), typeof(PageControl), new PropertyMetadata(Visibility.Visible)); + public static readonly DependencyProperty TitleVisibilityProperty = DependencyProperty.Register(nameof(TitleVisibility), typeof(WVisibility), typeof(PageControl), new PropertyMetadata(WVisibility.Visible)); public static readonly DependencyProperty ToolbarBackgroundProperty = DependencyProperty.Register(nameof(ToolbarBackground), typeof(WBrush), typeof(PageControl), new PropertyMetadata(default(WBrush))); @@ -23,7 +24,7 @@ public sealed class PageControl : ContentControl, IToolbarProvider, ITitleViewRe public static readonly DependencyProperty TitleViewProperty = DependencyProperty.Register(nameof(TitleView), typeof(View), typeof(PageControl), new PropertyMetadata(default(View), OnTitleViewPropertyChanged)); - public static readonly DependencyProperty TitleViewVisibilityProperty = DependencyProperty.Register(nameof(TitleViewVisibility), typeof(Visibility), typeof(PageControl), new PropertyMetadata(Visibility.Collapsed)); + public static readonly DependencyProperty TitleViewVisibilityProperty = DependencyProperty.Register(nameof(TitleViewVisibility), typeof(WVisibility), typeof(PageControl), new PropertyMetadata(WVisibility.Collapsed)); public static readonly DependencyProperty TitleInsetProperty = DependencyProperty.Register("TitleInset", typeof(double), typeof(PageControl), new PropertyMetadata(default(double))); diff --git a/src/Compatibility/Core/src/WinUI/PageRenderer.cs b/src/Compatibility/Core/src/WinUI/PageRenderer.cs index 21d142f696c8..7cd725c8c2bd 100644 --- a/src/Compatibility/Core/src/WinUI/PageRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/PageRenderer.cs @@ -4,6 +4,7 @@ using Microsoft.UI.Xaml.Automation.Peers; using Microsoft.UI.Xaml.Controls; using System; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/PickerRenderer.cs b/src/Compatibility/Core/src/WinUI/PickerRenderer.cs index 3100a5005b87..55ac868295b6 100644 --- a/src/Compatibility/Core/src/WinUI/PickerRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/PickerRenderer.cs @@ -8,6 +8,7 @@ using WBrush = Microsoft.UI.Xaml.Media.Brush; using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -124,6 +125,7 @@ void ControlOnOpenAnimationCompleted(object sender, EventArgs eventArgs) } } + [PortHandler] void OnControlSelectionChanged(object sender, WSelectionChangedEventArgs e) { if (Element != null) @@ -172,11 +174,13 @@ void StartAnimationRefresh() }); } + [PortHandler] void UpdateCharacterSpacing() { Control.CharacterSpacing = Element.CharacterSpacing.ToEm(); } + [PortHandler] void UpdateFont() { if (Control == null) @@ -210,17 +214,20 @@ void UpdateFont() _fontApplied = true; } + [PortHandler] void UpdateSelectedIndex() { Control.SelectedIndex = Element.SelectedIndex; } + [PortHandler] void UpdateTextColor() { Color color = Element.TextColor; - Control.Foreground = color.IsDefault() ? (_defaultBrush ?? color.ToBrush()) : color.ToBrush(); + Control.Foreground = color.IsDefault() ? (_defaultBrush ?? Maui.ColorExtensions.ToNative(color)) : Maui.ColorExtensions.ToNative(color); } + [PortHandler] void UpdateTitle() { Control.Header = null; @@ -228,10 +235,12 @@ void UpdateTitle() Control.DataContext = Element; } + [PortHandler] void UpdateHorizontalTextAlignment() { Control.HorizontalContentAlignment = Element.HorizontalTextAlignment.ToNativeHorizontalAlignment(); } + void UpdateVerticalTextAlignment() { Control.VerticalContentAlignment = Element.VerticalTextAlignment.ToNativeVerticalAlignment(); diff --git a/src/Compatibility/Core/src/WinUI/Platform.cs b/src/Compatibility/Core/src/WinUI/Platform.cs index 774c69f9207a..86ae6310fee2 100644 --- a/src/Compatibility/Core/src/WinUI/Platform.cs +++ b/src/Compatibility/Core/src/WinUI/Platform.cs @@ -11,6 +11,8 @@ using WFlowDirection = Microsoft.UI.Xaml.FlowDirection; using WImage = Microsoft.UI.Xaml.Controls.Image; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -99,7 +101,7 @@ internal static Platform Current { get { - var frame = Window.Current?.Content as Microsoft.UI.Xaml.Controls.Frame; + var frame = UI.Xaml.Window.Current?.Content as Microsoft.UI.Xaml.Controls.Frame; var wbp = frame?.Content as WindowsBasePage; return wbp?.Platform; } @@ -138,7 +140,7 @@ internal Platform(Microsoft.UI.Xaml.Window page) MessagingCenter.Subscribe(this, Page.BusySetSignalName, (Page sender, bool enabled) => { Microsoft.UI.Xaml.Controls.ProgressBar indicator = GetBusyIndicator(); - indicator.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed; + indicator.Visibility = enabled ? WVisibility.Visible : WVisibility.Collapsed; }); _toolbarTracker.CollectionChanged += OnToolbarItemsChanged; @@ -146,11 +148,11 @@ internal Platform(Microsoft.UI.Xaml.Window page) UpdateBounds(); InitializeStatusBar(); - - // TODO WINUI - //SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; + + if(!NativeVersion.IsDesktop) + SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; - // TODO WINUI + // TODO WINUI: This event is only available on UWP // Microsoft.UI.Xaml.Application.Current.Resuming += OnResumingAsync; } @@ -316,7 +318,7 @@ Microsoft.UI.Xaml.Controls.ProgressBar GetBusyIndicator() _busyIndicator = new Microsoft.UI.Xaml.Controls.ProgressBar { IsIndeterminate = true, - Visibility = Visibility.Collapsed, + Visibility = WVisibility.Collapsed, VerticalAlignment = UI.Xaml.VerticalAlignment.Top }; @@ -555,14 +557,16 @@ internal async Task UpdateToolbarItems() button.Content = img; } - // WINUUI FIX + // TODO WINUI FIX //button.Command = new MenuItemCommand(item); button.DataContext = item; button.SetValue(NativeAutomationProperties.AutomationIdProperty, item.AutomationId); button.SetAutomationPropertiesName(item); button.SetAutomationPropertiesAccessibilityView(item); button.SetAutomationPropertiesHelpText(item); - button.SetAutomationPropertiesLabeledBy(item); + + // TODO MAUI + button.SetAutomationPropertiesLabeledBy(item, null); ToolbarItemOrder order = item.Order == ToolbarItemOrder.Default ? ToolbarItemOrder.Primary : item.Order; if (order == ToolbarItemOrder.Primary) diff --git a/src/Compatibility/Core/src/WinUI/PointCollectionExtensions.cs b/src/Compatibility/Core/src/WinUI/PointCollectionExtensions.cs index c9047a6df2b2..030a654a6e10 100644 --- a/src/Compatibility/Core/src/WinUI/PointCollectionExtensions.cs +++ b/src/Compatibility/Core/src/WinUI/PointCollectionExtensions.cs @@ -1,7 +1,7 @@ using Microsoft.Maui.Controls.Shapes; using Microsoft.Maui.Graphics; -#if WINDOWS_UWP +#if WINDOWS using WPoint = Windows.Foundation.Point; using WPointCollection = Microsoft.UI.Xaml.Media.PointCollection; diff --git a/src/Compatibility/Core/src/WinUI/PointExtensions.cs b/src/Compatibility/Core/src/WinUI/PointExtensions.cs deleted file mode 100644 index 8e35f0134131..000000000000 --- a/src/Compatibility/Core/src/WinUI/PointExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -#if WINDOWS_UWP -using Microsoft.Maui.Graphics; -using WPoint = Windows.Foundation.Point; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP -#else -using WPoint = System.Windows.Point; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.WPF -#endif -{ - public static class PointExtensions - { - public static WPoint ToWindows(this Point point) - { - return new WPoint(point.X, point.Y); - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/WinUI/ProgressBarRenderer.cs b/src/Compatibility/Core/src/WinUI/ProgressBarRenderer.cs index e94c0a97c74b..5ca3368ba05a 100644 --- a/src/Compatibility/Core/src/WinUI/ProgressBarRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/ProgressBarRenderer.cs @@ -3,6 +3,7 @@ using Microsoft.UI.Xaml.Controls.Primitives; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -82,10 +83,11 @@ void UpdateProgressColor() } else { - Control.Foreground = color.ToBrush(); + Control.Foreground = Maui.ColorExtensions.ToNative(color); } } + [PortHandler] void ProgressBarOnValueChanged(object sender, RangeBaseValueChangedEventArgs rangeBaseValueChangedEventArgs) { ((IVisualElementController)Element)?.InvalidateMeasure(InvalidationTrigger.MeasureChanged); diff --git a/src/Compatibility/Core/src/WinUI/Properties/AssemblyInfo.cs b/src/Compatibility/Core/src/WinUI/Properties/AssemblyInfo.cs index 0420d1c75567..68d4d340f503 100644 --- a/src/Compatibility/Core/src/WinUI/Properties/AssemblyInfo.cs +++ b/src/Compatibility/Core/src/WinUI/Properties/AssemblyInfo.cs @@ -1,6 +1,8 @@ using System.Reflection; +using Microsoft.Maui; using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.Shapes; using Rectangle = Microsoft.Maui.Controls.Shapes.Rectangle; @@ -77,9 +79,7 @@ // WINUI3 //[assembly: ExportRenderer(typeof(TabbedPage), typeof(TabbedPageRenderer))] -//Fonts -// WINUI3 -//[assembly: ExportRenderer(typeof(EmbeddedFont), typeof(EmbeddedFontLoader))] +[assembly: ExportRenderer(typeof(EmbeddedFont), typeof(EmbeddedFontLoader))] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.Maui.Controls.DualScreen")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests")] diff --git a/src/Compatibility/Core/src/WinUI/RadioButtonRenderer.cs b/src/Compatibility/Core/src/WinUI/RadioButtonRenderer.cs index 6d3e2e7a3fef..9e4ffbe33722 100644 --- a/src/Compatibility/Core/src/WinUI/RadioButtonRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/RadioButtonRenderer.cs @@ -5,6 +5,7 @@ using WThickness = Microsoft.UI.Xaml.Thickness; using static Microsoft.Maui.Controls.Compatibility.Platform.UWP.ViewToRendererConverter; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -145,14 +146,14 @@ void OnRadioButtonCheckedOrUnchecked(object sender, RoutedEventArgs e) void UpdateBackgroundBrush() { if (Brush.IsNullOrEmpty(Element.Background)) - Control.BackgroundColor = Element.BackgroundColor.IsNotDefault() ? Element.BackgroundColor.ToBrush() : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"]; + Control.BackgroundColor = Element.BackgroundColor.IsNotDefault() ? Maui.ColorExtensions.ToNative(Element.BackgroundColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"]; else Control.BackgroundColor = Element.Background.ToBrush(); } void UpdateBorderColor() { - Control.BorderBrush = Element.BorderColor.IsNotDefault() ? Element.BorderColor.ToBrush() : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBorderThemeBrush"]; + Control.BorderBrush = Element.BorderColor.IsNotDefault() ? Maui.ColorExtensions.ToNative(Element.BorderColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["ButtonBorderThemeBrush"]; } void UpdateBorderRadius() @@ -188,7 +189,7 @@ void UpdateFont() if (font == Font.Default && !_fontApplied) return; - Font fontToApply = font == Font.Default ? Font.SystemFontOfSize(NamedSize.Medium) : font; + Font fontToApply = font == Font.Default ? Font.SystemFontOfSize(Device.GetNamedSize(NamedSize.Medium, Element.GetType(), false)) : font; Control.ApplyFont(fontToApply); _fontApplied = true; @@ -196,7 +197,7 @@ void UpdateFont() void UpdateTextColor() { - Control.Foreground = Element.TextColor.IsNotDefault() ? Element.TextColor.ToBrush() : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["DefaultTextForegroundThemeBrush"]; + Control.Foreground = Element.TextColor.IsNotDefault() ? Maui.ColorExtensions.ToNative(Element.TextColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["DefaultTextForegroundThemeBrush"]; } void UpdatePadding() diff --git a/src/Compatibility/Core/src/WinUI/RefreshViewRenderer.cs b/src/Compatibility/Core/src/WinUI/RefreshViewRenderer.cs index f759d854f95a..d73e341a3655 100644 --- a/src/Compatibility/Core/src/WinUI/RefreshViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/RefreshViewRenderer.cs @@ -9,6 +9,7 @@ using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.RefreshView; using WBrush = Microsoft.UI.Xaml.Media.Brush; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -120,9 +121,9 @@ protected override void UpdateBackgroundColor() return; if (Element.BackgroundColor.IsNotDefault()) - Control.Visualizer.Background = Element.BackgroundColor.ToBrush(); + Control.Visualizer.Background = Maui.ColorExtensions.ToNative(Element.BackgroundColor); else - Control.Visualizer.Background = Colors.White.ToBrush(); + Control.Visualizer.Background = Maui.ColorExtensions.ToNative(Colors.White); } void UpdateContent() @@ -160,7 +161,7 @@ void UpdateColors() return; Control.Visualizer.Foreground = Element.RefreshColor.IsNotDefault() - ? Element.RefreshColor.ToBrush() + ? Maui.ColorExtensions.ToNative(Element.RefreshColor) : (WBrush)Microsoft.UI.Xaml.Application.Current.Resources["DefaultTextForegroundThemeBrush"]; UpdateBackgroundColor(); diff --git a/src/Compatibility/Core/src/WinUI/RendererToHandlerShim.cs b/src/Compatibility/Core/src/WinUI/RendererToHandlerShim.cs index 9e24462c3ca1..58bcf88985d2 100644 --- a/src/Compatibility/Core/src/WinUI/RendererToHandlerShim.cs +++ b/src/Compatibility/Core/src/WinUI/RendererToHandlerShim.cs @@ -4,6 +4,7 @@ using Microsoft.Maui.Controls.Compatibility.Platform.UWP; using Microsoft.UI.Xaml; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility { diff --git a/src/Compatibility/Core/src/WinUI/ScrollViewRenderer.cs b/src/Compatibility/Core/src/WinUI/ScrollViewRenderer.cs index 6dae05612797..8489dce9823b 100644 --- a/src/Compatibility/Core/src/WinUI/ScrollViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/ScrollViewRenderer.cs @@ -6,6 +6,7 @@ using WRect = Windows.Foundation.Rect; using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/SearchBarRenderer.cs b/src/Compatibility/Core/src/WinUI/SearchBarRenderer.cs index 9c05b83dea36..903154e3a687 100644 --- a/src/Compatibility/Core/src/WinUI/SearchBarRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/SearchBarRenderer.cs @@ -7,6 +7,7 @@ using WBrush = Microsoft.UI.Xaml.Media.Brush; using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.SearchBar; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -136,6 +137,7 @@ protected override void SetAutomationId(string id) _queryTextBox.SetAutomationPropertiesAutomationId($"{id}_AutoSuggestBox"); } + [PortHandler] void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs e) { // Modifies the text of the control if it does not match the query. @@ -146,6 +148,7 @@ void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventAr Element.OnSearchButtonPressed(); } + [PortHandler] void OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs e) { if (e.Reason == AutoSuggestionBoxTextChangeReason.ProgrammaticChange) @@ -188,7 +191,7 @@ void UpdateCancelButtonColor() else { // Determine whether the background should be black or white (in order to make the foreground color visible) - var bcolor = cancelColor.ToWindowsColor().GetContrastingColor().ToFormsColor(); + var bcolor = cancelColor.ToWindowsColor().GetContrastingColor().ToColor(); BrushHelpers.UpdateColor(bcolor, ref _defaultDeleteButtonBackgroundColorBrush, () => _cancelButton.BackgroundBrush, brush => _cancelButton.BackgroundBrush = brush); } @@ -223,11 +226,13 @@ void UpdateFont() _fontApplied = true; } + [PortHandler] void UpdateCharacterSpacing() { Control.CharacterSpacing = Element.CharacterSpacing.ToEm(); } + [PortHandler] void UpdatePlaceholder() { Control.PlaceholderText = Element.Placeholder ?? string.Empty; @@ -323,7 +328,7 @@ protected override void UpdateBackgroundColor() if (!backgroundColor.IsDefault()) { - _queryTextBox.Background = backgroundColor.ToBrush(); + _queryTextBox.Background = Maui.ColorExtensions.ToNative(backgroundColor); } else { diff --git a/src/Compatibility/Core/src/WinUI/Shapes/EllipseRenderer.cs b/src/Compatibility/Core/src/WinUI/Shapes/EllipseRenderer.cs index ca88dff12a98..eebef955337a 100644 --- a/src/Compatibility/Core/src/WinUI/Shapes/EllipseRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shapes/EllipseRenderer.cs @@ -1,6 +1,7 @@ using Microsoft.Maui.Controls.Shapes; +using Microsoft.Maui.Controls.Platform; -#if WINDOWS_UWP +#if WINDOWS using WEllipse = Microsoft.UI.Xaml.Shapes.Ellipse; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP diff --git a/src/Compatibility/Core/src/WinUI/Shapes/LineRenderer.cs b/src/Compatibility/Core/src/WinUI/Shapes/LineRenderer.cs index 9dfe376e930c..1aeb68b77b92 100644 --- a/src/Compatibility/Core/src/WinUI/Shapes/LineRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shapes/LineRenderer.cs @@ -1,7 +1,8 @@ using System.ComponentModel; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.Shapes; -#if WINDOWS_UWP +#if WINDOWS using WLine = Microsoft.UI.Xaml.Shapes.Line; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP diff --git a/src/Compatibility/Core/src/WinUI/Shapes/PathRenderer.cs b/src/Compatibility/Core/src/WinUI/Shapes/PathRenderer.cs index bebc33b16948..ea981f0e6c15 100644 --- a/src/Compatibility/Core/src/WinUI/Shapes/PathRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shapes/PathRenderer.cs @@ -1,7 +1,8 @@ using System.ComponentModel; using Path = Microsoft.Maui.Controls.Shapes.Path; +using Microsoft.Maui.Controls.Platform; -#if WINDOWS_UWP +#if WINDOWS using WPath = Microsoft.UI.Xaml.Shapes.Path; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP @@ -41,7 +42,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE void UpdateData() { - Control.Data = Element.Data.ToWindows(); + Control.Data = Element.Data.ToNative(); } void UpdateRenderTransform() diff --git a/src/Compatibility/Core/src/WinUI/Shapes/PolygonRenderer.cs b/src/Compatibility/Core/src/WinUI/Shapes/PolygonRenderer.cs index 5a2c0d47aa3c..2e296468311e 100644 --- a/src/Compatibility/Core/src/WinUI/Shapes/PolygonRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shapes/PolygonRenderer.cs @@ -1,8 +1,9 @@ using System.ComponentModel; using Microsoft.Maui.Controls.Shapes; using System.Collections.Specialized; +using Microsoft.Maui.Controls.Platform; -#if WINDOWS_UWP +#if WINDOWS using WFillRule = Microsoft.UI.Xaml.Media.FillRule; using WPolygon = Microsoft.UI.Xaml.Shapes.Polygon; diff --git a/src/Compatibility/Core/src/WinUI/Shapes/PolylineRenderer.cs b/src/Compatibility/Core/src/WinUI/Shapes/PolylineRenderer.cs index 862909fb7ca1..8ef1f35f0bc9 100644 --- a/src/Compatibility/Core/src/WinUI/Shapes/PolylineRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shapes/PolylineRenderer.cs @@ -1,8 +1,9 @@ using System.ComponentModel; using Microsoft.Maui.Controls.Shapes; using System.Collections.Specialized; +using Microsoft.Maui.Controls.Platform; -#if WINDOWS_UWP +#if WINDOWS using WFillRule = Microsoft.UI.Xaml.Media.FillRule; using WPolyline = Microsoft.UI.Xaml.Shapes.Polyline; diff --git a/src/Compatibility/Core/src/WinUI/Shapes/RectangleRenderer.cs b/src/Compatibility/Core/src/WinUI/Shapes/RectangleRenderer.cs index 328db4023f7c..e838de0dfa91 100644 --- a/src/Compatibility/Core/src/WinUI/Shapes/RectangleRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shapes/RectangleRenderer.cs @@ -1,7 +1,8 @@ using System.ComponentModel; +using Microsoft.Maui.Controls.Platform; using FormsRectangle = Microsoft.Maui.Controls.Shapes.Rectangle; -#if WINDOWS_UWP +#if WINDOWS using WRectangle = Microsoft.UI.Xaml.Shapes.Rectangle; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP diff --git a/src/Compatibility/Core/src/WinUI/Shapes/ShapeRenderer.cs b/src/Compatibility/Core/src/WinUI/Shapes/ShapeRenderer.cs index e120fc2b8f3a..9be91b9227ff 100644 --- a/src/Compatibility/Core/src/WinUI/Shapes/ShapeRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shapes/ShapeRenderer.cs @@ -2,8 +2,9 @@ using System.ComponentModel; using Shape = Microsoft.Maui.Controls.Shapes.Shape; using Microsoft.Maui.Controls.Shapes; +using Microsoft.Maui.Controls.Platform; -#if WINDOWS_UWP +#if WINDOWS using Microsoft.UI.Xaml; using WDoubleCollection = Microsoft.UI.Xaml.Media.DoubleCollection; using WPenLineCap = Microsoft.UI.Xaml.Media.PenLineCap; @@ -74,7 +75,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE UpdateStrokeMiterLimit(); } -#if !WINDOWS_UWP +#if !WINDOWS new #endif void UpdateHeight() @@ -82,7 +83,7 @@ void UpdateHeight() Control.Height = Math.Max(Element.Height, 0); } -#if !WINDOWS_UWP +#if !WINDOWS new #endif void UpdateWidth() diff --git a/src/Compatibility/Core/src/WinUI/Shell/ShellFlyoutItemRenderer.cs b/src/Compatibility/Core/src/WinUI/Shell/ShellFlyoutItemRenderer.cs index d19a85fcbe8a..203d8df33163 100644 --- a/src/Compatibility/Core/src/WinUI/Shell/ShellFlyoutItemRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shell/ShellFlyoutItemRenderer.cs @@ -9,6 +9,7 @@ using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media; using WRect = Windows.Foundation.Rect; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -123,11 +124,11 @@ void OnMeasureInvalidated() { if (!_content.IsVisible) { - fe.Visibility = Visibility.Collapsed; + fe.Visibility = WVisibility.Collapsed; } else { - fe.Visibility = Visibility.Visible; + fe.Visibility = WVisibility.Visible; } } diff --git a/src/Compatibility/Core/src/WinUI/Shell/ShellItemRenderer.cs b/src/Compatibility/Core/src/WinUI/Shell/ShellItemRenderer.cs index ab541b8e99a6..6ba970c8014d 100644 --- a/src/Compatibility/Core/src/WinUI/Shell/ShellItemRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shell/ShellItemRenderer.cs @@ -17,6 +17,8 @@ using Microsoft.UI.Xaml.Media; using UwpApplication = Microsoft.UI.Xaml.Application; using UwpSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush; +using Microsoft.Maui.Controls.Platform; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -167,7 +169,7 @@ void UpdateBottomBar() if (!fontImageSource.Color.IsDefault()) { - icon.Foreground = fontImageSource.Color.ToBrush(); + icon.Foreground = Maui.ColorExtensions.ToNative(fontImageSource.Color); } btn.Icon = icon; @@ -360,12 +362,12 @@ void UpdateNavBarVisibility() { if (DisplayedPage == null || Shell.GetNavBarIsVisible(DisplayedPage)) { - _HeaderArea.Visibility = Visibility.Visible; + _HeaderArea.Visibility = WVisibility.Visible; Shell.SetFlyoutBehavior(Shell.Current, Microsoft.Maui.Controls.FlyoutBehavior.Flyout); } else { - _HeaderArea.Visibility = Visibility.Collapsed; + _HeaderArea.Visibility = WVisibility.Collapsed; Shell.SetFlyoutBehavior(Shell.Current, Microsoft.Maui.Controls.FlyoutBehavior.Disabled); } } @@ -378,7 +380,7 @@ void UpdatePageTitle() void UpdateBottomBarVisibility() { bool isVisible = ShellItemController?.ShowTabs ?? false; - _BottomBar.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed; + _BottomBar.Visibility = isVisible ? WVisibility.Visible : WVisibility.Collapsed; } void UpdateToolbar() diff --git a/src/Compatibility/Core/src/WinUI/Shell/ShellRenderer.cs b/src/Compatibility/Core/src/WinUI/Shell/ShellRenderer.cs index ef0340b92859..a0e1833a7d05 100644 --- a/src/Compatibility/Core/src/WinUI/Shell/ShellRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shell/ShellRenderer.cs @@ -11,6 +11,7 @@ using Microsoft.UI; using System.Collections.Specialized; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -302,7 +303,7 @@ protected virtual void UpdateFlyoutBackgroundColor() new WSolidColorBrush(uiColor); } else - FlyoutBackgroundColor = _shell.FlyoutBackgroundColor.ToBrush(); + FlyoutBackgroundColor = Maui.ColorExtensions.ToNative(_shell.FlyoutBackgroundColor); } protected virtual void OnElementSet(Shell shell) diff --git a/src/Compatibility/Core/src/WinUI/Shell/ShellSplitView.cs b/src/Compatibility/Core/src/WinUI/Shell/ShellSplitView.cs index 84fe596dd8d5..860a754bfec1 100644 --- a/src/Compatibility/Core/src/WinUI/Shell/ShellSplitView.cs +++ b/src/Compatibility/Core/src/WinUI/Shell/ShellSplitView.cs @@ -2,6 +2,7 @@ using WBrush = Microsoft.UI.Xaml.Media.Brush; using WRectangle = Microsoft.UI.Xaml.Shapes.Rectangle; using Microsoft.UI.Xaml; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/Shell/ShellToolbarItemRenderer.cs b/src/Compatibility/Core/src/WinUI/Shell/ShellToolbarItemRenderer.cs index 6faaa5f8213c..4258653d686e 100644 --- a/src/Compatibility/Core/src/WinUI/Shell/ShellToolbarItemRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/Shell/ShellToolbarItemRenderer.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Maui.Controls.Platform; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Input; @@ -44,14 +45,16 @@ void ToolbarItemChanged(ToolbarItem oldItem, ToolbarItem newItem) if(oldItem != null) oldItem.PropertyChanged -= ToolbarItemPropertyChanged; - this.SetAutomationProperties(newItem, defaultName: newItem?.Text); + // TODO MAUI + this.SetAutomationProperties(newItem, null, defaultName: newItem?.Text); if (newItem != null) newItem.PropertyChanged += ToolbarItemPropertyChanged; void ToolbarItemPropertyChanged(object sender, PropertyChangedEventArgs e) { - this.SetAutomationProperties(newItem, defaultName: newItem?.Text); + // TODO MAUI + this.SetAutomationProperties(newItem, null, defaultName: newItem?.Text); } } } diff --git a/src/Compatibility/Core/src/WinUI/SliderRenderer.cs b/src/Compatibility/Core/src/WinUI/SliderRenderer.cs index 59c17d4f47ba..4c835f2b9ace 100644 --- a/src/Compatibility/Core/src/WinUI/SliderRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/SliderRenderer.cs @@ -7,6 +7,7 @@ using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Media.Imaging; using WBrush = Microsoft.UI.Xaml.Media.Brush; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -102,6 +103,7 @@ void UpdateSliderColors() UpdateMaximumTrackColor(); } + [PortHandler] void UpdateMinimumTrackColor() { if (Control != null) @@ -109,10 +111,11 @@ void UpdateMinimumTrackColor() if (Element.MinimumTrackColor.IsDefault()) Control.Foreground = defaultforegroundcolor; else - Control.Foreground = Element.MinimumTrackColor.ToBrush(); + Control.Foreground = Maui.ColorExtensions.ToNative(Element.MinimumTrackColor); } } + [PortHandler] void UpdateMaximumTrackColor() { if (Control != null) @@ -120,7 +123,7 @@ void UpdateMaximumTrackColor() if (Element.MaximumTrackColor.IsDefault()) Control.Background = defaultbackgroundcolor; else - Control.Background = Element.MaximumTrackColor.ToBrush(); + Control.Background = Maui.ColorExtensions.ToNative(Element.MaximumTrackColor); } } @@ -192,7 +195,7 @@ protected override void UpdateBackgroundColor() Color backgroundColor = Element.BackgroundColor; if (!backgroundColor.IsDefault()) { - Control.Background = backgroundColor.ToBrush(); + Control.Background = Maui.ColorExtensions.ToNative(backgroundColor); } else { @@ -225,16 +228,19 @@ void UpdateFlowDirection() protected override bool PreventGestureBubbling { get; set; } = true; + [PortHandler] void OnNativeValueChanged(object sender, RangeBaseValueChangedEventArgs e) { ((IElementController)Element).SetValueFromRenderer(Slider.ValueProperty, e.NewValue); } + [PortHandler] void OnPointerPressed(object sender, PointerRoutedEventArgs e) { ((ISliderController)Element)?.SendDragStarted(); } + [PortHandler] void OnPointerReleased(object sender, PointerRoutedEventArgs e) { ((ISliderController)Element)?.SendDragCompleted(); diff --git a/src/Compatibility/Core/src/WinUI/StepperControl.cs b/src/Compatibility/Core/src/WinUI/StepperControl.cs index 5f3bff00a9fc..a1e78f6c9ee2 100644 --- a/src/Compatibility/Core/src/WinUI/StepperControl.cs +++ b/src/Compatibility/Core/src/WinUI/StepperControl.cs @@ -9,6 +9,7 @@ using WVisualStateGroup = Microsoft.UI.Xaml.VisualStateGroup; using WVisualState = Microsoft.UI.Xaml.VisualState; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -230,7 +231,7 @@ void UpdateButtonBackgroundColor(Color value) return; } - WBrush brush = value.ToBrush(); + WBrush brush = Maui.ColorExtensions.ToNative(value); _minus = GetTemplateChild("Minus") as Microsoft.UI.Xaml.Controls.Button; _plus = GetTemplateChild("Plus") as Microsoft.UI.Xaml.Controls.Button; if (_minus != null) diff --git a/src/Compatibility/Core/src/WinUI/StepperRenderer.cs b/src/Compatibility/Core/src/WinUI/StepperRenderer.cs index cc4536ad4811..83be6543164c 100644 --- a/src/Compatibility/Core/src/WinUI/StepperRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/StepperRenderer.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/StreamImagesourceHandler.cs b/src/Compatibility/Core/src/WinUI/StreamImagesourceHandler.cs index f5bd2dc9c311..3d92a21ddfa4 100644 --- a/src/Compatibility/Core/src/WinUI/StreamImagesourceHandler.cs +++ b/src/Compatibility/Core/src/WinUI/StreamImagesourceHandler.cs @@ -2,6 +2,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using Microsoft.Maui.Controls.Platform; using Microsoft.UI.Xaml.Media.Imaging; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP diff --git a/src/Compatibility/Core/src/WinUI/SwipeViewRenderer.cs b/src/Compatibility/Core/src/WinUI/SwipeViewRenderer.cs index f60fdb2bd6a3..ab836d21a30e 100644 --- a/src/Compatibility/Core/src/WinUI/SwipeViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/SwipeViewRenderer.cs @@ -9,6 +9,7 @@ using WSwipeItem = Microsoft.UI.Xaml.Controls.SwipeItem; using WSwipeMode = Microsoft.UI.Xaml.Controls.SwipeMode; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -131,7 +132,7 @@ protected override void UpdateBackgroundColor() if (Control != null) { - Control.Background = backgroundColor.IsDefault() ? null : backgroundColor.ToBrush(); + Control.Background = backgroundColor.IsDefault() ? null : Maui.ColorExtensions.ToNative(backgroundColor); } base.UpdateBackgroundColor(); @@ -256,10 +257,10 @@ void UpdateSwipeItem(SwipeItem formsSwipeItem) { windowsSwipeItem.Text = formsSwipeItem.Text; windowsSwipeItem.IconSource = formsSwipeItem.IconImageSource.ToWindowsIconSource(); - windowsSwipeItem.Background = formsSwipeItem.BackgroundColor.ToBrush(); + windowsSwipeItem.Background = Maui.ColorExtensions.ToNative(formsSwipeItem.BackgroundColor); var textColor = GetSwipeItemColor(formsSwipeItem.BackgroundColor); - windowsSwipeItem.Foreground = textColor.ToBrush(); + windowsSwipeItem.Foreground = Maui.ColorExtensions.ToNative(textColor); } } @@ -326,8 +327,8 @@ WSwipeItems CreateSwipeItems(SwipeDirection swipeDirection) var windowsSwipeItem = new WSwipeItem { - Background = formsSwipeItem.BackgroundColor.IsDefault() ? null : formsSwipeItem.BackgroundColor.ToBrush(), - Foreground = textColor.ToBrush(), + Background = formsSwipeItem.BackgroundColor.IsDefault() ? null : Maui.ColorExtensions.ToNative(formsSwipeItem.BackgroundColor), + Foreground = Maui.ColorExtensions.ToNative(textColor), IconSource = formsSwipeItem.IconImageSource.ToWindowsIconSource(), Text = !string.IsNullOrEmpty(formsSwipeItem.Text) ? formsSwipeItem.Text : string.Empty, BehaviorOnInvoked = GetSwipeBehaviorOnInvoked(items.SwipeBehaviorOnInvoked) diff --git a/src/Compatibility/Core/src/WinUI/SwitchRenderer.cs b/src/Compatibility/Core/src/WinUI/SwitchRenderer.cs index 4b9e70ffd3b2..7384c740d52e 100644 --- a/src/Compatibility/Core/src/WinUI/SwitchRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/SwitchRenderer.cs @@ -11,6 +11,7 @@ using WRectangle = Microsoft.UI.Xaml.Shapes.Rectangle; using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush; using WVisualStateManager = Microsoft.UI.Xaml.VisualStateManager; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -199,7 +200,7 @@ void UpdateThumbColor() if (!Element.ThumbColor.IsDefault()) { - var brush = Element.ThumbColor.ToBrush(); + var brush = Maui.ColorExtensions.ToNative(Element.ThumbColor); brush.Opacity = _originalThumbOnBrush.Opacity; frame.Value = brush; } @@ -218,7 +219,7 @@ void UpdateThumbColor() _originalThumbOnBrush = thumb.Fill; if (!Element.ThumbColor.IsDefault()) - thumb.Fill = Element.ThumbColor.ToBrush(); + thumb.Fill = Maui.ColorExtensions.ToNative(Element.ThumbColor); else thumb.Fill = _originalThumbOnBrush; } diff --git a/src/Compatibility/Core/src/WinUI/TableViewRenderer.cs b/src/Compatibility/Core/src/WinUI/TableViewRenderer.cs index 7cc8d7fe2e7b..67c5f1a82ada 100644 --- a/src/Compatibility/Core/src/WinUI/TableViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/TableViewRenderer.cs @@ -4,6 +4,7 @@ using Microsoft.UI.Xaml.Data; using WItemsControl = Microsoft.UI.Xaml.Controls.ItemsControl; using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/TextBlockExtensions.cs b/src/Compatibility/Core/src/WinUI/TextBlockExtensions.cs index 557818e9bf97..27f0bd0530f2 100644 --- a/src/Compatibility/Core/src/WinUI/TextBlockExtensions.cs +++ b/src/Compatibility/Core/src/WinUI/TextBlockExtensions.cs @@ -2,7 +2,7 @@ using System.Linq; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Graphics; -#if WINDOWS_UWP +#if WINDOWS using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Documents; using NativeSize = Windows.Foundation.Size; @@ -12,7 +12,7 @@ using NativeSize = System.Windows.Size; #endif -#if WINDOWS_UWP +#if WINDOWS namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP #else namespace Microsoft.Maui.Controls.Compatibility.Platform.WPF diff --git a/src/Compatibility/Core/src/WinUI/TimePickerRenderer.cs b/src/Compatibility/Core/src/WinUI/TimePickerRenderer.cs index ad09733763d5..d8f1fcd14ea5 100644 --- a/src/Compatibility/Core/src/WinUI/TimePickerRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/TimePickerRenderer.cs @@ -8,6 +8,7 @@ using Microsoft.UI.Xaml.Controls.Primitives; using WBrush = Microsoft.UI.Xaml.Media.Brush; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -162,6 +163,7 @@ void UpdateFont() _fontApplied = true; } + [PortHandler] void UpdateTime() { Control.Time = Element.Time; @@ -183,7 +185,7 @@ void UpdateCharacterSpacing() void UpdateTextColor() { Color color = Element.TextColor; - Control.Foreground = color.IsDefault() ? (_defaultBrush ?? color.ToBrush()) : color.ToBrush(); + Control.Foreground = color.IsDefault() ? (_defaultBrush ?? Maui.ColorExtensions.ToNative(color)) : Maui.ColorExtensions.ToNative(color); } } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/WinUI/TitleViewManager.cs b/src/Compatibility/Core/src/WinUI/TitleViewManager.cs index 2b435bd3567a..499ea053e49c 100644 --- a/src/Compatibility/Core/src/WinUI/TitleViewManager.cs +++ b/src/Compatibility/Core/src/WinUI/TitleViewManager.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -70,7 +71,7 @@ void UpdateTitleViewWidth() double buttonWidth = 0; foreach (var item in CommandBar.GetDescendantsByName("MoreButton")) - if (item.Visibility == Visibility.Visible) + if (item.Visibility == WVisibility.Visible) buttonWidth += item.ActualWidth; if (!CommandBar.IsDynamicOverflowEnabled) diff --git a/src/Compatibility/Core/src/WinUI/UriImageSourceHandler.cs b/src/Compatibility/Core/src/WinUI/UriImageSourceHandler.cs index 3c79a5d69f6e..4aefdc1699a7 100644 --- a/src/Compatibility/Core/src/WinUI/UriImageSourceHandler.cs +++ b/src/Compatibility/Core/src/WinUI/UriImageSourceHandler.cs @@ -6,6 +6,7 @@ using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media.Imaging; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -42,7 +43,7 @@ public Task LoadIconElementAsync(ImageSource imagesource, Cancellat if (imageLoader?.Uri == null) return null; - Stream streamImage = await imageLoader.GetStreamAsync(cancellationToken); + Stream streamImage = await ((IStreamImageSource)imageLoader).GetStreamAsync(cancellationToken); if (streamImage == null || !streamImage.CanRead) { diff --git a/src/Compatibility/Core/src/WinUI/ViewRenderer.cs b/src/Compatibility/Core/src/WinUI/ViewRenderer.cs index 7ee9e0934335..b6d0570ca664 100644 --- a/src/Compatibility/Core/src/WinUI/ViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/ViewRenderer.cs @@ -1,5 +1,6 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Automation.Peers; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/VisualElementRenderer.cs b/src/Compatibility/Core/src/WinUI/VisualElementRenderer.cs index eef5b8576ece..8139e4be3e6d 100644 --- a/src/Compatibility/Core/src/WinUI/VisualElementRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/VisualElementRenderer.cs @@ -11,6 +11,7 @@ using WRect = Windows.Foundation.Rect; using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -434,7 +435,8 @@ protected virtual void SetAutomationPropertiesLabeledBy() if (Control == null) return; - _defaultAutomationPropertiesLabeledBy = Control.SetAutomationPropertiesLabeledBy(Element, _defaultAutomationPropertiesLabeledBy); + // TODO MAUI + _defaultAutomationPropertiesLabeledBy = Control.SetAutomationPropertiesLabeledBy(Element, null, _defaultAutomationPropertiesLabeledBy); } protected void SetNativeControl(TNativeElement control) @@ -499,7 +501,7 @@ protected virtual void UpdateBackgroundColor() { if (!backgroundColor.IsDefault()) { - _control.Background = backgroundColor.ToBrush(); + _control.Background = Maui.ColorExtensions.ToNative(backgroundColor); } else { @@ -511,7 +513,7 @@ protected virtual void UpdateBackgroundColor() { if (!backgroundColor.IsDefault()) { - backgroundLayer.Background = backgroundColor.ToBrush(); + backgroundLayer.Background = Maui.ColorExtensions.ToNative(backgroundColor); } else { @@ -539,7 +541,7 @@ protected virtual void UpdateBackground() else { if (!backgroundColor.IsDefault()) - _control.Background = backgroundColor.ToBrush(); + _control.Background = Maui.ColorExtensions.ToNative(backgroundColor); else { _control.ClearValue(Microsoft.UI.Xaml.Controls.Control.BackgroundProperty); @@ -554,7 +556,7 @@ protected virtual void UpdateBackground() else { if (!backgroundColor.IsDefault()) - backgroundLayer.Background = backgroundColor.ToBrush(); + backgroundLayer.Background = Maui.ColorExtensions.ToNative(backgroundColor); else backgroundLayer.ClearValue(BackgroundProperty); } diff --git a/src/Compatibility/Core/src/WinUI/VisualElementTracker.cs b/src/Compatibility/Core/src/WinUI/VisualElementTracker.cs index 636124dbbc55..f6c98ec40202 100644 --- a/src/Compatibility/Core/src/WinUI/VisualElementTracker.cs +++ b/src/Compatibility/Core/src/WinUI/VisualElementTracker.cs @@ -18,6 +18,7 @@ using WCompositeTransform = Microsoft.UI.Xaml.Media.CompositeTransform; using WScaleTransform = Microsoft.UI.Xaml.Media.ScaleTransform; using Microsoft.Maui.Graphics; +using WVisibility = Microsoft.UI.Xaml.Visibility; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -202,7 +203,7 @@ void HandleDragStarting(UIElement sender, Microsoft.UI.Xaml.DragStartingEventArg } var renderer = sender as IVisualElementRenderer; - var args = rec.SendDragStarting(renderer?.Element); + var args = rec.SendDragStarting(renderer?.Element as IView); e.Data.Properties["_XFPropertes_DONTUSE"] = args.Data; if (!args.Handled && renderer != null) @@ -778,9 +779,10 @@ static void UpdateScaleAndRotation(VisualElement view, FrameworkElement framewor UpdateRotation(view, frameworkElement); } + [PortHandler] static void UpdateVisibility(VisualElement view, FrameworkElement frameworkElement) { - frameworkElement.Visibility = view.IsVisible ? Visibility.Visible : Visibility.Collapsed; + frameworkElement.Visibility = view.IsVisible ? WVisibility.Visible : WVisibility.Collapsed; } void UpdateDragAndDropGestureRecognizers() diff --git a/src/Compatibility/Core/src/WinUI/WebViewRenderer.cs b/src/Compatibility/Core/src/WinUI/WebViewRenderer.cs index 0d06deda3d45..1a743cf314f4 100644 --- a/src/Compatibility/Core/src/WinUI/WebViewRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/WebViewRenderer.cs @@ -12,9 +12,7 @@ using System.Linq; using Microsoft.UI.Xaml.Controls; using WWebView = Microsoft.UI.Xaml.Controls.WebView2; - -//TODO WINUI3 -//using WWebViewExecutionMode = Microsoft.UI.Xaml.Controls.WebViewExecutionMode; +using Microsoft.Maui.Controls.Platform; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { diff --git a/src/Compatibility/Core/src/WinUI/Extensions/WinUIHelpers.cs b/src/Compatibility/Core/src/WinUI/WinUIHelpers.cs similarity index 91% rename from src/Compatibility/Core/src/WinUI/Extensions/WinUIHelpers.cs rename to src/Compatibility/Core/src/WinUI/WinUIHelpers.cs index d63feb5fe6d1..0b7942dc87de 100644 --- a/src/Compatibility/Core/src/WinUI/Extensions/WinUIHelpers.cs +++ b/src/Compatibility/Core/src/WinUI/WinUIHelpers.cs @@ -10,7 +10,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { - public static class WinUIHelpers + static class WinUIHelpers { public static WThickness CreateThickness(double left, double top, double right, double bottom) { @@ -55,7 +55,7 @@ public static WCornerRadius CreateCornerRadius(double all) }; } - internal static WGridLength CreateGridLength(int v, UwpGridUnitType auto) + public static WGridLength CreateGridLength(int v, UwpGridUnitType auto) { return new WGridLength(v, auto); } diff --git a/src/Compatibility/Core/src/WinUI/WindowsBasePlatformServices.cs b/src/Compatibility/Core/src/WinUI/WindowsBasePlatformServices.cs index 2974223ccacd..caeb71fa10fd 100644 --- a/src/Compatibility/Core/src/WinUI/WindowsBasePlatformServices.cs +++ b/src/Compatibility/Core/src/WinUI/WindowsBasePlatformServices.cs @@ -141,7 +141,7 @@ public Color GetNamedColor(string name) if (!Microsoft.UI.Xaml.Application.Current?.Resources.ContainsKey(name) ?? true) return KnownColor.Default; - return ((Windows.UI.Color)Microsoft.UI.Xaml.Application.Current?.Resources[name]).ToFormsColor(); + return ((Windows.UI.Color)Microsoft.UI.Xaml.Application.Current?.Resources[name]).ToColor(); } public async Task GetStreamAsync(Uri uri, CancellationToken cancellationToken) diff --git a/src/Compatibility/Core/src/WinUI/WindowsResourcesProvider.cs b/src/Compatibility/Core/src/WinUI/WindowsResourcesProvider.cs index ffdc0b22bbdd..e19c24936fd5 100644 --- a/src/Compatibility/Core/src/WinUI/WindowsResourcesProvider.cs +++ b/src/Compatibility/Core/src/WinUI/WindowsResourcesProvider.cs @@ -4,6 +4,7 @@ using Microsoft.Maui.Controls.Internals; using WStyle = Microsoft.UI.Xaml.Style; using Microsoft.UI.Text; +using FWeight = Windows.UI.Text.FontWeight; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -40,7 +41,7 @@ Style GetStyle(object nativeKey, TextBlock prototype) return formsStyle; } - static FontAttributes ToAttributes(FontWeight fontWeight) + static FontAttributes ToAttributes(FWeight fontWeight) { if (fontWeight.Weight == FontWeights.Bold.Weight || fontWeight.Weight == FontWeights.SemiBold.Weight || fontWeight.Weight == FontWeights.ExtraBold.Weight) diff --git a/src/Compatibility/Core/src/iOS/CADisplayLinkTicker.cs b/src/Compatibility/Core/src/iOS/CADisplayLinkTicker.cs index 0af2006c6f73..a716cdaeff29 100644 --- a/src/Compatibility/Core/src/iOS/CADisplayLinkTicker.cs +++ b/src/Compatibility/Core/src/iOS/CADisplayLinkTicker.cs @@ -3,9 +3,8 @@ using System.Threading; using CoreAnimation; using Foundation; -using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; using Microsoft.Maui.Controls.Internals; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Cells/CellRenderer.cs b/src/Compatibility/Core/src/iOS/Cells/CellRenderer.cs index 11485303fa3a..2a56466b9cf0 100644 --- a/src/Compatibility/Core/src/iOS/Cells/CellRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Cells/CellRenderer.cs @@ -1,9 +1,8 @@ using System; using System.ComponentModel; -using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -34,26 +33,26 @@ public virtual UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UpdateBackground(tvc, item); - SetAccessibility (tvc, item); + SetAccessibility(tvc, item); Performance.Stop(reference); return tvc; } - public virtual void SetAccessibility (UITableViewCell tableViewCell, Cell cell) + public virtual void SetAccessibility(UITableViewCell tableViewCell, Cell cell) { - if (cell.IsSet (AutomationProperties.IsInAccessibleTreeProperty)) - tableViewCell.IsAccessibilityElement = cell.GetValue (AutomationProperties.IsInAccessibleTreeProperty).Equals (true); + if (cell.IsSet(AutomationProperties.IsInAccessibleTreeProperty)) + tableViewCell.IsAccessibilityElement = cell.GetValue(AutomationProperties.IsInAccessibleTreeProperty).Equals(true); else tableViewCell.IsAccessibilityElement = false; - if (cell.IsSet (AutomationProperties.NameProperty)) - tableViewCell.AccessibilityLabel = cell.GetValue (AutomationProperties.NameProperty).ToString (); + if (cell.IsSet(AutomationProperties.NameProperty)) + tableViewCell.AccessibilityLabel = cell.GetValue(AutomationProperties.NameProperty).ToString(); else tableViewCell.AccessibilityLabel = null; - if (cell.IsSet (AutomationProperties.HelpTextProperty)) - tableViewCell.AccessibilityHint = cell.GetValue (AutomationProperties.HelpTextProperty).ToString (); + if (cell.IsSet(AutomationProperties.HelpTextProperty)) + tableViewCell.AccessibilityHint = cell.GetValue(AutomationProperties.HelpTextProperty).ToString(); else tableViewCell.AccessibilityHint = null; } @@ -114,9 +113,9 @@ protected void WireUpForceUpdateSizeRequested(ICellController cell, UITableViewC _onPropertyChangedEventHandler = (sender, e) => { - if(e.PropertyName == "RealCell" && sender is BindableObject bo && GetRealCell(bo) == null) + if (e.PropertyName == "RealCell" && sender is BindableObject bo && GetRealCell(bo) == null) { - if(sender is ICellController icc) + if (sender is ICellController icc) icc.ForceUpdateSizeRequested -= _onForceUpdateSizeRequested; if (sender is INotifyPropertyChanged notifyPropertyChanged) diff --git a/src/Compatibility/Core/src/iOS/Cells/EntryCellRenderer.cs b/src/Compatibility/Core/src/iOS/Cells/EntryCellRenderer.cs index 5283db12c863..e98f646d23cf 100644 --- a/src/Compatibility/Core/src/iOS/Cells/EntryCellRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Cells/EntryCellRenderer.cs @@ -164,33 +164,33 @@ public override void LayoutSubviews() static bool OnShouldReturn(UITextField view) { - var realCell = GetRealCell(view); - var handler = realCell?.KeyboardDoneButtonPressed; - if (handler != null) - handler(realCell, EventArgs.Empty); + var realCell = GetRealCell(view); + var handler = realCell?.KeyboardDoneButtonPressed; + if (handler != null) + handler(realCell, EventArgs.Empty); - view.ResignFirstResponder(); + view.ResignFirstResponder(); return true; } - static void TextFieldOnEditingChanged(object sender, EventArgs eventArgs) + static void TextFieldOnEditingChanged(object sender, EventArgs eventArgs) { - var realCell = GetRealCell(sender as UIView); - var handler = realCell?.TextFieldTextChanged; - if (handler != null) - handler(realCell, EventArgs.Empty); - } - - static T GetRealCell(UIView view) where T : UIView - { - T realCell = null; - while (view.Superview != null && realCell == null) - { - view = view.Superview; - realCell = view as T; - } - return realCell; - } + var realCell = GetRealCell(sender as UIView); + var handler = realCell?.TextFieldTextChanged; + if (handler != null) + handler(realCell, EventArgs.Empty); + } + + static T GetRealCell(UIView view) where T : UIView + { + T realCell = null; + while (view.Superview != null && realCell == null) + { + view = view.Superview; + realCell = view as T; + } + return realCell; + } } } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Cells/ViewCellRenderer.cs b/src/Compatibility/Core/src/iOS/Cells/ViewCellRenderer.cs index f4ab79e41c2c..586242573961 100644 --- a/src/Compatibility/Core/src/iOS/Cells/ViewCellRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Cells/ViewCellRenderer.cs @@ -1,10 +1,9 @@ using System; using System.ComponentModel; +using Microsoft.Maui.Controls.Internals; using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; using RectangleF = CoreGraphics.CGRect; using SizeF = CoreGraphics.CGSize; -using Microsoft.Maui.Controls.Internals; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -219,7 +218,7 @@ void OnMeasureInvalidated(object sender, EventArgs e) SetNeedsLayout(); } - + } } } diff --git a/src/Compatibility/Core/src/iOS/CollectionView/CarouselTemplatedCell.cs b/src/Compatibility/Core/src/iOS/CollectionView/CarouselTemplatedCell.cs index 57b26716d127..e5794d19aba3 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/CarouselTemplatedCell.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/CarouselTemplatedCell.cs @@ -14,13 +14,13 @@ public class CarouselTemplatedCell : TemplatedCell [Export("initWithFrame:")] [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] protected CarouselTemplatedCell(CGRect frame) : base(frame) - { + { } public override void ConstrainTo(nfloat constant) { } - + public override void ConstrainTo(CGSize constraint) { ClearConstraints(); diff --git a/src/Compatibility/Core/src/iOS/CollectionView/CarouselViewController.cs b/src/Compatibility/Core/src/iOS/CollectionView/CarouselViewController.cs index 2a5428004397..5262fbdacdbb 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/CarouselViewController.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/CarouselViewController.cs @@ -95,29 +95,19 @@ public override void ViewDidLayoutSubviews() } } - void BoundsSizeChanged() + void BoundsSizeChanged() { //if the size changed center the item Carousel.ScrollTo(Carousel.Position, position: Microsoft.Maui.Controls.ScrollToPosition.Center, animate: false); } -#if MACCATALYST - [Foundation.Export("scrollViewWillBeginDragging:")] - public virtual void DraggingStarted(UIScrollView scrollView) -#else public override void DraggingStarted(UIScrollView scrollView) -#endif { _isDragging = true; Carousel.SetIsDragging(true); } -#if MACCATALYST - [Foundation.Export("scrollViewDidEndDragging:willDecelerate:")] - public virtual void DraggingEnded(UIScrollView scrollView, bool willDecelerate) -#else public override void DraggingEnded(UIScrollView scrollView, bool willDecelerate) -#endif { Carousel.SetIsDragging(false); _isDragging = false; @@ -325,7 +315,7 @@ void UpdateLoop() } void ScrollToPosition(int goToPosition, int carouselPosition, bool animate, bool forceScroll = false) - { + { if (Carousel.Loop) carouselPosition = _carouselViewLoopManager?.GetCorrectPositionForCenterItem(CollectionView) ?? -1; @@ -626,7 +616,7 @@ void CenterHorizontalIfNeeded(UICollectionView collectionView) var currentOffset = collectionView.ContentOffset; var contentWidth = GetTotalContentWidth(); var boundsWidth = collectionView.Bounds.Size.Width; - + if (contentWidth == 0 || cellWidth == 0) return; diff --git a/src/Compatibility/Core/src/iOS/CollectionView/EmptySource.cs b/src/Compatibility/Core/src/iOS/CollectionView/EmptySource.cs index 61e087c4c254..9ac190984367 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/EmptySource.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/EmptySource.cs @@ -9,7 +9,7 @@ internal class EmptySource : ILoopItemsViewSource public int ItemCount => 0; - public bool Loop { get ; set; } + public bool Loop { get; set; } public int LoopCount => 0; diff --git a/src/Compatibility/Core/src/iOS/CollectionView/GridViewLayout.cs b/src/Compatibility/Core/src/iOS/CollectionView/GridViewLayout.cs index 671431cf9755..8599e6a58462 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/GridViewLayout.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/GridViewLayout.cs @@ -17,12 +17,12 @@ public GridViewLayout(GridItemsLayout itemsLayout, ItemSizingStrategy itemSizing protected override void HandlePropertyChanged(PropertyChangedEventArgs propertyChanged) { - if(propertyChanged.IsOneOf(GridItemsLayout.SpanProperty, GridItemsLayout.HorizontalItemSpacingProperty, + if (propertyChanged.IsOneOf(GridItemsLayout.SpanProperty, GridItemsLayout.HorizontalItemSpacingProperty, GridItemsLayout.VerticalItemSpacingProperty)) { // Update the constraints; ConstrainTo will pick up the new span ConstrainTo(CollectionView.Frame.Size); - + // And force the UICollectionView to reload everything with the new span CollectionView.ReloadData(); } @@ -195,7 +195,7 @@ public override nfloat GetMinimumInteritemSpacingForSection(UICollectionView col return ReduceSpacingToFitIfNeeded(availableSpace, requestedSpacing, _itemsLayout.Span); } - void CenterAlignCellsInColumn(UICollectionViewLayoutAttributes preferredAttributes) + void CenterAlignCellsInColumn(UICollectionViewLayoutAttributes preferredAttributes) { // Determine the set of cells above this one var index = preferredAttributes.IndexPath; @@ -229,7 +229,7 @@ void CenterAlignCellsInColumn(UICollectionViewLayoutAttributes preferredAttribut } } - bool NeedsSingleItemHorizontalAlignmentAdjustment(UICollectionViewLayoutAttributes[] layoutAttributesForRectElements) + bool NeedsSingleItemHorizontalAlignmentAdjustment(UICollectionViewLayoutAttributes[] layoutAttributesForRectElements) { if (ScrollDirection == UICollectionViewScrollDirection.Horizontal) { @@ -254,7 +254,7 @@ bool NeedsPartialColumnAdjustment(int section = 0) if (ScrollDirection == UICollectionViewScrollDirection.Vertical) { // The bug only occurs with Horizontal scrolling - return false; + return false; } if (CollectionView.NumberOfSections() == 0) @@ -289,7 +289,7 @@ bool NeedsPartialColumnAdjustment(int section = 0) return true; } - static nfloat ReduceSpacingToFitIfNeeded(nfloat available, nfloat requestedSpacing, int span) + static nfloat ReduceSpacingToFitIfNeeded(nfloat available, nfloat requestedSpacing, int span) { if (span == 1) { diff --git a/src/Compatibility/Core/src/iOS/CollectionView/GroupableItemsViewController.cs b/src/Compatibility/Core/src/iOS/CollectionView/GroupableItemsViewController.cs index 4114797e24a0..2b4d1a6edf30 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/GroupableItemsViewController.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/GroupableItemsViewController.cs @@ -20,7 +20,7 @@ public class GroupableItemsViewController : SelectableItemsViewContr Action _scrollAnimationEndedCallback; - public GroupableItemsViewController(TItemsView groupableItemsView, ItemsViewLayout layout) + public GroupableItemsViewController(TItemsView groupableItemsView, ItemsViewLayout layout) : base(groupableItemsView, layout) { _isGrouped = ItemsView.IsGrouped; @@ -34,7 +34,7 @@ protected override UICollectionViewDelegateFlowLayout CreateDelegator() protected override IItemsViewSource CreateItemsViewSource() { // Use the BindableProperty here (instead of _isGroupingEnabled) because the cached value might not be set yet - if (ItemsView.IsGrouped) + if (ItemsView.IsGrouped) { return ItemsSourceFactory.CreateGrouped(ItemsView.ItemsSource, this); } @@ -116,8 +116,8 @@ void UpdateTemplatedSupplementaryView(TemplatedCell cell, NSString elementKind, string DetermineViewReuseId(NSString elementKind) { - return DetermineViewReuseId(elementKind == UICollectionElementKindSectionKey.Header - ? ItemsView.GroupHeaderTemplate + return DetermineViewReuseId(elementKind == UICollectionElementKindSectionKey.Header + ? ItemsView.GroupHeaderTemplate : ItemsView.GroupFooterTemplate); } diff --git a/src/Compatibility/Core/src/iOS/CollectionView/GroupableItemsViewDelegator.cs b/src/Compatibility/Core/src/iOS/CollectionView/GroupableItemsViewDelegator.cs index dee8f7e604c2..2cf24fe86e1e 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/GroupableItemsViewDelegator.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/GroupableItemsViewDelegator.cs @@ -8,7 +8,7 @@ public class GroupableItemsViewDelegator : Selectab where TItemsView : GroupableItemsView where TViewController : GroupableItemsViewController { - public GroupableItemsViewDelegator(ItemsViewLayout itemsViewLayout, TViewController itemsViewController) + public GroupableItemsViewDelegator(ItemsViewLayout itemsViewLayout, TViewController itemsViewController) : base(itemsViewLayout, itemsViewController) { } diff --git a/src/Compatibility/Core/src/iOS/CollectionView/HeightConstrainedTemplatedCell.cs b/src/Compatibility/Core/src/iOS/CollectionView/HeightConstrainedTemplatedCell.cs index 6300c3fd48e0..73eab6ca0c5b 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/HeightConstrainedTemplatedCell.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/HeightConstrainedTemplatedCell.cs @@ -34,7 +34,7 @@ protected override (bool, Size) NeedsContentSizeUpdate(Size currentSize) return (false, size); } - var desiredBounds = VisualElementRenderer.Element.Measure(double.PositiveInfinity, bounds.Height, + var desiredBounds = VisualElementRenderer.Element.Measure(double.PositiveInfinity, bounds.Height, MeasureFlags.IncludeMargins); if (desiredBounds.Request.Width == currentSize.Width) diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ILoopItemsViewSource.cs b/src/Compatibility/Core/src/iOS/CollectionView/ILoopItemsViewSource.cs index 06c09fa763e3..fd0a03893818 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ILoopItemsViewSource.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ILoopItemsViewSource.cs @@ -1,9 +1,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { - public interface ILoopItemsViewSource : IItemsViewSource - { - bool Loop { get; set; } + public interface ILoopItemsViewSource : IItemsViewSource + { + bool Loop { get; set; } - int LoopCount { get; } - } + int LoopCount { get; } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/CollectionView/IndexPathHelpers.cs b/src/Compatibility/Core/src/iOS/CollectionView/IndexPathHelpers.cs index 9578e4520bf1..a57b78823564 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/IndexPathHelpers.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/IndexPathHelpers.cs @@ -4,7 +4,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { public static class IndexPathHelpers { - public static NSIndexPath[] GenerateIndexPathRange(int section, int startIndex, int count) + public static NSIndexPath[] GenerateIndexPathRange(int section, int startIndex, int count) { var result = new NSIndexPath[count]; @@ -33,7 +33,7 @@ public static NSIndexPath[] GenerateLoopedIndexPathRange(int section, int sectio return result; } - public static bool IsIndexPathValid(this IItemsViewSource source, NSIndexPath indexPath) + public static bool IsIndexPathValid(this IItemsViewSource source, NSIndexPath indexPath) { if (indexPath.Section >= source.GroupCount) { diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ItemsSourceFactory.cs b/src/Compatibility/Core/src/iOS/CollectionView/ItemsSourceFactory.cs index da372d1f7cb0..8e15bb1dffd7 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ItemsSourceFactory.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ItemsSourceFactory.cs @@ -56,6 +56,6 @@ public static ILoopItemsViewSource CreateForCarouselView(IEnumerable itemsSource return new LoopListSource(itemsSource, loop); } - + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewController.cs b/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewController.cs index c8fe6fae4996..34a9bf58ffab 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewController.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewController.cs @@ -115,9 +115,9 @@ void CheckForEmptySource() if (wasEmpty != _isEmpty) { - UpdateEmptyViewVisibility(_isEmpty); + UpdateEmptyViewVisibility(_isEmpty); } - + if (wasEmpty && !_isEmpty) { // If we're going from empty to having stuff, it's possible that we've never actually measured @@ -162,7 +162,7 @@ public override void ViewWillLayoutSubviews() LayoutEmptyView(); } - void ConstrainToItemsView() + void ConstrainToItemsView() { var itemsViewWidth = ItemsView.Width; var itemsViewHeight = ItemsView.Height; @@ -306,7 +306,7 @@ void CellLayoutAttributesChanged(object sender, LayoutAttributesChangedEventArgs CacheCellAttributes(args.NewAttributes.IndexPath, args.NewAttributes.Size); } - protected virtual void CacheCellAttributes(NSIndexPath indexPath, CGSize size) + protected virtual void CacheCellAttributes(NSIndexPath indexPath, CGSize size) { if (!ItemsSource.IsIndexPathValid(indexPath)) { @@ -373,7 +373,7 @@ protected virtual void RegisterViewTypes() protected abstract bool IsHorizontal { get; } - protected virtual CGRect DetermineEmptyViewFrame() + protected virtual CGRect DetermineEmptyViewFrame() { return new CGRect(CollectionView.Frame.X, CollectionView.Frame.Y, CollectionView.Frame.Width, CollectionView.Frame.Height); @@ -404,7 +404,7 @@ protected void OnFormsElementMeasureInvalidated(object sender, EventArgs e) protected virtual void HandleFormsElementMeasureInvalidated(VisualElement formsElement) { RemeasureLayout(formsElement); - } + } internal void UpdateView(object view, DataTemplate viewTemplate, ref UIView uiView, ref VisualElement formsElement) { @@ -461,7 +461,7 @@ void UpdateEmptyViewVisibility(bool isEmpty) } } - void AlignEmptyView() + void AlignEmptyView() { if (_emptyUIView == null) { @@ -492,7 +492,7 @@ void FlipEmptyView() _emptyUIView.Transform = CGAffineTransform.Scale(_emptyUIView.Transform, -1, 1); } - void ShowEmptyView() + void ShowEmptyView() { if (_emptyViewDisplayed || _emptyUIView == null) { @@ -513,7 +513,7 @@ void ShowEmptyView() _emptyViewDisplayed = true; } - void HideEmptyView() + void HideEmptyView() { if (!_emptyViewDisplayed || _emptyUIView == null) { @@ -525,13 +525,13 @@ void HideEmptyView() _emptyViewDisplayed = false; } - void TearDownEmptyView() + void TearDownEmptyView() { HideEmptyView(); // RemoveLogicalChild will trigger a disposal of the native view and its content ItemsView.RemoveLogicalChild(_emptyViewFormsElement); - + _emptyUIView = null; _emptyViewFormsElement = null; } @@ -559,11 +559,11 @@ TemplatedCell CreateAppropriateCellForLayout() { return new HorizontalCell(frame); } - + return new VerticalCell(frame); } - public UICollectionViewCell CreateMeasurementCell(NSIndexPath indexPath) + public UICollectionViewCell CreateMeasurementCell(NSIndexPath indexPath) { if (ItemsView.ItemTemplate == null) { @@ -578,13 +578,13 @@ public UICollectionViewCell CreateMeasurementCell(NSIndexPath indexPath) { cell = new VerticalDefaultCell(frame); } - + UpdateDefaultCell(cell, indexPath); return cell; } - TemplatedCell templatedCell = CreateAppropriateCellForLayout(); - + TemplatedCell templatedCell = CreateAppropriateCellForLayout(); + UpdateTemplatedCell(templatedCell, indexPath); // Keep this cell around, we can transfer the contents to the actual cell when the UICollectionView creates it @@ -593,7 +593,7 @@ public UICollectionViewCell CreateMeasurementCell(NSIndexPath indexPath) return templatedCell; } - internal CGSize GetSizeForItem(NSIndexPath indexPath) + internal CGSize GetSizeForItem(NSIndexPath indexPath) { if (ItemsViewLayout.EstimatedItemSize.IsEmpty) { @@ -612,8 +612,8 @@ internal CGSize GetSizeForItem(NSIndexPath indexPath) return ItemsViewLayout.EstimatedItemSize; } - - internal protected virtual void UpdateVisibility() + + internal protected virtual void UpdateVisibility() { if (ItemsView.IsVisible) { diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewLayout.cs b/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewLayout.cs index fce0784b0b7a..fae1adb7de86 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewLayout.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewLayout.cs @@ -3,8 +3,8 @@ using System.ComponentModel; using CoreGraphics; using Foundation; -using UIKit; using Microsoft.Maui.Controls.Internals; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -105,7 +105,7 @@ internal virtual void UpdateConstraints(CGSize size) UpdateCellConstraints(); } - internal void SetInitialConstraints(CGSize size) + internal void SetInitialConstraints(CGSize size) { _currentSize = size; ConstrainTo(size); @@ -123,7 +123,7 @@ public virtual UIEdgeInsets GetInsetForSection(UICollectionView collectionView, return new UIEdgeInsets(0, 0, 0, (nfloat)gridItemsLayout.HorizontalItemSpacing * collectionView.NumberOfItemsInSection(section)); } - return new UIEdgeInsets(0,0, (nfloat)gridItemsLayout.VerticalItemSpacing * collectionView.NumberOfItemsInSection(section), 0); + return new UIEdgeInsets(0, 0, (nfloat)gridItemsLayout.VerticalItemSpacing * collectionView.NumberOfItemsInSection(section), 0); } return UIEdgeInsets.Zero; @@ -247,7 +247,7 @@ protected void UpdateCellConstraints() PrepareCellsForLayout(CollectionView.GetVisibleSupplementaryViews(UICollectionElementKindSectionKey.Footer)); } - void PrepareCellsForLayout(UICollectionReusableView[] cells) + void PrepareCellsForLayout(UICollectionReusableView[] cells) { for (int n = 0; n < cells.Length; n++) { @@ -384,7 +384,7 @@ public override UICollectionViewLayoutInvalidationContext GetInvalidationContext var defaultContext = base.GetInvalidationContext(preferredAttributes, originalAttributes); return defaultContext; } - catch (MonoTouchException ex) when (ex.Name == "NSRangeException") + catch (MonoTouchException ex) when (ex.Name == "NSRangeException") { Controls.Internals.Log.Warning("ItemsViewLayout", ex.ToString()); } @@ -569,7 +569,7 @@ public override bool ShouldInvalidateLayoutForBoundsChange(CGRect newBounds) return true; } - internal bool TryGetCachedCellSize(object item, out CGSize size) + internal bool TryGetCachedCellSize(object item, out CGSize size) { if (_cellSizeCache.TryGetValue(item, out CGSize internalSize)) { @@ -581,12 +581,12 @@ internal bool TryGetCachedCellSize(object item, out CGSize size) return false; } - internal void CacheCellSize(object item, CGSize size) + internal void CacheCellSize(object item, CGSize size) { _cellSizeCache[item] = size; } - internal void ClearCellSizeCache() + internal void ClearCellSizeCache() { _cellSizeCache.Clear(); } diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewRenderer.cs b/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewRenderer.cs index 6e574d5f1664..699a6ad140be 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ItemsViewRenderer.cs @@ -147,7 +147,7 @@ protected virtual void UpdateItemsSource() Controller.UpdateItemsSource(); } - protected virtual void UpdateVisibility() + protected virtual void UpdateVisibility() { Controller?.UpdateVisibility(); } diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ListSource.cs b/src/Compatibility/Core/src/iOS/CollectionView/ListSource.cs index 0afb1c778da6..97743997a0c2 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ListSource.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ListSource.cs @@ -13,7 +13,7 @@ public ListSource() public ListSource(IEnumerable enumerable) : base(enumerable) { - + } public ListSource(IEnumerable enumerable) diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ObservableGroupedSource.cs b/src/Compatibility/Core/src/iOS/CollectionView/ObservableGroupedSource.cs index ae6d240029b5..99a55a783b5c 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ObservableGroupedSource.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ObservableGroupedSource.cs @@ -343,7 +343,7 @@ bool ReloadRequired() || _collectionView.NumberOfSections() == 0; } - void Update(Action update) + void Update(Action update) { if (_collectionView.Hidden) { diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ObservableItemsSource.cs b/src/Compatibility/Core/src/iOS/CollectionView/ObservableItemsSource.cs index d2975f160aa2..de2ed3d938f5 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ObservableItemsSource.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ObservableItemsSource.cs @@ -19,7 +19,7 @@ public ObservableItemsSource(IEnumerable itemSource, UICollectionViewController { _collectionViewController = collectionViewController; CollectionView = _collectionViewController.CollectionView; - + _section = group < 0 ? 0 : group; _grouped = group >= 0; @@ -178,7 +178,7 @@ void Remove(NotifyCollectionChangedEventArgs args) } // If we have a start index, we can be more clever about removing the item(s) (and get the nifty animations) - var count = args.OldItems.Count; + var count = args.OldItems.Count; Count -= count; Update(() => CollectionView.DeleteItems(CreateIndexesFrom(startIndex, count)), args); @@ -273,12 +273,12 @@ void Update(Action update, NotifyCollectionChangedEventArgs args) return; } - OnCollectionViewUpdating(args); - update(); - OnCollectionViewUpdated(args); + OnCollectionViewUpdating(args); + update(); + OnCollectionViewUpdated(args); } - void OnCollectionViewUpdating(NotifyCollectionChangedEventArgs args) + void OnCollectionViewUpdating(NotifyCollectionChangedEventArgs args) { CollectionViewUpdating?.Invoke(this, args); } diff --git a/src/Compatibility/Core/src/iOS/CollectionView/ScrollToPositionExtensions.cs b/src/Compatibility/Core/src/iOS/CollectionView/ScrollToPositionExtensions.cs index 4a06bfe56d51..3f6a026b1a2b 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/ScrollToPositionExtensions.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/ScrollToPositionExtensions.cs @@ -4,7 +4,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { public static class ScrollToPositionExtensions { - public static UICollectionViewScrollPosition ToCollectionViewScrollPosition(this ScrollToPosition scrollToPosition, + public static UICollectionViewScrollPosition ToCollectionViewScrollPosition(this ScrollToPosition scrollToPosition, UICollectionViewScrollDirection scrollDirection = UICollectionViewScrollDirection.Vertical, bool isLtr = false) { if (scrollDirection == UICollectionViewScrollDirection.Horizontal) diff --git a/src/Compatibility/Core/src/iOS/CollectionView/SelectableItemsViewController.cs b/src/Compatibility/Core/src/iOS/CollectionView/SelectableItemsViewController.cs index 0c27faeaf24e..0d9a25d377a9 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/SelectableItemsViewController.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/SelectableItemsViewController.cs @@ -8,7 +8,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS public class SelectableItemsViewController : StructuredItemsViewController where TItemsView : SelectableItemsView { - public SelectableItemsViewController(TItemsView selectableItemsView, ItemsViewLayout layout) + public SelectableItemsViewController(TItemsView selectableItemsView, ItemsViewLayout layout) : base(selectableItemsView, layout) { } @@ -110,7 +110,7 @@ internal void UpdateNativeSelection() // SelectedItem has been set to null; if an item is selected, we need to de-select it ClearSelection(); } - + return; case SelectionMode.Multiple: SynchronizeNativeSelectionWithSelectedItems(); diff --git a/src/Compatibility/Core/src/iOS/CollectionView/SelectableItemsViewDelegator.cs b/src/Compatibility/Core/src/iOS/CollectionView/SelectableItemsViewDelegator.cs index 79cecfa95970..88ae397a0878 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/SelectableItemsViewDelegator.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/SelectableItemsViewDelegator.cs @@ -7,7 +7,7 @@ public class SelectableItemsViewDelegator : ItemsVi where TItemsView : SelectableItemsView where TViewController : SelectableItemsViewController { - public SelectableItemsViewDelegator(ItemsViewLayout itemsViewLayout, TViewController itemsViewController) + public SelectableItemsViewDelegator(ItemsViewLayout itemsViewLayout, TViewController itemsViewController) : base(itemsViewLayout, itemsViewController) { } diff --git a/src/Compatibility/Core/src/iOS/CollectionView/StructuredItemsViewController.cs b/src/Compatibility/Core/src/iOS/CollectionView/StructuredItemsViewController.cs index 8cdfd05abf09..bbc112ee20d3 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/StructuredItemsViewController.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/StructuredItemsViewController.cs @@ -69,7 +69,7 @@ protected override CGRect DetermineEmptyViewFrame() if (footerView != null) footerHeight = footerView.Frame.Height; - return new CGRect(CollectionView.Frame.X, CollectionView.Frame.Y, CollectionView.Frame.Width, + return new CGRect(CollectionView.Frame.X, CollectionView.Frame.Y, CollectionView.Frame.Width, Math.Abs(CollectionView.Frame.Height - (headerHeight + footerHeight))); } diff --git a/src/Compatibility/Core/src/iOS/CollectionView/TemplateHelpers.cs b/src/Compatibility/Core/src/iOS/CollectionView/TemplateHelpers.cs index 35824d900eaa..2a280fc17afc 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/TemplateHelpers.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/TemplateHelpers.cs @@ -1,6 +1,6 @@ using System; -using UIKit; using Microsoft.Maui.Controls.Internals; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/CollectionView/TemplatedCell.cs b/src/Compatibility/Core/src/iOS/CollectionView/TemplatedCell.cs index 768cd6ea2dc8..deb3a7708029 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/TemplatedCell.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/TemplatedCell.cs @@ -1,9 +1,9 @@ using System; using CoreGraphics; using Foundation; -using UIKit; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Graphics; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -75,7 +75,7 @@ public override UICollectionViewLayoutAttributes PreferredLayoutAttributesFittin return preferredAttributes; } - CGSize UpdateCellSize() + CGSize UpdateCellSize() { // Measure this cell (including the Forms element) if there is no constrained size var size = ConstrainedSize == default ? Measure() : ConstrainedSize; diff --git a/src/Compatibility/Core/src/iOS/CollectionView/VerticalSupplementaryView.cs b/src/Compatibility/Core/src/iOS/CollectionView/VerticalSupplementaryView.cs index 673d625f89ae..71df05ae5e64 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/VerticalSupplementaryView.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/VerticalSupplementaryView.cs @@ -21,10 +21,10 @@ public override CGSize Measure() return CGSize.Empty; } - var measure = VisualElementRenderer.Element.Measure(ConstrainedDimension, + var measure = VisualElementRenderer.Element.Measure(ConstrainedDimension, double.PositiveInfinity, MeasureFlags.IncludeMargins); - var height = VisualElementRenderer.Element.Height > 0 + var height = VisualElementRenderer.Element.Height > 0 ? VisualElementRenderer.Element.Height : measure.Request.Height; return new CGSize(ConstrainedDimension, height); diff --git a/src/Compatibility/Core/src/iOS/CollectionView/WidthConstrainedTemplatedCell.cs b/src/Compatibility/Core/src/iOS/CollectionView/WidthConstrainedTemplatedCell.cs index b37a12aadc01..9deea650aa4e 100644 --- a/src/Compatibility/Core/src/iOS/CollectionView/WidthConstrainedTemplatedCell.cs +++ b/src/Compatibility/Core/src/iOS/CollectionView/WidthConstrainedTemplatedCell.cs @@ -34,7 +34,7 @@ protected override (bool, Size) NeedsContentSizeUpdate(Size currentSize) return (false, size); } - var desiredBounds = VisualElementRenderer.Element.Measure(bounds.Width, double.PositiveInfinity, + var desiredBounds = VisualElementRenderer.Element.Measure(bounds.Width, double.PositiveInfinity, MeasureFlags.IncludeMargins); if (desiredBounds.Request.Height == currentSize.Height) diff --git a/src/Compatibility/Core/src/iOS/Compatibility.iOS.csproj b/src/Compatibility/Core/src/iOS/Compatibility.iOS.csproj index cdf011c063f0..4a710cdc669f 100644 --- a/src/Compatibility/Core/src/iOS/Compatibility.iOS.csproj +++ b/src/Compatibility/Core/src/iOS/Compatibility.iOS.csproj @@ -52,6 +52,10 @@ + + + + @@ -112,18 +116,6 @@ - - Crc64.cs - - - StreamWrapper.cs - - - AppHostBuilderExtensions.cs - - - MauiHandlersCollectionExtensions.cs - @@ -184,7 +176,6 @@ - @@ -282,12 +273,10 @@ - - diff --git a/src/Compatibility/Core/src/iOS/ContextActionCell.cs b/src/Compatibility/Core/src/iOS/ContextActionCell.cs index bf071c59ba3d..ae2507a62b22 100644 --- a/src/Compatibility/Core/src/iOS/ContextActionCell.cs +++ b/src/Compatibility/Core/src/iOS/ContextActionCell.cs @@ -3,8 +3,8 @@ using System.Collections.Specialized; using System.ComponentModel; using Foundation; -using UIKit; using Microsoft.Maui.Controls.Compatibility.Platform.iOS.Resources; +using UIKit; using PointF = CoreGraphics.CGPoint; using RectangleF = CoreGraphics.CGRect; using SizeF = CoreGraphics.CGSize; @@ -130,7 +130,7 @@ public override void RemoveFromSuperview() public void Update(UITableView tableView, Cell cell, UITableViewCell nativeCell) { var parentListView = cell.RealParent as ListView; - var recycling = parentListView != null && + var recycling = parentListView != null && ((parentListView.CachingStrategy & ListViewCachingStrategy.RecycleElement) != 0); if (_cell != cell && recycling) { @@ -182,7 +182,7 @@ public void Update(UITableView tableView, Cell cell, UITableViewCell nativeCell) _scroller = new UIScrollView(new RectangleF(0, 0, width, height)); _scroller.ScrollsToTop = false; _scroller.ShowsHorizontalScrollIndicator = false; - + _scroller.PreservesSuperviewLayoutMargins = true; ContentView.AddSubview(_scroller); @@ -489,7 +489,7 @@ void OnCellPropertyChanged(object sender, PropertyChangedEventArgs e) void OnContextItemsChanged(object sender, NotifyCollectionChangedEventArgs e) { var parentListView = _cell?.RealParent as ListView; - var recycling = parentListView != null && + var recycling = parentListView != null && ((parentListView.CachingStrategy & ListViewCachingStrategy.RecycleElement) != 0); if (recycling) Update(_tableView, _cell, ContentCell); @@ -501,7 +501,7 @@ void OnContextItemsChanged(object sender, NotifyCollectionChangedEventArgs e) void OnMenuItemPropertyChanged(object sender, PropertyChangedEventArgs e) { var parentListView = _cell.RealParent as ListView; - var recycling = parentListView != null && + var recycling = parentListView != null && ((parentListView.CachingStrategy & ListViewCachingStrategy.RecycleElement) != 0); if (recycling) Update(_tableView, _cell, ContentCell); diff --git a/src/Compatibility/Core/src/iOS/ContextScrollViewDelegate.cs b/src/Compatibility/Core/src/iOS/ContextScrollViewDelegate.cs index bc73b8571f9d..a6319d9dfb5f 100644 --- a/src/Compatibility/Core/src/iOS/ContextScrollViewDelegate.cs +++ b/src/Compatibility/Core/src/iOS/ContextScrollViewDelegate.cs @@ -76,7 +76,7 @@ public override void DraggingStarted(UIScrollView scrollView) return; s_scrollViewBeingScrolled = new WeakReference(scrollView); - + if (!IsOpen) SetButtonsShowing(true); @@ -202,8 +202,8 @@ static bool ShouldIgnoreScrolling(UIScrollView scrollView) return false; UIScrollView scrollViewBeingScrolled; - if (!s_scrollViewBeingScrolled.TryGetTarget(out scrollViewBeingScrolled) - || ReferenceEquals(scrollViewBeingScrolled, scrollView) + if (!s_scrollViewBeingScrolled.TryGetTarget(out scrollViewBeingScrolled) + || ReferenceEquals(scrollViewBeingScrolled, scrollView) || !ReferenceEquals(((ContextScrollViewDelegate)scrollViewBeingScrolled.Delegate)?._table, ((ContextScrollViewDelegate)scrollView.Delegate)?._table)) return false; diff --git a/src/Compatibility/Core/src/iOS/Deserializer.cs b/src/Compatibility/Core/src/iOS/Deserializer.cs index 753a800c5885..fd767aa65b03 100644 --- a/src/Compatibility/Core/src/iOS/Deserializer.cs +++ b/src/Compatibility/Core/src/iOS/Deserializer.cs @@ -5,7 +5,6 @@ using System.Runtime.Serialization; using System.Threading.Tasks; using System.Xml; -using Microsoft.Maui.Controls.Compatibility.Internals; using Microsoft.Maui.Controls.Internals; #if __MOBILE__ diff --git a/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs b/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs index fdabe033d587..4a89fc1eb4cf 100644 --- a/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs +++ b/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs @@ -49,7 +49,7 @@ public bool CanHandleSession(UIDropInteraction interaction, IUIDropSession sessi { return true; } - + return false; } @@ -85,8 +85,8 @@ public UIDropProposal SessionDidUpdate(UIDropInteraction interaction, IUIDropSes if (interaction.View is IVisualElementRenderer renderer) { DataPackage package = null; - - if(session.LocalDragSession.Items.Length > 0 && + + if (session.LocalDragSession.Items.Length > 0 && session.LocalDragSession.Items[0].LocalObject is CustomLocalStateData cdi) { package = cdi.DataPackage; @@ -108,9 +108,9 @@ public void PerformDrop(UIDropInteraction interaction, IUIDropSession session) if (session.LocalDragSession == null) return; - if(session.LocalDragSession.Items.Length > 0 && + if (session.LocalDragSession.Items.Length > 0 && session.LocalDragSession.Items[0].LocalObject is CustomLocalStateData cdi && - interaction.View is IVisualElementRenderer renderer && + interaction.View is IVisualElementRenderer renderer && renderer.Element is View view) { HandleDrop(view, cdi.DataPackage); @@ -130,7 +130,7 @@ void SendEventArgs(Action func, View view) foreach (var gesture in gestures) { - if(gesture is TRecognizer recognizer) + if (gesture is TRecognizer recognizer) func(recognizer); } } @@ -189,7 +189,7 @@ public UIDragItem[] HandleDragStarting(View element, IVisualElementRenderer rend returnValue = new UIDragItem[] { dragItem }; } - }, + }, element); return returnValue ?? new UIDragItem[0]; @@ -264,4 +264,3 @@ class CustomLocalStateData : NSObject } #endif - \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/EventTracker.cs b/src/Compatibility/Core/src/iOS/EventTracker.cs index 9371c23ddb9a..db086ac72205 100644 --- a/src/Compatibility/Core/src/iOS/EventTracker.cs +++ b/src/Compatibility/Core/src/iOS/EventTracker.cs @@ -222,7 +222,7 @@ Action CreateChildRecognizerHandler(WeakReference weakEv var recognizers = childGestures?.GetChildGesturesFor(x => x.NumberOfTapsRequired == (int)sender.NumberOfTapsRequired); - if(recognizers == null) + if (recognizers == null) return; var tapGestureRecognizer = ((ChildGestureRecognizer)weakRecognizer.Target).GestureRecognizer as TapGestureRecognizer; @@ -576,7 +576,7 @@ void LoadRecognizers() if (_dragAndDropDelegate != null) { - foreach(var interaction in _renderer.NativeView.Interactions) + foreach (var interaction in _renderer.NativeView.Interactions) { if (interaction is UIDragInteraction uIDrag && uIDrag.Delegate == _dragAndDropDelegate) uIDragInteraction = uIDrag; @@ -607,7 +607,7 @@ void LoadRecognizers() } #if __MOBILE__ - if(Forms.IsiOS11OrNewer && recognizer is DragGestureRecognizer) + if (Forms.IsiOS11OrNewer && recognizer is DragGestureRecognizer) { dragFound = true; _dragAndDropDelegate = _dragAndDropDelegate ?? new DragAndDropDelegate(); diff --git a/src/Compatibility/Core/src/iOS/Extensions/BrushExtensions.shared.cs b/src/Compatibility/Core/src/iOS/Extensions/BrushExtensions.shared.cs deleted file mode 100644 index f59b9fa9017b..000000000000 --- a/src/Compatibility/Core/src/iOS/Extensions/BrushExtensions.shared.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using CoreGraphics; -using Foundation; -using Microsoft.Maui.Graphics; - -#if __MOBILE__ -namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS -#else -namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS -#endif -{ - public partial class BrushExtensions - { - static CGPoint GetRadialGradientBrushEndPoint(Point startPoint, double radius) - { - double x = startPoint.X == 1 ? (startPoint.X - radius) : (startPoint.X + radius); - - if (x < 0) - x = 0; - - if (x > 1) - x = 1; - - double y = startPoint.Y == 1 ? (startPoint.Y - radius) : (startPoint.Y + radius); - - if (y < 0) - y = 0; - - if (y > 1) - y = 1; - - return new CGPoint(x, y); - } - - static NSNumber[] GetCAGradientLayerLocations(List gradientStops) - { - if (gradientStops == null || gradientStops.Count == 0) - return new NSNumber[0]; - - if (gradientStops.Count > 1 && gradientStops.Any(gt => gt.Offset != 0)) - return gradientStops.Select(x => new NSNumber(x.Offset)).ToArray(); - else - { - int itemCount = gradientStops.Count; - int index = 0; - float step = 1.0f / itemCount; - - NSNumber[] locations = new NSNumber[itemCount]; - - foreach (var gradientStop in gradientStops) - { - float location = step * index; - bool setLocation = !gradientStops.Any(gt => gt.Offset > location); - - if (gradientStop.Offset == 0 && setLocation) - locations[index] = new NSNumber(location); - else - locations[index] = new NSNumber(gradientStop.Offset); - - index++; - } - - return locations; - } - } - } -} diff --git a/src/Compatibility/Core/src/iOS/Extensions/DoubleCollectionExtensions.cs b/src/Compatibility/Core/src/iOS/Extensions/DoubleCollectionExtensions.cs index 6d1030bca1db..91d27c3ee0a1 100644 --- a/src/Compatibility/Core/src/iOS/Extensions/DoubleCollectionExtensions.cs +++ b/src/Compatibility/Core/src/iOS/Extensions/DoubleCollectionExtensions.cs @@ -6,22 +6,22 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public static class DoubleCollectionExtensions - { - public static nfloat[] ToArray(this DoubleCollection doubleCollection) - { - if (doubleCollection == null || doubleCollection.Count == 0) - return new nfloat[0]; - else - { + public static class DoubleCollectionExtensions + { + public static nfloat[] ToArray(this DoubleCollection doubleCollection) + { + if (doubleCollection == null || doubleCollection.Count == 0) + return new nfloat[0]; + else + { - nfloat[] array = new nfloat[doubleCollection.Count]; + nfloat[] array = new nfloat[doubleCollection.Count]; - for (int i = 0; i < doubleCollection.Count; i++) - array[i] = (nfloat)doubleCollection[i]; + for (int i = 0; i < doubleCollection.Count; i++) + array[i] = (nfloat)doubleCollection[i]; - return array; - } - } - } + return array; + } + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Extensions/Extensions.cs b/src/Compatibility/Core/src/iOS/Extensions/Extensions.cs index 5592b890d2ae..14d6e906c65b 100644 --- a/src/Compatibility/Core/src/iOS/Extensions/Extensions.cs +++ b/src/Compatibility/Core/src/iOS/Extensions/Extensions.cs @@ -1,8 +1,6 @@ -using Foundation; using System; -using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; using Microsoft.Maui.Controls.Internals; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Extensions/FlowDirectionExtensions.cs b/src/Compatibility/Core/src/iOS/Extensions/FlowDirectionExtensions.cs index e3e8f7176d21..07087417cd1e 100644 --- a/src/Compatibility/Core/src/iOS/Extensions/FlowDirectionExtensions.cs +++ b/src/Compatibility/Core/src/iOS/Extensions/FlowDirectionExtensions.cs @@ -1,5 +1,4 @@ using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Extensions/FontExtensions.cs b/src/Compatibility/Core/src/iOS/Extensions/FontExtensions.cs index fa01b9205ed9..af175a7b3d92 100644 --- a/src/Compatibility/Core/src/iOS/Extensions/FontExtensions.cs +++ b/src/Compatibility/Core/src/iOS/Extensions/FontExtensions.cs @@ -6,10 +6,10 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS public static partial class FontExtensions { public static UIFont ToUIFont(this Font self) - => Forms.FontManager.GetFont(self); + => CompatServiceProvider.FontManager.GetFont(self); internal static UIFont ToUIFont(this IFontElement self) - => Forms.FontManager.GetFont(Font.OfSize(self.FontFamily, self.FontSize).WithAttributes(self.FontAttributes)); + => CompatServiceProvider.FontManager.GetFont(Font.OfSize(self.FontFamily, self.FontSize).WithAttributes(self.FontAttributes)); internal static bool IsDefault(this IFontElement self) => self.FontFamily == null && self.FontSize == Device.GetNamedSize(NamedSize.Default, typeof(Label), true) && self.FontAttributes == FontAttributes.None; diff --git a/src/Compatibility/Core/src/iOS/Extensions/GeometryExtensions.cs b/src/Compatibility/Core/src/iOS/Extensions/GeometryExtensions.cs index 88e62a14153c..75512b9b6139 100644 --- a/src/Compatibility/Core/src/iOS/Extensions/GeometryExtensions.cs +++ b/src/Compatibility/Core/src/iOS/Extensions/GeometryExtensions.cs @@ -11,194 +11,194 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public static class GeometryExtensions - { - public static PathData ToCGPath(this Geometry geometry, Transform renderTransform = null) - { - PathData pathData = new PathData - { - Data = new CGPath() - }; - - CGAffineTransform transform; - - if (renderTransform == null) - transform = CGAffineTransform.MakeIdentity(); - else - transform = renderTransform.ToCGAffineTransform(); - - if (geometry is LineGeometry) - { - LineGeometry lineGeometry = geometry as LineGeometry; - pathData.Data.MoveToPoint(transform, lineGeometry.StartPoint.ToPointF()); - pathData.Data.AddLineToPoint(transform, lineGeometry.EndPoint.ToPointF()); - } - else if (geometry is RectangleGeometry) - { - var rect = (geometry as RectangleGeometry).Rect; - pathData.Data.AddRect(transform, new CGRect(rect.X, rect.Y, rect.Width, rect.Height)); - } - else if (geometry is EllipseGeometry) - { - EllipseGeometry ellipseGeometry = geometry as EllipseGeometry; - - CGRect rect = new CGRect( - ellipseGeometry.Center.X - ellipseGeometry.RadiusX, - ellipseGeometry.Center.Y - ellipseGeometry.RadiusY, - ellipseGeometry.RadiusX * 2, - ellipseGeometry.RadiusY * 2); - - pathData.Data.AddEllipseInRect(transform, rect); - } - else if (geometry is GeometryGroup) - { - GeometryGroup geometryGroup = geometry as GeometryGroup; - - pathData.IsNonzeroFillRule = geometryGroup.FillRule == FillRule.Nonzero; - - foreach (Geometry child in geometryGroup.Children) - { - PathData pathChild = child.ToCGPath(renderTransform); - pathData.Data.AddPath(pathChild.Data); - } - } - else if (geometry is PathGeometry) - { - PathGeometry pathGeometry = geometry as PathGeometry; - - pathData.IsNonzeroFillRule = pathGeometry.FillRule == FillRule.Nonzero; - - foreach (PathFigure pathFigure in pathGeometry.Figures) - { - pathData.Data.MoveToPoint(transform, pathFigure.StartPoint.ToPointF()); - Point lastPoint = pathFigure.StartPoint; - - foreach (PathSegment pathSegment in pathFigure.Segments) - { - // LineSegment - if (pathSegment is LineSegment) - { - LineSegment lineSegment = pathSegment as LineSegment; - - pathData.Data.AddLineToPoint(transform, lineSegment.Point.ToPointF()); - lastPoint = lineSegment.Point; - } - // PolyLineSegment - else if (pathSegment is PolyLineSegment) - { - PolyLineSegment polylineSegment = pathSegment as PolyLineSegment; - PointCollection points = polylineSegment.Points; - - for (int i = 0; i < points.Count; i++) - pathData.Data.AddLineToPoint(transform, points[i].ToPointF()); - - lastPoint = points[points.Count - 1]; - } - - // BezierSegment - if (pathSegment is BezierSegment) - { - BezierSegment bezierSegment = pathSegment as BezierSegment; - - pathData.Data.AddCurveToPoint( - transform, - bezierSegment.Point1.ToPointF(), - bezierSegment.Point2.ToPointF(), - bezierSegment.Point3.ToPointF()); - - lastPoint = bezierSegment.Point3; - } - // PolyBezierSegment - else if (pathSegment is PolyBezierSegment) - { - PolyBezierSegment polyBezierSegment = pathSegment as PolyBezierSegment; - PointCollection points = polyBezierSegment.Points; - - if (points.Count >= 3) - { - for (int i = 0; i < points.Count; i += 3) - { - pathData.Data.AddCurveToPoint( - transform, - points[i].ToPointF(), - points[i + 1].ToPointF(), - points[i + 2].ToPointF()); - } - } - - lastPoint = points[points.Count - 1]; - } - - // QuadraticBezierSegment - if (pathSegment is QuadraticBezierSegment) - { - QuadraticBezierSegment bezierSegment = pathSegment as QuadraticBezierSegment; - - pathData.Data.AddQuadCurveToPoint( - transform, - new nfloat(bezierSegment.Point1.X), - new nfloat(bezierSegment.Point1.Y), - new nfloat(bezierSegment.Point2.X), - new nfloat(bezierSegment.Point2.Y)); - - lastPoint = bezierSegment.Point2; - } - // PolyQuadraticBezierSegment - else if (pathSegment is PolyQuadraticBezierSegment) - { - PolyQuadraticBezierSegment polyBezierSegment = pathSegment as PolyQuadraticBezierSegment; - PointCollection points = polyBezierSegment.Points; - - if (points.Count >= 2) - { - for (int i = 0; i < points.Count; i += 2) - { - pathData.Data.AddQuadCurveToPoint( - transform, - new nfloat(points[i + 0].X), - new nfloat(points[i + 0].Y), - new nfloat(points[i + 1].X), - new nfloat(points[i + 1].Y)); - } - } - - lastPoint = points[points.Count - 1]; - } - // ArcSegment - else if (pathSegment is ArcSegment) - { - ArcSegment arcSegment = pathSegment as ArcSegment; - - List points = new List(); - - GeometryHelper.FlattenArc( - points, - lastPoint, - arcSegment.Point, - arcSegment.Size.Width, - arcSegment.Size.Height, - arcSegment.RotationAngle, - arcSegment.IsLargeArc, - arcSegment.SweepDirection == SweepDirection.CounterClockwise, - 1); - - CGPoint[] cgpoints = new CGPoint[points.Count]; - - for (int i = 0; i < points.Count; i++) - cgpoints[i] = transform.TransformPoint(points[i].ToPointF()); - - pathData.Data.AddLines(cgpoints); - - lastPoint = points.Count > 0 ? points[points.Count - 1] : Point.Zero; - } - } - - if (pathFigure.IsClosed) - pathData.Data.CloseSubpath(); - } - } - - return pathData; - } - } + public static class GeometryExtensions + { + public static PathData ToCGPath(this Geometry geometry, Transform renderTransform = null) + { + PathData pathData = new PathData + { + Data = new CGPath() + }; + + CGAffineTransform transform; + + if (renderTransform == null) + transform = CGAffineTransform.MakeIdentity(); + else + transform = renderTransform.ToCGAffineTransform(); + + if (geometry is LineGeometry) + { + LineGeometry lineGeometry = geometry as LineGeometry; + pathData.Data.MoveToPoint(transform, lineGeometry.StartPoint.ToPointF()); + pathData.Data.AddLineToPoint(transform, lineGeometry.EndPoint.ToPointF()); + } + else if (geometry is RectangleGeometry) + { + var rect = (geometry as RectangleGeometry).Rect; + pathData.Data.AddRect(transform, new CGRect(rect.X, rect.Y, rect.Width, rect.Height)); + } + else if (geometry is EllipseGeometry) + { + EllipseGeometry ellipseGeometry = geometry as EllipseGeometry; + + CGRect rect = new CGRect( + ellipseGeometry.Center.X - ellipseGeometry.RadiusX, + ellipseGeometry.Center.Y - ellipseGeometry.RadiusY, + ellipseGeometry.RadiusX * 2, + ellipseGeometry.RadiusY * 2); + + pathData.Data.AddEllipseInRect(transform, rect); + } + else if (geometry is GeometryGroup) + { + GeometryGroup geometryGroup = geometry as GeometryGroup; + + pathData.IsNonzeroFillRule = geometryGroup.FillRule == FillRule.Nonzero; + + foreach (Geometry child in geometryGroup.Children) + { + PathData pathChild = child.ToCGPath(renderTransform); + pathData.Data.AddPath(pathChild.Data); + } + } + else if (geometry is PathGeometry) + { + PathGeometry pathGeometry = geometry as PathGeometry; + + pathData.IsNonzeroFillRule = pathGeometry.FillRule == FillRule.Nonzero; + + foreach (PathFigure pathFigure in pathGeometry.Figures) + { + pathData.Data.MoveToPoint(transform, pathFigure.StartPoint.ToPointF()); + Point lastPoint = pathFigure.StartPoint; + + foreach (PathSegment pathSegment in pathFigure.Segments) + { + // LineSegment + if (pathSegment is LineSegment) + { + LineSegment lineSegment = pathSegment as LineSegment; + + pathData.Data.AddLineToPoint(transform, lineSegment.Point.ToPointF()); + lastPoint = lineSegment.Point; + } + // PolyLineSegment + else if (pathSegment is PolyLineSegment) + { + PolyLineSegment polylineSegment = pathSegment as PolyLineSegment; + PointCollection points = polylineSegment.Points; + + for (int i = 0; i < points.Count; i++) + pathData.Data.AddLineToPoint(transform, points[i].ToPointF()); + + lastPoint = points[points.Count - 1]; + } + + // BezierSegment + if (pathSegment is BezierSegment) + { + BezierSegment bezierSegment = pathSegment as BezierSegment; + + pathData.Data.AddCurveToPoint( + transform, + bezierSegment.Point1.ToPointF(), + bezierSegment.Point2.ToPointF(), + bezierSegment.Point3.ToPointF()); + + lastPoint = bezierSegment.Point3; + } + // PolyBezierSegment + else if (pathSegment is PolyBezierSegment) + { + PolyBezierSegment polyBezierSegment = pathSegment as PolyBezierSegment; + PointCollection points = polyBezierSegment.Points; + + if (points.Count >= 3) + { + for (int i = 0; i < points.Count; i += 3) + { + pathData.Data.AddCurveToPoint( + transform, + points[i].ToPointF(), + points[i + 1].ToPointF(), + points[i + 2].ToPointF()); + } + } + + lastPoint = points[points.Count - 1]; + } + + // QuadraticBezierSegment + if (pathSegment is QuadraticBezierSegment) + { + QuadraticBezierSegment bezierSegment = pathSegment as QuadraticBezierSegment; + + pathData.Data.AddQuadCurveToPoint( + transform, + new nfloat(bezierSegment.Point1.X), + new nfloat(bezierSegment.Point1.Y), + new nfloat(bezierSegment.Point2.X), + new nfloat(bezierSegment.Point2.Y)); + + lastPoint = bezierSegment.Point2; + } + // PolyQuadraticBezierSegment + else if (pathSegment is PolyQuadraticBezierSegment) + { + PolyQuadraticBezierSegment polyBezierSegment = pathSegment as PolyQuadraticBezierSegment; + PointCollection points = polyBezierSegment.Points; + + if (points.Count >= 2) + { + for (int i = 0; i < points.Count; i += 2) + { + pathData.Data.AddQuadCurveToPoint( + transform, + new nfloat(points[i + 0].X), + new nfloat(points[i + 0].Y), + new nfloat(points[i + 1].X), + new nfloat(points[i + 1].Y)); + } + } + + lastPoint = points[points.Count - 1]; + } + // ArcSegment + else if (pathSegment is ArcSegment) + { + ArcSegment arcSegment = pathSegment as ArcSegment; + + List points = new List(); + + GeometryHelper.FlattenArc( + points, + lastPoint, + arcSegment.Point, + arcSegment.Size.Width, + arcSegment.Size.Height, + arcSegment.RotationAngle, + arcSegment.IsLargeArc, + arcSegment.SweepDirection == SweepDirection.CounterClockwise, + 1); + + CGPoint[] cgpoints = new CGPoint[points.Count]; + + for (int i = 0; i < points.Count; i++) + cgpoints[i] = transform.TransformPoint(points[i].ToPointF()); + + pathData.Data.AddLines(cgpoints); + + lastPoint = points.Count > 0 ? points[points.Count - 1] : Point.Zero; + } + } + + if (pathFigure.IsClosed) + pathData.Data.CloseSubpath(); + } + } + + return pathData; + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Extensions/PointCollectionExtensions.cs b/src/Compatibility/Core/src/iOS/Extensions/PointCollectionExtensions.cs index 5c0012030305..294ca27da656 100644 --- a/src/Compatibility/Core/src/iOS/Extensions/PointCollectionExtensions.cs +++ b/src/Compatibility/Core/src/iOS/Extensions/PointCollectionExtensions.cs @@ -8,25 +8,25 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public static class PointCollectionExtensions - { - public static CGPoint[] ToCGPoints(this PointCollection pointCollection) - { - if (pointCollection == null || pointCollection.Count == 0) - { - return new CGPoint[0]; - } + public static class PointCollectionExtensions + { + public static CGPoint[] ToCGPoints(this PointCollection pointCollection) + { + if (pointCollection == null || pointCollection.Count == 0) + { + return new CGPoint[0]; + } - CGPoint[] points = new CGPoint[pointCollection.Count]; - Point[] array = new Point[pointCollection.Count]; - pointCollection.CopyTo(array, 0); + CGPoint[] points = new CGPoint[pointCollection.Count]; + Point[] array = new Point[pointCollection.Count]; + pointCollection.CopyTo(array, 0); - for (int i = 0; i < array.Length; i++) - { - points[i] = new CGPoint(array[i].X, array[i].Y); - } + for (int i = 0; i < array.Length; i++) + { + points[i] = new CGPoint(array[i].X, array[i].Y); + } - return points; - } - } + return points; + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Extensions/TransformExtensions.cs b/src/Compatibility/Core/src/iOS/Extensions/TransformExtensions.cs index a55ec0ef352a..12a8fa1eafc4 100644 --- a/src/Compatibility/Core/src/iOS/Extensions/TransformExtensions.cs +++ b/src/Compatibility/Core/src/iOS/Extensions/TransformExtensions.cs @@ -8,22 +8,22 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public static class TransformExtensions + public static class TransformExtensions { - public static CGAffineTransform ToCGAffineTransform(this Transform transform) - { - if (transform == null) - return CGAffineTransform.MakeIdentity(); + public static CGAffineTransform ToCGAffineTransform(this Transform transform) + { + if (transform == null) + return CGAffineTransform.MakeIdentity(); - Matrix matrix = transform.Value; + Matrix matrix = transform.Value; - return new CGAffineTransform( + return new CGAffineTransform( new nfloat(matrix.M11), - new nfloat(matrix.M12), - new nfloat(matrix.M21), - new nfloat(matrix.M22), - new nfloat(matrix.OffsetX), - new nfloat(matrix.OffsetY)); - } - } + new nfloat(matrix.M12), + new nfloat(matrix.M21), + new nfloat(matrix.M22), + new nfloat(matrix.OffsetX), + new nfloat(matrix.OffsetY)); + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Forms.cs b/src/Compatibility/Core/src/iOS/Forms.cs index d4e8580d6564..c2a2831d8fd1 100644 --- a/src/Compatibility/Core/src/iOS/Forms.cs +++ b/src/Compatibility/Core/src/iOS/Forms.cs @@ -39,11 +39,6 @@ public static class Forms public static bool IsInitialized { get; private set; } - static IFontManager s_fontManager; - - internal static IFontManager FontManager => - s_fontManager ??= new FontManager(Microsoft.Maui.Controls.Internals.Registrar.FontRegistrar); - #if __MOBILE__ static bool? s_isiOS9OrNewer; static bool? s_isiOS10OrNewer; @@ -202,7 +197,7 @@ static void SetupInit(IMauiContext context, InitializationOptions? maybeOptions // Only need to do this once Log.Listeners.Add(new DelegateLogListener((c, m) => Trace.WriteLine(m, c))); } - + #if __MOBILE__ Device.SetIdiom(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? TargetIdiom.Tablet : TargetIdiom.Phone); Device.SetFlowDirection(UIApplication.SharedApplication.UserInterfaceLayoutDirection.ToFlowDirection()); diff --git a/src/Compatibility/Core/src/iOS/HandlerToRendererShim.cs b/src/Compatibility/Core/src/iOS/HandlerToRendererShim.cs index fe554306502f..a50d9551b8a5 100644 --- a/src/Compatibility/Core/src/iOS/HandlerToRendererShim.cs +++ b/src/Compatibility/Core/src/iOS/HandlerToRendererShim.cs @@ -1,9 +1,8 @@ using System; using System.ComponentModel; -using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Graphics; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -55,7 +54,7 @@ public void SetElement(VisualElement element) void OnBatchCommitted(object sender, EventArg e) { - ViewHandler?.SetFrame(Element.Bounds); + ViewHandler?.NativeArrange(Element.Bounds); } void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) diff --git a/src/Compatibility/Core/src/iOS/IOSDeviceInfo.cs b/src/Compatibility/Core/src/iOS/IOSDeviceInfo.cs index eb69c7c298bd..9f23772723c9 100644 --- a/src/Compatibility/Core/src/iOS/IOSDeviceInfo.cs +++ b/src/Compatibility/Core/src/iOS/IOSDeviceInfo.cs @@ -1,10 +1,8 @@ using System; - using Foundation; -using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Graphics; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/LinkerSafeAttribute.cs b/src/Compatibility/Core/src/iOS/LinkerSafeAttribute.cs deleted file mode 100644 index dcddc14a6a09..000000000000 --- a/src/Compatibility/Core/src/iOS/LinkerSafeAttribute.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.ComponentModel; - -namespace Microsoft.Maui.Controls.Compatibility.Internals -{ - [AttributeUsage(AttributeTargets.All)] - [EditorBrowsable(EditorBrowsableState.Never)] - class LinkerSafeAttribute : Attribute - { - public LinkerSafeAttribute() - { - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/ModalWrapper.cs b/src/Compatibility/Core/src/iOS/ModalWrapper.cs index 74a168ae4ef4..daf3b19c96b1 100644 --- a/src/Compatibility/Core/src/iOS/ModalWrapper.cs +++ b/src/Compatibility/Core/src/iOS/ModalWrapper.cs @@ -1,11 +1,11 @@ using System; +using System.ComponentModel; using System.Linq; -using UIKit; -using Foundation; using System.Threading.Tasks; -using System.ComponentModel; +using Foundation; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using Microsoft.Maui.Graphics; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/NativeBindingService.cs b/src/Compatibility/Core/src/iOS/NativeBindingService.cs index 9e497e34b427..f51ced5b5582 100644 --- a/src/Compatibility/Core/src/iOS/NativeBindingService.cs +++ b/src/Compatibility/Core/src/iOS/NativeBindingService.cs @@ -1,8 +1,6 @@ -using System; -using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; -using Microsoft.Maui.Controls.Xaml.Internals; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml.Internals; +using UIKit; [assembly: Microsoft.Maui.Controls.Dependency(typeof(Microsoft.Maui.Controls.Compatibility.Platform.iOS.NativeBindingService))] diff --git a/src/Compatibility/Core/src/iOS/NativeValueConverterService.cs b/src/Compatibility/Core/src/iOS/NativeValueConverterService.cs index 9f014f42ecd3..b8d67fde9554 100644 --- a/src/Compatibility/Core/src/iOS/NativeValueConverterService.cs +++ b/src/Compatibility/Core/src/iOS/NativeValueConverterService.cs @@ -1,5 +1,4 @@ using System; -using Microsoft.Maui.Controls.Compatibility.Internals; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Controls.Xaml.Internals; #if __MOBILE__ diff --git a/src/Compatibility/Core/src/iOS/Platform.cs b/src/Compatibility/Core/src/iOS/Platform.cs index cbc048b7243c..6b4e33cd8ebf 100644 --- a/src/Compatibility/Core/src/iOS/Platform.cs +++ b/src/Compatibility/Core/src/iOS/Platform.cs @@ -4,13 +4,13 @@ using System.Threading.Tasks; using CoreGraphics; using Foundation; -using UIKit; -using IOPath = System.IO.Path; -using CGRect = CoreGraphics.CGRect; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using Microsoft.Maui.Graphics; using Microsoft.Maui.Platform.iOS; +using UIKit; +using CGRect = CoreGraphics.CGRect; +using IOPath = System.IO.Path; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Properties/AssemblyInfo.cs b/src/Compatibility/Core/src/iOS/Properties/AssemblyInfo.cs index cd830a1c9ba2..ed43db832d90 100644 --- a/src/Compatibility/Core/src/iOS/Properties/AssemblyInfo.cs +++ b/src/Compatibility/Core/src/iOS/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ +using System.Reflection; using System.Runtime.CompilerServices; +using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Compatibility; -using Microsoft.Maui.Controls.Compatibility.Internals; using Microsoft.Maui.Controls.Compatibility.Platform.iOS; -using UIKit; using Microsoft.Maui.Controls.Shapes; -using Microsoft.Maui.Controls; +using UIKit; [assembly: ExportRenderer(typeof(BoxView), typeof(BoxRenderer))] [assembly: ExportRenderer(typeof(Entry), typeof(EntryRenderer))] @@ -27,11 +27,11 @@ [assembly: ExportRenderer(typeof(ActivityIndicator), typeof(ActivityIndicatorRenderer))] [assembly: ExportRenderer(typeof(Frame), typeof(FrameRenderer))] [assembly: ExportRenderer(typeof(ListView), typeof(ListViewRenderer))] -[assembly: ExportRenderer (typeof (CollectionView), typeof (CollectionViewRenderer))] +[assembly: ExportRenderer(typeof(CollectionView), typeof(CollectionViewRenderer))] [assembly: ExportRenderer(typeof(CarouselView), typeof(CarouselViewRenderer))] [assembly: ExportRenderer(typeof(IndicatorView), typeof(IndicatorViewRenderer))] [assembly: ExportRenderer(typeof(OpenGLView), typeof(OpenGLViewRenderer))] -[assembly: ExportRenderer (typeof (CheckBox), typeof (CheckBoxRenderer))] +[assembly: ExportRenderer(typeof(CheckBox), typeof(CheckBoxRenderer))] [assembly: ExportRenderer(typeof(Path), typeof(PathRenderer))] [assembly: ExportRenderer(typeof(Ellipse), typeof(EllipseRenderer))] [assembly: ExportRenderer(typeof(Line), typeof(LineRenderer))] @@ -74,4 +74,4 @@ [assembly: Microsoft.Maui.Controls.Dependency(typeof(Deserializer))] [assembly: Microsoft.Maui.Controls.Dependency(typeof(ResourcesProvider))] [assembly: ResolutionGroupName("Xamarin")] -[assembly: LinkerSafe] \ No newline at end of file +[assembly: AssemblyMetadata("IsTrimmable", "True")] \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/RendererPool.cs b/src/Compatibility/Core/src/iOS/RendererPool.cs index a40f5b9f2bea..7dd2f0e9e48c 100644 --- a/src/Compatibility/Core/src/iOS/RendererPool.cs +++ b/src/Compatibility/Core/src/iOS/RendererPool.cs @@ -110,10 +110,13 @@ void FillChildrenWithRenderers(VisualElement element) var child = logicalChild as VisualElement; if (child != null) { - if (CompressedLayout.GetIsHeadless(child)) { + if (CompressedLayout.GetIsHeadless(child)) + { child.IsPlatformEnabled = true; FillChildrenWithRenderers(child); - } else { + } + else + { var renderer = GetFreeRenderer(child) ?? Platform.CreateRenderer(child); Platform.SetRenderer(child, renderer); _parent.NativeView.AddSubview(renderer.NativeView); diff --git a/src/Compatibility/Core/src/iOS/RendererToHandlerShim.cs b/src/Compatibility/Core/src/iOS/RendererToHandlerShim.cs index 886899c0c6f2..23a38b19a0f9 100644 --- a/src/Compatibility/Core/src/iOS/RendererToHandlerShim.cs +++ b/src/Compatibility/Core/src/iOS/RendererToHandlerShim.cs @@ -1,8 +1,7 @@ using System; -using ViewHandler = Microsoft.Maui.Handlers.ViewHandler; -using UIKit; using Microsoft.Maui.Controls.Compatibility.Platform.iOS; -using Microsoft.Maui.Handlers; +using UIKit; +using ViewHandler = Microsoft.Maui.Handlers.ViewHandler; namespace Microsoft.Maui.Controls.Compatibility { @@ -21,7 +20,7 @@ public static IViewHandler CreateShim(object renderer) return new RendererToHandlerShim(); } - public RendererToHandlerShim() : base(Handlers.ViewHandler.ViewMapper) + public RendererToHandlerShim() : base(ViewHandler.ViewMapper) { } @@ -111,7 +110,7 @@ public override void UpdateValue(string property) base.UpdateValue(property); if (property == "Frame") { - SetFrame(VisualElementRenderer.Element.Bounds); + NativeArrange(VisualElementRenderer.Element.Bounds); } } } diff --git a/src/Compatibility/Core/src/iOS/Renderers/ActivityIndicatorRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ActivityIndicatorRenderer.cs index 6542957689b2..9a988c6786ef 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ActivityIndicatorRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ActivityIndicatorRenderer.cs @@ -1,38 +1,38 @@ -using CoreGraphics; -using System.ComponentModel; +using System.ComponentModel; using System.Drawing; +using CoreGraphics; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { [PortHandler] public sealed class UIActivityIndicatorViewDelegate : UIActivityIndicatorView - { - ActivityIndicator _element; - public UIActivityIndicatorViewDelegate(RectangleF point, ActivityIndicator element) : base(point) - => _element = element; + { + ActivityIndicator _element; + public UIActivityIndicatorViewDelegate(RectangleF point, ActivityIndicator element) : base(point) + => _element = element; - public override void Draw(CGRect rect) - { - base.Draw(rect); - if (_element?.IsRunning == true) - StartAnimating(); - } + public override void Draw(CGRect rect) + { + base.Draw(rect); + if (_element?.IsRunning == true) + StartAnimating(); + } + + public override void LayoutSubviews() + { + base.LayoutSubviews(); + if (_element?.IsRunning == true) + StartAnimating(); + } - public override void LayoutSubviews() - { - base.LayoutSubviews(); - if (_element?.IsRunning == true) - StartAnimating(); - } + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + _element = null; + } + } - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - _element = null; - } - } - public class ActivityIndicatorRenderer : ViewRenderer { [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] @@ -48,7 +48,7 @@ protected override void OnElementChanged(ElementChangedEventArgs UILineBreakMode.Clip, LineBreakMode.WordWrap => UILineBreakMode.WordWrap, LineBreakMode.CharacterWrap => UILineBreakMode.CharacterWrap, diff --git a/src/Compatibility/Core/src/iOS/Renderers/ButtonRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ButtonRenderer.cs index 5b7fca4f4397..326f568cfdfb 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ButtonRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ButtonRenderer.cs @@ -1,10 +1,11 @@ using System; using System.ComponentModel; using System.Diagnostics; +using CoreGraphics; +using Microsoft.Maui.Controls.Platform; using UIKit; -using SizeF = CoreGraphics.CGSize; using PreserveAttribute = Foundation.PreserveAttribute; -using CoreGraphics; +using SizeF = CoreGraphics.CGSize; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Renderers/CarouselPageRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/CarouselPageRenderer.cs index a5a7d8208cd0..b1690e87e807 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/CarouselPageRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/CarouselPageRenderer.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; +using Microsoft.Maui.Graphics; using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; using PointF = CoreGraphics.CGPoint; using RectangleF = CoreGraphics.CGRect; using SizeF = CoreGraphics.CGSize; -using Microsoft.Maui.Controls.Internals; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -271,7 +271,7 @@ void OnDecelerationEnded(object sender, EventArgs eventArgs) { if (_ignoreNativeScrolling || SelectedIndex >= ElementController.LogicalChildren.Count) return; - + var currentPage = (ContentPage)ElementController.LogicalChildren[SelectedIndex]; if (_previousPage != currentPage) { diff --git a/src/Compatibility/Core/src/iOS/Renderers/CheckBoxRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/CheckBoxRenderer.cs index 5774f01a2d13..7c6d2bd813fa 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/CheckBoxRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/CheckBoxRenderer.cs @@ -11,10 +11,10 @@ public CheckBoxRenderer() } - protected override FormsCheckBox CreateNativeControl() - { - return new FormsCheckBox(); - } + protected override FormsCheckBox CreateNativeControl() + { + return new FormsCheckBox(); + } - } + } } diff --git a/src/Compatibility/Core/src/iOS/Renderers/CheckBoxRendererBase.cs b/src/Compatibility/Core/src/iOS/Renderers/CheckBoxRendererBase.cs index 682d8ed7be57..ae3e9561ccbe 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/CheckBoxRendererBase.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/CheckBoxRendererBase.cs @@ -89,7 +89,7 @@ protected override void Dispose(bool disposing) return; _disposed = true; - + if (disposing && Control != null) { Control.CheckedChanged -= OnControlCheckedChanged; diff --git a/src/Compatibility/Core/src/iOS/Renderers/EditorRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/EditorRenderer.cs index 8f20416ac133..453e2689ac33 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/EditorRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/EditorRenderer.cs @@ -2,9 +2,9 @@ using System.ComponentModel; using CoreGraphics; using Foundation; +using Microsoft.Maui.Graphics; using Microsoft.Maui.Platform.iOS; using UIKit; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -77,12 +77,12 @@ protected internal override void UpdateCharacterSpacing() { var textAttr = TextView.AttributedText.WithCharacterSpacing(Element.CharacterSpacing); - if(textAttr != null) + if (textAttr != null) TextView.AttributedText = textAttr; var placeHolder = _placeholderLabel.AttributedText.WithCharacterSpacing(Element.CharacterSpacing); - if(placeHolder != null) + if (placeHolder != null) _placeholderLabel.AttributedText = placeHolder; } @@ -152,7 +152,7 @@ protected override void Dispose(bool disposing) TextView.Started -= OnStarted; TextView.Ended -= OnEnded; TextView.ShouldChangeText -= ShouldChangeText; - if(Control is IFormsUITextView formsUITextView) + if (Control is IFormsUITextView formsUITextView) formsUITextView.FrameChanged -= OnFrameChanged; } } @@ -278,6 +278,7 @@ private void OnFrameChanged(object sender, EventArgs e) } } + [PortHandler("Missing to port the code related with Focus")] void OnEnded(object sender, EventArgs eventArgs) { if (TextView.Text != Element.Text) diff --git a/src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs index d16418ef7e42..4a7b23cf9cd7 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs @@ -1,12 +1,12 @@ using System; using System.ComponentModel; -using Microsoft.Maui.Graphics; using CoreGraphics; using Foundation; -using UIKit; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; -using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Entry; +using Microsoft.Maui.Graphics; using Microsoft.Maui.Platform.iOS; +using UIKit; +using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Entry; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -244,6 +244,7 @@ void OnEditingEnded(object sender, EventArgs e) ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); } + [PortHandler("Still pending the code related to Focus.")] protected virtual bool OnShouldReturn(UITextField view) { Control.ResignFirstResponder(); @@ -375,7 +376,7 @@ void UpdateText() Control.Text = text; } - [PortHandler ("Partially ported ...")] + [PortHandler("Partially ported ...")] void UpdateCharacterSpacing() { var textAttr = Control.AttributedText.WithCharacterSpacing(Element.CharacterSpacing); diff --git a/src/Compatibility/Core/src/iOS/Renderers/FormsCheckBox.cs b/src/Compatibility/Core/src/iOS/Renderers/FormsCheckBox.cs index 0029380fe0ee..4033d43b9da5 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/FormsCheckBox.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/FormsCheckBox.cs @@ -14,7 +14,7 @@ public class FormsCheckBox : UIButton // all these values were chosen to just match the android drawables that are used const float _defaultSize = 18.0f; const float _lineWidth = 2.0f; - Color _tintColor; + Color _tintColor; bool _isChecked; bool _isEnabled; float _minimumViewSize; @@ -124,7 +124,7 @@ public override bool Enabled bool changed = base.Enabled != value; base.Enabled = value; - if(changed) + if (changed) UpdateDisplay(); } } @@ -235,7 +235,7 @@ protected override void Dispose(bool disposing) return; _disposed = true; - if(disposing) + if (disposing) TouchUpInside -= OnTouchUpInside; base.Dispose(disposing); diff --git a/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs index 1506b02b8e99..ede72b4d6292 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using System.Drawing; using CoreGraphics; +using Microsoft.Maui.Controls.Platform; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -61,7 +62,7 @@ public override void TraitCollectionDidChange(UITraitCollection previousTraitCol } public virtual void SetupLayer() - { + { if (_actualView == null) return; @@ -184,7 +185,7 @@ public override void RemoveFromSuperview() public override bool PointInside(CGPoint point, UIEvent uievent) { - foreach(var view in Subviews) + foreach (var view in Subviews) { if (view.HitTest(ConvertPointToView(point, view), uievent) != null) return true; diff --git a/src/Compatibility/Core/src/iOS/Renderers/IAccessibilityElementsController.cs b/src/Compatibility/Core/src/iOS/Renderers/IAccessibilityElementsController.cs index a05c38ecd6bd..a0765f7641ab 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/IAccessibilityElementsController.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/IAccessibilityElementsController.cs @@ -1,6 +1,6 @@ -using Foundation; using System; using System.Collections.Generic; +using Foundation; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Renderers/IImageVisualElementRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/IImageVisualElementRenderer.cs index f97dcb8aa636..d7a7d85928ba 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/IImageVisualElementRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/IImageVisualElementRenderer.cs @@ -1,6 +1,6 @@ #if __MOBILE__ -using NativeImageView = UIKit.UIImageView; using NativeImage = UIKit.UIImage; +using NativeImageView = UIKit.UIImageView; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS #else using NativeImageView = AppKit.NSImageView; diff --git a/src/Compatibility/Core/src/iOS/Renderers/IShellFlyoutTransition.cs b/src/Compatibility/Core/src/iOS/Renderers/IShellFlyoutTransition.cs index 42c6936b85be..ade25410baad 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/IShellFlyoutTransition.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/IShellFlyoutTransition.cs @@ -1,5 +1,5 @@ -using CoreGraphics; using System; +using CoreGraphics; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS diff --git a/src/Compatibility/Core/src/iOS/Renderers/ImageAnimationHelper.cs b/src/Compatibility/Core/src/iOS/Renderers/ImageAnimationHelper.cs index e1cfcaa92b75..c8309ab15681 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ImageAnimationHelper.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ImageAnimationHelper.cs @@ -208,9 +208,9 @@ static public FormsCAKeyFrameAnimation CreateAnimationFromCGImageSource(CGImageS { FormsCAKeyFrameAnimation animation = null; - if (imageSource?.Uri != null) + if (imageSource is IStreamImageSource streamImageSource) { - using (var streamImage = await imageSource.GetStreamAsync(cancelationToken).ConfigureAwait(false)) + using (var streamImage = await streamImageSource.GetStreamAsync(cancelationToken).ConfigureAwait(false)) { if (streamImage != null) { diff --git a/src/Compatibility/Core/src/iOS/Renderers/ImageButtonRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ImageButtonRenderer.cs index b553a5c43854..30eeacdef164 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ImageButtonRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ImageButtonRenderer.cs @@ -4,8 +4,8 @@ using System.Linq; using System.Threading.Tasks; using Foundation; -using UIKit; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; +using UIKit; using SizeF = CoreGraphics.CGSize; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -114,7 +114,7 @@ async Task UpdateImage() } protected override UIButton CreateNativeControl() - { + { return new UIButton(UIButtonType.System); } diff --git a/src/Compatibility/Core/src/iOS/Renderers/ImageElementManager.cs b/src/Compatibility/Core/src/iOS/Renderers/ImageElementManager.cs index e1b166699ee1..4e744711ffd6 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ImageElementManager.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ImageElementManager.cs @@ -3,7 +3,6 @@ using System.Threading; using System.Threading.Tasks; using Foundation; -using Microsoft.Maui.Controls.Compatibility.Internals; using CoreAnimation; #if __MOBILE__ diff --git a/src/Compatibility/Core/src/iOS/Renderers/ImageRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ImageRenderer.cs index f50cdd3b3348..b034dec753d6 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ImageRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ImageRenderer.cs @@ -4,31 +4,13 @@ using System.Threading; using System.Threading.Tasks; using Foundation; +using Microsoft.Maui.Graphics; using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; -using RectangleF = CoreGraphics.CGRect; using PreserveAttribute = Foundation.PreserveAttribute; -using Microsoft.Maui.Graphics; +using RectangleF = CoreGraphics.CGRect; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { - public static class ImageExtensions - { - public static UIViewContentMode ToUIViewContentMode(this Aspect aspect) - { - switch (aspect) - { - case Aspect.AspectFill: - return UIViewContentMode.ScaleAspectFill; - case Aspect.Fill: - return UIViewContentMode.ScaleToFill; - case Aspect.AspectFit: - default: - return UIViewContentMode.ScaleAspectFit; - } - } - } - public class ImageRenderer : ViewRenderer, IImageVisualElementRenderer { bool _isDisposed; @@ -214,19 +196,19 @@ public ImageLoaderSourceHandler() public async Task LoadImageAsync(ImageSource imagesource, CancellationToken cancelationToken = default(CancellationToken), float scale = 1f) { UIImage image = null; - var imageLoader = imagesource as UriImageSource; - if (imageLoader?.Uri != null) + + if (imagesource is IStreamImageSource imageLoader) { - using (var streamImage = await imageLoader.GetStreamAsync(cancelationToken).ConfigureAwait(false)) + using var streamImage = await imageLoader.GetStreamAsync(cancelationToken).ConfigureAwait(false); + if (streamImage != null) { - if (streamImage != null) - image = UIImage.LoadFromData(NSData.FromStream(streamImage), scale); - } - } + image = UIImage.LoadFromData(NSData.FromStream(streamImage), scale); - if (image == null) - { - Controls.Internals.Log.Warning(nameof(ImageLoaderSourceHandler), "Could not load image: {0}", imageLoader); + if (image == null) + { + Controls.Internals.Log.Warning(nameof(ImageLoaderSourceHandler), "Could not load image: {0}", imageLoader); + } + } } return image; @@ -267,7 +249,7 @@ public Task LoadImageAsync( var iconcolor = fontsource.Color ?? _defaultColor; var attString = new NSAttributedString(fontsource.Glyph, font: font, foregroundColor: iconcolor.ToUIColor()); var imagesize = ((NSString)fontsource.Glyph).GetSizeUsingAttributes(attString.GetUIKitAttributes(0, out _)); - + UIGraphics.BeginImageContextWithOptions(imagesize, false, 0f); var ctx = new NSStringDrawingContext(); var boundingRect = attString.GetBoundingRect(imagesize, (NSStringDrawingOptions)0, ctx); diff --git a/src/Compatibility/Core/src/iOS/Renderers/KeyboardInsetTracker.cs b/src/Compatibility/Core/src/iOS/Renderers/KeyboardInsetTracker.cs index 8e008095d5bd..e1fc08701729 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/KeyboardInsetTracker.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/KeyboardInsetTracker.cs @@ -17,7 +17,7 @@ internal class KeyboardInsetTracker : IDisposable ShellScrollViewTracker _shellScrollViewTracker; - public KeyboardInsetTracker(UIScrollView targetView, Func fetchWindow, Action setInsetAction) + public KeyboardInsetTracker(UIScrollView targetView, Func fetchWindow, Action setInsetAction) : this(targetView, fetchWindow, setInsetAction, null) { } @@ -100,8 +100,8 @@ internal void UpdateInsets() void OnKeyboardHidden(object sender, UIKeyboardEventArgs args) { - if(_shellScrollViewTracker == null || !_shellScrollViewTracker.Reset()) - _setInsetAction(new UIEdgeInsets(0,0,0,0)); + if (_shellScrollViewTracker == null || !_shellScrollViewTracker.Reset()) + _setInsetAction(new UIEdgeInsets(0, 0, 0, 0)); _lastKeyboardRect = RectangleF.Empty; } diff --git a/src/Compatibility/Core/src/iOS/Renderers/LabelRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/LabelRenderer.cs index 74f255412553..e16299fca1f2 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/LabelRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/LabelRenderer.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using Microsoft.Maui.Graphics; using Microsoft.Maui.Platform.iOS; +using Microsoft.Maui.Controls.Platform; #if __MOBILE__ using UIKit; @@ -589,7 +590,7 @@ void UpdateTextColor() // default value of color documented to be black in iOS docs #if __MOBILE__ - Control.TextColor = textColor.ToUIColor(ColorExtensions.LabelColor); + Control.TextColor = textColor.ToUIColor(ColorExtensions.LabelColor); #else var alignment = Element.HorizontalTextAlignment.ToNativeTextAlignment(((IVisualElementController)Element).EffectiveFlowDirection); var textWithColor = new NSAttributedString(Element.Text ?? "", font: Element.ToNSFont(), foregroundColor: textColor.ToNSColor(ColorExtensions.TextColor), paragraphStyle: new NSMutableParagraphStyle() { Alignment = alignment }); diff --git a/src/Compatibility/Core/src/iOS/Renderers/ListViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ListViewRenderer.cs index a392a4dab571..506f3519f437 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ListViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ListViewRenderer.cs @@ -5,13 +5,14 @@ using System.ComponentModel; using System.Linq; using Foundation; -using UIKit; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; +using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; +using Microsoft.Maui.Graphics; +using UIKit; using RectangleF = CoreGraphics.CGRect; using SizeF = CoreGraphics.CGSize; -using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.ListView; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -293,7 +294,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e) UpdateRowHeight(); Control.Source = _dataSource = e.NewElement.HasUnevenRows ? new UnevenListViewDataSource(e.NewElement, _tableViewController) : new ListViewDataSource(e.NewElement, _tableViewController); - + UpdateHeader(); UpdateFooter(); UpdatePullToRefreshEnabled(); @@ -1515,7 +1516,8 @@ public HeaderWrapperView(string reuseIdentifier) : base((NSString)reuseIdentifie public void SetTableViewCell(UITableViewCell value) { - if (ReferenceEquals(_tableViewCell, value)) return; + if (ReferenceEquals(_tableViewCell, value)) + return; _tableViewCell?.RemoveFromSuperview(); _tableViewCell = value; AddSubview(value); @@ -1576,7 +1578,7 @@ public void UpdateIsRefreshing(bool refreshing) if (_refresh == null || _disposed) return; - if( _isStartRefreshingPending) + if (_isStartRefreshingPending) StartRefreshing(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs index bcb265ec0518..19c00188b7ea 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs @@ -4,17 +4,17 @@ using System.Linq; using System.Threading.Tasks; using CoreGraphics; -using UIKit; -using Microsoft.Maui.Controls.Compatibility.Internals; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; +using Microsoft.Maui.Graphics; +using UIKit; using static Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.NavigationPage; using static Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page; using PageUIStatusBarAnimation = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIStatusBarAnimation; using PointF = CoreGraphics.CGPoint; using RectangleF = CoreGraphics.CGRect; using SizeF = CoreGraphics.CGSize; -using Microsoft.Maui.Controls.Internals; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -215,18 +215,18 @@ public override void ViewDidLoad() FindParentFlyoutPage(); var navPage = NavPage; - + INavigationPageController navPageController = NavPage; if (navPage.CurrentPage == null) { throw new InvalidOperationException( "NavigationPage must have a root Page before being used. Either call PushAsync with a valid Page, or pass a Page to the constructor before usage."); } - navPage.PushRequested += OnPushRequested; - navPage.PopRequested += OnPopRequested; - navPage.PopToRootRequested += OnPopToRootRequested; - navPage.RemovePageRequested += OnRemovedPageRequested; - navPage.InsertPageBeforeRequested += OnInsertPageBeforeRequested; + navPageController.PushRequested += OnPushRequested; + navPageController.PopRequested += OnPopRequested; + navPageController.PopToRootRequested += OnPopToRootRequested; + navPageController.RemovePageRequested += OnRemovedPageRequested; + navPageController.InsertPageBeforeRequested += OnInsertPageBeforeRequested; UpdateBarBackground(); UpdateBarTextColor(); @@ -275,13 +275,14 @@ protected override void Dispose(bool disposing) Current = null; // unhooks events var navPage = NavPage; + INavigationPageController navPageController = NavPage; navPage.PropertyChanged -= HandlePropertyChanged; - navPage.PushRequested -= OnPushRequested; - navPage.PopRequested -= OnPopRequested; - navPage.PopToRootRequested -= OnPopToRootRequested; - navPage.RemovePageRequested -= OnRemovedPageRequested; - navPage.InsertPageBeforeRequested -= OnInsertPageBeforeRequested; + navPageController.PushRequested -= OnPushRequested; + navPageController.PopRequested -= OnPopRequested; + navPageController.PopToRootRequested -= OnPopToRootRequested; + navPageController.RemovePageRequested -= OnRemovedPageRequested; + navPageController.InsertPageBeforeRequested -= OnInsertPageBeforeRequested; } base.Dispose(disposing); diff --git a/src/Compatibility/Core/src/iOS/Renderers/OpenGLViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/OpenGLViewRenderer.cs index cff874eccf04..f207445d4670 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/OpenGLViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/OpenGLViewRenderer.cs @@ -1,9 +1,9 @@ using System; using System.ComponentModel; +using CoreAnimation; +using Foundation; using GLKit; using OpenGLES; -using Foundation; -using CoreAnimation; using RectangleF = CoreGraphics.CGRect; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS diff --git a/src/Compatibility/Core/src/iOS/Renderers/PageContainer.cs b/src/Compatibility/Core/src/iOS/Renderers/PageContainer.cs index 01f8e52199ab..756f10193a01 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/PageContainer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/PageContainer.cs @@ -1,7 +1,7 @@ -using Foundation; -using ObjCRuntime; using System; using System.Collections.Generic; +using Foundation; +using ObjCRuntime; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -38,12 +38,12 @@ public virtual NSArray AccessibilityElements { if (_loaded) return _accessibilityElements; - + // lazy-loading this list so that the expensive call to GetAccessibilityElements only happens when VoiceOver is on. if (_accessibilityElements == null || _accessibilityElements.Count == 0) { - var elements =_parent.GetAccessibilityElements(); - if(elements != null) + var elements = _parent.GetAccessibilityElements(); + if (elements != null) { _accessibilityElements = NSArray.FromNSObjects(elements.ToArray()); } diff --git a/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs index 39b92f3717ef..f4641bada36f 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs @@ -2,11 +2,12 @@ using System.Collections.Generic; using System.ComponentModel; using Foundation; -using UIKit; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; -using PageUIStatusBarAnimation = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIStatusBarAnimation; -using PageSpecific = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page; using Microsoft.Maui.Graphics; +using UIKit; +using PageSpecific = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page; +using PageUIStatusBarAnimation = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIStatusBarAnimation; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -103,7 +104,7 @@ public UIView NativeView { get { return _disposed ? null : View; } } - + public void SetElement(VisualElement element) { VisualElement oldElement = Element; @@ -282,10 +283,10 @@ void IDisconnectable.Disconnect() if (_appeared) Page.SendDisappearing(); - + Element = null; } - + _events?.Disconnect(); _packager?.Disconnect(); _tracker?.Disconnect(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/PhoneFlyoutPageRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/PhoneFlyoutPageRenderer.cs index fd9841c7ca68..d8017da21032 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/PhoneFlyoutPageRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/PhoneFlyoutPageRenderer.cs @@ -1,11 +1,12 @@ using System; using System.ComponentModel; using System.Linq; -using UIKit; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; -using PointF = CoreGraphics.CGPoint; using Microsoft.Maui.Graphics; +using UIKit; +using PointF = CoreGraphics.CGPoint; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Renderers/PickerRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/PickerRenderer.cs index e2c1c445e0ec..5615e57d375d 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/PickerRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/PickerRenderer.cs @@ -4,12 +4,12 @@ using System.ComponentModel; using CoreGraphics; using Foundation; -using ObjCRuntime; -using UIKit; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; -using RectangleF = CoreGraphics.CGRect; using Microsoft.Maui.Graphics; using Microsoft.Maui.Platform.iOS; +using ObjCRuntime; +using UIKit; +using RectangleF = CoreGraphics.CGRect; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -18,12 +18,13 @@ internal class ReadOnlyField : NoCaretField { readonly HashSet enableActions; - public ReadOnlyField() { + public ReadOnlyField() + { string[] actions = { "copy:", "select:", "selectAll:" }; - enableActions = new HashSet (actions); + enableActions = new HashSet(actions); } - public override bool CanPerform (Selector action, NSObject withSender) + public override bool CanPerform(Selector action, NSObject withSender) => enableActions.Contains(action.Name); } @@ -150,7 +151,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE else if (e.PropertyName == Picker.TextColorProperty.PropertyName || e.PropertyName == VisualElement.IsEnabledProperty.PropertyName) UpdateTextColor(); else if (e.PropertyName == Picker.FontAttributesProperty.PropertyName || e.PropertyName == Picker.FontFamilyProperty.PropertyName || - e.PropertyName == Picker.FontSizeProperty.PropertyName) + e.PropertyName == Picker.FontSizeProperty.PropertyName) { UpdateFont(); } @@ -206,9 +207,9 @@ protected void UpdateCharacterSpacing() } [PortHandler] - protected internal virtual void UpdateFont() + protected internal virtual void UpdateFont() { - Control.Font = Element.ToUIFont(); + Control.Font = Element.ToUIFont(); } readonly Color _defaultPlaceholderColor = ColorExtensions.PlaceholderColor.ToColor(); @@ -236,7 +237,7 @@ protected internal virtual void UpdatePlaceholder() UpdateAttributedPlaceholder(Control.AttributedPlaceholder.WithCharacterSpacing(Element.CharacterSpacing)); } - protected virtual void UpdateAttributedPlaceholder(NSAttributedString nsAttributedString) => + protected virtual void UpdateAttributedPlaceholder(NSAttributedString nsAttributedString) => Control.AttributedPlaceholder = nsAttributedString; [PortHandler] @@ -291,7 +292,7 @@ void UpdateHorizontalTextAlignment() } void UpdateVerticalTextAlignment() { - Control.VerticalAlignment = Element.VerticalTextAlignment.ToNativeTextAlignment(); + Control.VerticalAlignment = Element.VerticalTextAlignment.ToNativeTextAlignment(); } protected internal virtual void UpdateTextColor() @@ -304,8 +305,8 @@ protected internal virtual void UpdateTextColor() Control.TextColor = textColor.ToUIColor(); // HACK This forces the color to update; there's probably a more elegant way to make this happen - Control.Text = Control.Text; - } + Control.Text = Control.Text; + } protected override void Dispose(bool disposing) { @@ -338,7 +339,7 @@ protected override void Dispose(bool disposing) Control.EditingChanged -= OnEditing; } - if(Element != null) + if (Element != null) ((INotifyCollectionChanged)Element.Items).CollectionChanged -= RowsCollectionChanged; } @@ -388,7 +389,7 @@ public override void Selected(UIPickerView picker, nint row, nint component) SelectedIndex = (int)row; } - if(_renderer.Element.On().UpdateMode() == UpdateMode.Immediately) + if (_renderer.Element.On().UpdateMode() == UpdateMode.Immediately) _renderer.UpdatePickerFromModel(this); } diff --git a/src/Compatibility/Core/src/iOS/Renderers/RefreshViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/RefreshViewRenderer.cs index 293f61a4c84c..daccd54d9326 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/RefreshViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/RefreshViewRenderer.cs @@ -1,8 +1,9 @@ using System; using System.ComponentModel; -using UIKit; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using Microsoft.Maui.Graphics; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Renderers/ScrollViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ScrollViewRenderer.cs index 96dbea61ddf0..636cc69b2393 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ScrollViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ScrollViewRenderer.cs @@ -1,12 +1,13 @@ using System; using System.ComponentModel; +using CoreGraphics; using Microsoft.Maui.Controls.Internals; -using UIKit; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; +using Microsoft.Maui.Graphics; +using UIKit; using PointF = CoreGraphics.CGPoint; using RectangleF = CoreGraphics.CGRect; -using CoreGraphics; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -80,7 +81,7 @@ public void SetElement(VisualElement element) _insetTracker = new KeyboardInsetTracker(this, () => Window, insets => { ContentInset = ScrollIndicatorInsets = insets; - }, + }, point => { var offset = ContentOffset; @@ -118,13 +119,13 @@ public UIViewController ViewController { get { return null; } } - + public override void LayoutSubviews() { _insetTracker?.OnLayoutSubviews(); base.LayoutSubviews(); - if(Superview != null && ScrollView != null) + if (Superview != null && ScrollView != null) { if (_requestedScroll != null) { @@ -195,7 +196,7 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - protected virtual void OnElementChanged(VisualElementChangedEventArgs e) => ElementChanged?.Invoke(this, e); + protected virtual void OnElementChanged(VisualElementChangedEventArgs e) => ElementChanged?.Invoke(this, e); void HandlePropertyChanged(object sender, PropertyChangedEventArgs e) { @@ -228,15 +229,15 @@ void UpdateIsEnabled() void UpdateVerticalScrollBarVisibility() { var verticalScrollBarVisibility = ScrollView.VerticalScrollBarVisibility; - ShowsVerticalScrollIndicator = verticalScrollBarVisibility == ScrollBarVisibility.Always - || verticalScrollBarVisibility == ScrollBarVisibility.Default; + ShowsVerticalScrollIndicator = verticalScrollBarVisibility == ScrollBarVisibility.Always + || verticalScrollBarVisibility == ScrollBarVisibility.Default; } void UpdateHorizontalScrollBarVisibility() { var horizontalScrollBarVisibility = ScrollView.HorizontalScrollBarVisibility; ShowsHorizontalScrollIndicator = horizontalScrollBarVisibility == ScrollBarVisibility.Always - || horizontalScrollBarVisibility == ScrollBarVisibility.Default; + || horizontalScrollBarVisibility == ScrollBarVisibility.Default; } void HandleScrollAnimationEnded(object sender, EventArgs e) diff --git a/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs index c2295301649f..fc750b34cf0c 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs @@ -2,10 +2,10 @@ using System.ComponentModel; using CoreGraphics; using Foundation; -using UIKit; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using Microsoft.Maui.Graphics; using Microsoft.Maui.Platform.iOS; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -131,13 +131,13 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE UpdateVerticalTextAlignment(); else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName) UpdateHorizontalTextAlignment(); - else if(e.PropertyName == Microsoft.Maui.Controls.InputView.MaxLengthProperty.PropertyName) + else if (e.PropertyName == Microsoft.Maui.Controls.InputView.MaxLengthProperty.PropertyName) UpdateMaxLength(); - else if(e.PropertyName == Microsoft.Maui.Controls.InputView.KeyboardProperty.PropertyName) + else if (e.PropertyName == Microsoft.Maui.Controls.InputView.KeyboardProperty.PropertyName) UpdateKeyboard(); - else if(e.PropertyName == Microsoft.Maui.Controls.InputView.IsSpellCheckEnabledProperty.PropertyName) + else if (e.PropertyName == Microsoft.Maui.Controls.InputView.IsSpellCheckEnabledProperty.PropertyName) UpdateKeyboard(); - else if(e.PropertyName == PlatformConfiguration.iOSSpecific.SearchBar.SearchBarStyleProperty.PropertyName) + else if (e.PropertyName == PlatformConfiguration.iOSSpecific.SearchBar.SearchBarStyleProperty.PropertyName) UpdateSearchBarStyle(); } @@ -152,7 +152,7 @@ protected override void SetBackgroundColor(Color color) { _defaultTintColor = Control.BarTintColor; } - + Control.BarTintColor = color.ToUIColor(_defaultTintColor); Control.SetBackgroundImage(new UIImage(), UIBarPosition.Any, UIBarMetrics.Default); @@ -322,7 +322,7 @@ void UpdatePlaceholder() // Placeholder default color is 70% gray // https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITextField_Class/index.html#//apple_ref/occ/instp/UITextField/placeholder - var color = Element.IsEnabled && targetColor != null + var color = Element.IsEnabled && targetColor != null ? targetColor : ColorExtensions.PlaceholderColor.ToColor(); _textField.AttributedPlaceholder = formatted.ToAttributed(Element, color); @@ -331,7 +331,7 @@ void UpdatePlaceholder() } else { - _textField.AttributedPlaceholder = formatted.ToAttributed(Element, targetColor == null + _textField.AttributedPlaceholder = formatted.ToAttributed(Element, targetColor == null ? ColorExtensions.PlaceholderColor.ToColor() : targetColor); _textField.AttributedPlaceholder.WithCharacterSpacing(Element.CharacterSpacing); } @@ -348,7 +348,7 @@ void UpdateText() // other changes to Element.Text. if (!_textWasTyped) Control.Text = Element.UpdateFormsText(Element.Text, Element.TextTransform); - + UpdateCancelButton(); } diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutContentRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutContentRenderer.cs index 55446745c3e1..aecd17c16dff 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutContentRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutContentRenderer.cs @@ -1,7 +1,8 @@ -using CoreGraphics; -using Microsoft.Maui.Graphics; using System; using System.ComponentModel; +using CoreGraphics; +using Microsoft.Maui.Controls.Platform; +using Microsoft.Maui.Graphics; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -86,7 +87,7 @@ void UpdateFlyoutHeader() return; int previousIndex = GetPreviousIndex(_headerView); - if(_headerView != null) + if (_headerView != null) { _tableViewController.HeaderView = null; _headerView.RemoveFromSuperview(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutLayoutManager.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutLayoutManager.cs index 58a71fc914b5..1bbebb8c9436 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutLayoutManager.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutLayoutManager.cs @@ -52,7 +52,7 @@ public void SetCustomContent(View content) oldRenderer?.Dispose(); } // If the user hasn't defined custom content then only the ContentView is set - else if(ContentView != null) + else if (ContentView != null) { var oldContentView = ContentView; ContentView = null; @@ -77,7 +77,7 @@ public void SetCustomContent(View content) void ScrollViewScrolled(object sender, ScrolledEventArgs e) => OnScrolled((nfloat)sv.ScrollY); } - else if(Content is CollectionView cv) + else if (Content is CollectionView cv) { cv.Scrolled += CollectionViewScrolled; removeScolledEvent = () => cv.Scrolled -= CollectionViewScrolled; @@ -90,7 +90,7 @@ void CollectionViewScrolled(object sender, ItemsViewScrolledEventArgs e) => removeScolledEvent = () => lv.Scrolled -= ListViewScrolled; void ListViewScrolled(object sender, ScrolledEventArgs e) => OnScrolled((nfloat)e.ScrollY); - } + } } } @@ -253,7 +253,7 @@ public void LayoutParallax() { topMargin = (float)Content.Margin.Top; } - else if(HeaderView == null) + else if (HeaderView == null) { topMargin = (float)Platform.SafeAreaInsetsForWindow.Top; } @@ -273,7 +273,7 @@ public void LayoutParallax() var leftMargin = margin.Left - margin.Right; HeaderView.Frame = new CGRect(leftMargin, _headerOffset, parent.Frame.Width, HeaderSize + HeaderTopMargin); - + if (_context.Shell.FlyoutHeaderBehavior == FlyoutHeaderBehavior.Scroll && HeaderTopMargin > 0 && _headerOffset < 0) { var headerHeight = Math.Max(_headerMin, HeaderSize + _headerOffset + HeaderTopMargin); diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutRenderer.cs index 3abb1a1be8e6..d9e25a258d5c 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellFlyoutRenderer.cs @@ -1,9 +1,10 @@ +using System; +using System.ComponentModel; using CoreAnimation; using CoreGraphics; using Foundation; using MediaPlayer; -using System; -using System.ComponentModel; +using Microsoft.Maui.Controls.Platform; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -25,7 +26,7 @@ void IAppearanceObserver.OnAppearanceChanged(ShellAppearance appearance) if (SlideFlyoutTransition?.UpdateFlyoutSize(appearance.FlyoutHeight, appearance.FlyoutWidth) == true) { - if(_layoutOccured) + if (_layoutOccured) LayoutSidebar(false, true); } } diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellItemRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellItemRenderer.cs index 8b2e77680ff7..3cac32183a83 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellItemRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellItemRenderer.cs @@ -1,13 +1,13 @@ -using CoreGraphics; using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Linq; +using CoreGraphics; using Foundation; +using Microsoft.Maui.Graphics; using ObjCRuntime; using UIKit; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -137,13 +137,13 @@ void IDisconnectable.Disconnect() ((IShellSectionController)_currentSection).RemoveDisplayedPageObserver(this); - if(ShellItem != null) + if (ShellItem != null) ShellItem.PropertyChanged -= OnElementPropertyChanged; - if(_context?.Shell is IShellController shellController) + if (_context?.Shell is IShellController shellController) shellController.RemoveAppearanceObserver(this); - if(ShellItemController != null) + if (ShellItemController != null) ShellItemController.ItemsCollectionChanged -= OnItemsCollectionChanged; } @@ -314,7 +314,7 @@ void UpdateMoreCellsEnabled() // now that they are applied we can set the enabled state of the TabBar items for (int i = 4; i < viewControllersLength; i++) { - if((i - 4) >= (moreNavigationCells.Length)) + if ((i - 4) >= (moreNavigationCells.Length)) { break; } @@ -331,7 +331,7 @@ void UpdateMoreCellsEnabled() cell.TextLabel.TextColor = Color.FromRgb(213, 213, 213).ToUIColor(); } - else if(!cell.UserInteractionEnabled) + else if (!cell.UserInteractionEnabled) { cell.UserInteractionEnabled = true; cell.TextLabel.TextColor = _defaultMoreTextLabelTextColor; @@ -340,7 +340,7 @@ void UpdateMoreCellsEnabled() UITableViewCell[] GetMoreNavigationCells() { - if(MoreNavigationController.TopViewController.View is UITableView uITableView) + if (MoreNavigationController.TopViewController.View is UITableView uITableView) return uITableView.VisibleCells; return new UITableViewCell[0]; diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellPageRendererTracker.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellPageRendererTracker.cs index ebf0f6838038..9f22304a6561 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellPageRendererTracker.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellPageRendererTracker.cs @@ -1,11 +1,11 @@ -using CoreGraphics; -using Foundation; using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Threading.Tasks; using System.Windows.Input; +using CoreGraphics; +using Foundation; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -154,7 +154,7 @@ protected virtual async void OnPageSet(Page oldPage, Page newPage) if (oldPage == null) ((IShellController)_context.Shell).AddFlyoutBehaviorObserver(this); } - else if(newPage == null && _context?.Shell is IShellController shellController) + else if (newPage == null && _context?.Shell is IShellController shellController) { shellController.RemoveFlyoutBehaviorObserver(this); } @@ -249,7 +249,7 @@ async Task UpdateLeftToolbarItems() var command = behavior.GetPropertyIfSet(BackButtonBehavior.CommandProperty, null); UIImage icon = null; - + if (String.IsNullOrWhiteSpace(text) && image == null) { image = _context.Shell.FlyoutIcon; @@ -319,7 +319,7 @@ void LeftBarButtonItemHandler(UIViewController controller, bool isRootPage) else if (controller?.ParentViewController is UINavigationController navigationController) navigationController.PopViewController(true); } - else if(_flyoutBehavior == FlyoutBehavior.Flyout) + else if (_flyoutBehavior == FlyoutBehavior.Flyout) { _context.Shell.SetValueFromRenderer(Shell.FlyoutIsPresentedProperty, true); } diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellRenderer.cs index e288963b548f..0bba227e82c3 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellRenderer.cs @@ -113,7 +113,7 @@ public virtual void SetElementSize(Size size) public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); - if(_currentShellItemRenderer != null) + if (_currentShellItemRenderer != null) _currentShellItemRenderer.ViewController.View.Frame = View.Bounds; SetElementSize(new Size(View.Bounds.Width, View.Bounds.Height)); @@ -129,7 +129,7 @@ public override void ViewDidLoad() protected virtual IShellFlyoutRenderer CreateFlyoutRenderer() { // HACK - if(UIApplication.SharedApplication?.Delegate?.GetType()?.FullName == "XamarinFormsPreviewer.iOS.AppDelegate") + if (UIApplication.SharedApplication?.Delegate?.GetType()?.FullName == "XamarinFormsPreviewer.iOS.AppDelegate") { return new DesignerFlyoutRenderer(this); } @@ -202,7 +202,7 @@ protected virtual async void OnCurrentItemChanged() { await OnCurrentItemChangedAsync(); } - catch(Exception exc) + catch (Exception exc) { Controls.Internals.Log.Warning(nameof(Shell), $"Failed on changing current item: {exc}"); } @@ -234,7 +234,7 @@ protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEv { OnCurrentItemChanged(); } - else if(e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName) + else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName) { UpdateFlowDirection(true); } @@ -283,7 +283,7 @@ protected async Task SetCurrentShellItemControllerAsync(IShellItemRenderer value // This means the selected item changed while the active transition // was finishing up - if(_incomingRenderer != value || + if (_incomingRenderer != value || value.ShellItem != this.Shell.CurrentItem) { (value as IDisconnectable)?.Disconnect(); @@ -302,7 +302,7 @@ protected async Task SetCurrentShellItemControllerAsync(IShellItemRenderer value View.SendSubviewToBack(newRenderer.ViewController.View); newRenderer.ViewController.View.Frame = View.Bounds; - + if (oldRenderer != null) { var transition = CreateShellItemTransition(); @@ -320,7 +320,7 @@ protected async Task SetCurrentShellItemControllerAsync(IShellItemRenderer value } // current renderer is still valid - if(_currentShellItemRenderer == value) + if (_currentShellItemRenderer == value) { UpdateBackgroundColor(); UpdateFlowDirection(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellScrollViewTracker.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellScrollViewTracker.cs index b27aa7c0bf11..0b43b3f3ad29 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellScrollViewTracker.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellScrollViewTracker.cs @@ -72,7 +72,7 @@ public void OnLayoutSubviews() var newBounds = _scrollView.AdjustedContentInset.InsetRect(_scrollView.Bounds).ToRectangle(); newBounds.X = 0; newBounds.Y = 0; - if(_renderer.Element is ScrollView scrollView) + if (_renderer.Element is ScrollView scrollView) scrollView.LayoutAreaOverride = newBounds; } } @@ -154,7 +154,7 @@ void UpdateVerticalBounce() // If we can't bounce in that case you may not be able to expose the handler. // Also the hiding behavior only depends on scroll on iOS 11. In 10 and below // the search goes in the TitleView so there is nothing to collapse/expand. - if (!Forms.IsiOS11OrNewer || + if (!Forms.IsiOS11OrNewer || (_renderer.Element is ScrollView scrollView && scrollView.Orientation == ScrollOrientation.Horizontal)) return; diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellSearchResultsRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellSearchResultsRenderer.cs index 52128a7661d6..c4d990a36fe6 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellSearchResultsRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellSearchResultsRenderer.cs @@ -1,8 +1,8 @@ -using Foundation; using System; using System.Collections.Specialized; -using UIKit; +using Foundation; using Microsoft.Maui.Controls.Internals; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRenderer.cs index 2e84afb1318c..962448441539 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRenderer.cs @@ -5,9 +5,9 @@ using System.Threading.Tasks; using System.Windows.Input; using Foundation; +using Microsoft.Maui.Controls.Internals; using ObjCRuntime; using UIKit; -using Microsoft.Maui.Controls.Internals; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -75,7 +75,7 @@ public ShellSectionRenderer(IShellContext context) : base() _context.Shell.PropertyChanged += HandleShellPropertyChanged; } - public ShellSectionRenderer(IShellContext context, Type navigationBarType, Type toolbarType) + public ShellSectionRenderer(IShellContext context, Type navigationBarType, Type toolbarType) : base(navigationBarType, toolbarType) { Delegate = new NavDelegate(this); @@ -89,7 +89,7 @@ public bool ShouldPopItem(UINavigationBar navigationBar, UINavigationItem item) SendPop(); internal bool SendPop() - { + { // this means the pop is already done, nothing we can do if (ViewControllers.Length < NavigationBar.Items.Length) return true; diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRootHeader.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRootHeader.cs index 5a1eb5a63fd5..334b4f91457a 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRootHeader.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRootHeader.cs @@ -1,9 +1,9 @@ -using CoreGraphics; -using Foundation; -using Microsoft.Maui.Graphics; using System; using System.Collections.Specialized; using System.ComponentModel; +using CoreGraphics; +using Foundation; +using Microsoft.Maui.Graphics; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -116,7 +116,7 @@ public override nint GetItemsCount(UICollectionView collectionView, nint section public override void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath) { - if(CollectionView.CellForItem(indexPath) is ShellSectionHeaderCell cell) + if (CollectionView.CellForItem(indexPath) is ShellSectionHeaderCell cell) cell.Label.TextColor = _unselectedColor.ToUIColor(); } diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRootRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRootRenderer.cs index 82887716dff3..cc394c6fe764 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRootRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellSectionRootRenderer.cs @@ -1,10 +1,10 @@ -using CoreAnimation; -using CoreGraphics; -using Foundation; using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; +using CoreAnimation; +using CoreGraphics; +using Foundation; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -95,7 +95,7 @@ public override void ViewDidLoad() tracker.IsRootPage = true; tracker.ViewController = this; - if(ShellSection.CurrentItem != null) + if (ShellSection.CurrentItem != null) tracker.Page = ((IShellContentController)ShellSection.CurrentItem).GetOrCreateContent(); _tracker = tracker; UpdateFlowDirection(); @@ -106,7 +106,7 @@ public override void ViewWillAppear(bool animated) if (_isDisposed) return; - UpdateFlowDirection(); + UpdateFlowDirection(); base.ViewWillAppear(animated); } @@ -165,7 +165,7 @@ protected override void Dispose(bool disposing) { var oldRenderer = renderer.Value; - if(oldRenderer.NativeView != null) + if (oldRenderer.NativeView != null) oldRenderer.NativeView.RemoveFromSuperview(); if (oldRenderer.ViewController != null) @@ -179,7 +179,7 @@ protected override void Dispose(bool disposing) _renderers.Clear(); } - if(disposing) + if (disposing) { _shellContext.Shell.PropertyChanged -= HandleShellPropertyChanged; } @@ -204,7 +204,7 @@ protected virtual void LayoutRenderers() if (_renderers.TryGetValue(shellContent, out var renderer)) { var view = renderer.NativeView; - if(view != null) + if (view != null) view.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height); } } @@ -235,7 +235,7 @@ protected virtual void LoadRenderers() continue; Page page = null; - if(!createdPages.TryGetValue(item, out page)) + if (!createdPages.TryGetValue(item, out page)) { page = ((IShellContentController)item).GetOrCreateContent(); contentItems = ShellSectionController.GetItems(); @@ -388,7 +388,7 @@ void RemoveNonVisibleRenderers() } } - if(removeMe != null) + if (removeMe != null) { foreach (var remove in removeMe) _renderers.Remove(remove); @@ -437,7 +437,7 @@ protected virtual void UpdateHeaderVisibility() void UpdateFlowDirection() { - if(_shellContext?.Shell?.CurrentItem?.CurrentItem == ShellSection) + if (_shellContext?.Shell?.CurrentItem?.CurrentItem == ShellSection) this.View.UpdateFlowDirection(_shellContext.Shell); } @@ -465,7 +465,7 @@ void OnShellSectionItemsChanged(object sender, NotifyCollectionChangedEventArgs if (e.OldStartingIndex < _currentIndex) _currentIndex--; - + _renderers.Remove(oldItem); oldRenderer.NativeView.RemoveFromSuperview(); oldRenderer.ViewController.RemoveFromParentViewController(); @@ -491,7 +491,7 @@ void OnShellSectionItemsChanged(object sender, NotifyCollectionChangedEventArgs IVisualElementRenderer SetPageRenderer(Page page, ShellContent shellContent) { var oldRenderer = Platform.GetRenderer(page); - if(oldRenderer != null) + if (oldRenderer != null) oldRenderer?.Dispose(); var renderer = Platform.CreateRenderer(page); diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellTableViewController.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellTableViewController.cs index eedabcd8bd6d..65336bd71b0c 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellTableViewController.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellTableViewController.cs @@ -1,9 +1,9 @@ +using System; +using System.Collections.Specialized; +using System.ComponentModel; using CoreAnimation; using CoreGraphics; -using System; using UIKit; -using System.ComponentModel; -using System.Collections.Specialized; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -67,11 +67,11 @@ void OnFlyoutItemsChanged(object sender, EventArgs e) ShellFlyoutContentManager.UpdateVerticalScrollMode(); } - public void LayoutParallax() => + public void LayoutParallax() => ShellFlyoutContentManager.LayoutParallax(); public override void ViewDidLoad() - { + { base.ViewDidLoad(); TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; diff --git a/src/Compatibility/Core/src/iOS/Renderers/ShellTableViewSource.cs b/src/Compatibility/Core/src/iOS/Renderers/ShellTableViewSource.cs index b0e3eca5e11d..abf6023a4820 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ShellTableViewSource.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ShellTableViewSource.cs @@ -1,8 +1,8 @@ -using Foundation; using System; using System.Collections.Generic; -using UIKit; +using Foundation; using Microsoft.Maui.Controls.Internals; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -66,10 +66,10 @@ internal void ReSyncCache() foreach (var group in newGroups) { - foreach(var element in group) + foreach (var element in group) { UIContainerCell result; - if(oldList.TryGetValue(element, out result)) + if (oldList.TryGetValue(element, out result)) { _cells.Add(element, result); oldList.Remove(element); @@ -86,7 +86,7 @@ public void ClearCache() { var newGroups = ((IShellController)_context.Shell).GenerateFlyoutGrouping(); - if(newGroups != _groups) + if (newGroups != _groups) { _groups = newGroups; if (_cells != null) diff --git a/src/Compatibility/Core/src/iOS/Renderers/SlideFlyoutTransition.cs b/src/Compatibility/Core/src/iOS/Renderers/SlideFlyoutTransition.cs index afb42fe6e74a..9ebf95c7edc9 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/SlideFlyoutTransition.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/SlideFlyoutTransition.cs @@ -1,5 +1,5 @@ -using CoreGraphics; using System; +using CoreGraphics; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -38,7 +38,7 @@ public virtual void LayoutViews(CGRect bounds, nfloat openPercent, UIView flyout flyoutWidth = (nfloat)(Math.Min(bounds.Width, bounds.Height) * 0.8); if (Height == -1d) - flyoutHeight = bounds.Height; + flyoutHeight = bounds.Height; else flyoutHeight = (nfloat)Height; @@ -52,7 +52,7 @@ public virtual void LayoutViews(CGRect bounds, nfloat openPercent, UIView flyout var shellWidth = shell.Frame.Width; - if(shell.SemanticContentAttribute == UISemanticContentAttribute.ForceRightToLeft) + if (shell.SemanticContentAttribute == UISemanticContentAttribute.ForceRightToLeft) { var positionY = shellWidth - openPixels; flyout.Frame = new CGRect(positionY, 0, flyoutWidth, flyoutHeight); diff --git a/src/Compatibility/Core/src/iOS/Renderers/SliderRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/SliderRenderer.cs index 07cd6d058689..3785248e6126 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/SliderRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/SliderRenderer.cs @@ -1,8 +1,8 @@ using System; using System.ComponentModel; +using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using UIKit; using SizeF = CoreGraphics.CGSize; -using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Slider; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS diff --git a/src/Compatibility/Core/src/iOS/Renderers/StepperRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/StepperRenderer.cs index e9bdca0ef9ef..00ba99b80f1a 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/StepperRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/StepperRenderer.cs @@ -1,6 +1,6 @@ using System; -using System.Drawing; using System.ComponentModel; +using System.Drawing; using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS @@ -8,7 +8,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS public class StepperRenderer : ViewRenderer { bool _disposed; - + [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] public StepperRenderer() { @@ -23,7 +23,7 @@ protected override void Dispose(bool disposing) _disposed = true; - if(disposing) + if (disposing) { if (Control != null) Control.ValueChanged -= OnValueChanged; diff --git a/src/Compatibility/Core/src/iOS/Renderers/SwipeViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/SwipeViewRenderer.cs index 705a575a22d9..15cbe78eb3dc 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/SwipeViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/SwipeViewRenderer.cs @@ -4,11 +4,12 @@ using System.Linq; using CoreGraphics; using Foundation; -using UIKit; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; -using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.SwipeView; using Microsoft.Maui.Graphics; +using UIKit; +using Specifics = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.SwipeView; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Renderers/TabbedRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/TabbedRenderer.cs index 475ae9849840..f4a5bdd6939c 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/TabbedRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/TabbedRenderer.cs @@ -3,13 +3,14 @@ using System.Collections.Specialized; using System.ComponentModel; using System.Threading.Tasks; -using UIKit; using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Platform; +using Microsoft.Maui.Graphics; +using UIKit; using static Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page; using PageUIStatusBarAnimation = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIStatusBarAnimation; using TabbedPageConfiguration = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.TabbedPage; using TranslucencyMode = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.TranslucencyMode; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -369,7 +370,7 @@ void UpdateBarBackgroundColor() if (!isDefaultColor) _barBackgroundColorWasSet = true; - + TabBar.BarTintColor = isDefaultColor ? _defaultBarColor : barBackgroundColor.ToUIColor(); } @@ -409,13 +410,9 @@ void UpdateBarTextColor() else tabBarTextColor = barTextColor.ToUIColor(); -#if MACCATALYST - var attributes = new UIStringAttributes(); - attributes.ForegroundColor = tabBarTextColor; -#else + var attributes = new UITextAttributes(); attributes.TextColor = tabBarTextColor; -#endif foreach (UITabBarItem item in TabBar.Items) { @@ -475,7 +472,7 @@ void IEffectControlProvider.RegisterEffect(Effect effect) async void SetTabBarItem(IVisualElementRenderer renderer) { var page = renderer.Element as Page; - if(page == null) + if (page == null) throw new InvalidCastException($"{nameof(renderer)} must be a {nameof(Page)} renderer."); var icons = await GetIcon(page); diff --git a/src/Compatibility/Core/src/iOS/Renderers/TableViewModelRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/TableViewModelRenderer.cs index 5bd6a33a1773..1900cea80175 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/TableViewModelRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/TableViewModelRenderer.cs @@ -149,9 +149,11 @@ public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexP var cell = View.Model.GetCell(indexPath.Section, indexPath.Row); var h = cell.Height; - if (View.RowHeight == -1 && h == -1 && cell is ViewCell) { + if (View.RowHeight == -1 && h == -1 && cell is ViewCell) + { return UITableView.AutomaticDimension; - } else if (h == -1) + } + else if (h == -1) return tableView.RowHeight; return (nfloat)h; } diff --git a/src/Compatibility/Core/src/iOS/Renderers/TableViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/TableViewRenderer.cs index 83628b101cdf..17107954b7c7 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/TableViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/TableViewRenderer.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.ComponentModel; +using Microsoft.Maui.Controls.Platform; using UIKit; using RectangleF = CoreGraphics.CGRect; @@ -158,18 +159,23 @@ void UpdateBackgroundView() void UpdateRowHeight() { var rowHeight = Element.RowHeight; - if (Element.HasUnevenRows && rowHeight == -1) { + if (Element.HasUnevenRows && rowHeight == -1) + { Control.RowHeight = UITableView.AutomaticDimension; - } else + } + else Control.RowHeight = rowHeight <= 0 ? DefaultRowHeight : rowHeight; } void UpdateEstimatedRowHeight() { var rowHeight = Element.RowHeight; - if (Element.HasUnevenRows && rowHeight == -1) { + if (Element.HasUnevenRows && rowHeight == -1) + { Control.EstimatedRowHeight = DefaultRowHeight; - } else { + } + else + { Control.EstimatedRowHeight = 0; } } diff --git a/src/Compatibility/Core/src/iOS/Renderers/TabletFlyoutPageRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/TabletFlyoutPageRenderer.cs index 49a02f0767c5..4665f77c6370 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/TabletFlyoutPageRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/TabletFlyoutPageRenderer.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using CoreGraphics; using Foundation; +using Microsoft.Maui.Controls.Platform; using Microsoft.Maui.Graphics; using UIKit; diff --git a/src/Compatibility/Core/src/iOS/Renderers/TabletShellFlyoutRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/TabletShellFlyoutRenderer.cs index 2b99658d1b33..02438b8bbdff 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/TabletShellFlyoutRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/TabletShellFlyoutRenderer.cs @@ -15,7 +15,7 @@ public class TabletShellFlyoutRenderer : UISplitViewController, IShellFlyoutRend void IShellFlyoutRenderer.AttachFlyout(IShellContext context, UIViewController content) { - if(_context != null) + if (_context != null) _context.Shell.PropertyChanged -= HandleShellPropertyChanged; _context = context; @@ -26,7 +26,7 @@ void IShellFlyoutRenderer.AttachFlyout(IShellContext context, UIViewController c FlyoutContent.WillDisappear += OnFlyoutContentWillDisappear; ((IShellController)_context.Shell).AddFlyoutBehaviorObserver(this); - + ViewControllers = new UIViewController[] { FlyoutContent.ViewController, diff --git a/src/Compatibility/Core/src/iOS/Renderers/TimePickerRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/TimePickerRenderer.cs index 154d8dd98477..906eca52025f 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/TimePickerRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/TimePickerRenderer.cs @@ -3,10 +3,10 @@ using System.Globalization; using System.Linq; using Foundation; -using UIKit; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; -using RectangleF = CoreGraphics.CGRect; using Microsoft.Maui.Platform.iOS; +using UIKit; +using RectangleF = CoreGraphics.CGRect; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -214,7 +214,7 @@ void UpdateTime() .Where(c => c.Name.EndsWith("-" + iOSLocale)).FirstOrDefault(); if (cultureInfos == null) cultureInfos = CultureInfo.InvariantCulture; - + if (String.IsNullOrEmpty(Element.Format)) { string timeformat = cultureInfos.DateTimeFormat.ShortTimePattern; diff --git a/src/Compatibility/Core/src/iOS/Renderers/UIContainerView.cs b/src/Compatibility/Core/src/iOS/Renderers/UIContainerView.cs index c58d9700548d..2fd239026f95 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/UIContainerView.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/UIContainerView.cs @@ -54,7 +54,7 @@ internal bool MeasureIfNeeded() ReMeasure(); return true; } - + return false; } @@ -65,7 +65,7 @@ public virtual Thickness Margin void ReMeasure() { - if(Height != null && MatchHeight) + if (Height != null && MatchHeight) { MeasuredHeight = Height.Value; } diff --git a/src/Compatibility/Core/src/iOS/Renderers/WkWebViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/WkWebViewRenderer.cs index 64e7c7d50110..e73b2c0f74d4 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/WkWebViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/WkWebViewRenderer.cs @@ -9,13 +9,13 @@ using System.Threading; using System.Threading.Tasks; using Foundation; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; using ObjCRuntime; using UIKit; using WebKit; -using Microsoft.Maui.Controls.Internals; using PreserveAttribute = Foundation.PreserveAttribute; using Uri = System.Uri; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { @@ -45,7 +45,7 @@ public WkWebViewRenderer() : this(CreateConfiguration()) [Preserve(Conditional = true)] public WkWebViewRenderer(WKWebViewConfiguration config) : base(CoreGraphics.CGRect.Empty, config) { - + } // https://developer.apple.com/forums/thread/99674 @@ -173,7 +173,7 @@ public async void LoadUrl(string url) { try { - + var uri = new Uri(url); var safeHostUri = new Uri($"{uri.Scheme}://{uri.Authority}", UriKind.Absolute); diff --git a/src/Compatibility/Core/src/iOS/Resources/StringResources.fr.resx b/src/Compatibility/Core/src/iOS/Resources/StringResources.fr.resx index 819845a0e5b7..f43fa4140d29 100644 --- a/src/Compatibility/Core/src/iOS/Resources/StringResources.fr.resx +++ b/src/Compatibility/Core/src/iOS/Resources/StringResources.fr.resx @@ -122,7 +122,7 @@ ContextActionCell Cancel button - Options + Plus ContextActionCell More button \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Resources/StringResources.it.resx b/src/Compatibility/Core/src/iOS/Resources/StringResources.it.resx index e7b49e093e63..7fa093bef882 100644 --- a/src/Compatibility/Core/src/iOS/Resources/StringResources.it.resx +++ b/src/Compatibility/Core/src/iOS/Resources/StringResources.it.resx @@ -122,7 +122,7 @@ ContextActionCell Cancel button - Altro + Più ContextActionCell More button \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Resources/StringResources.ja.resx b/src/Compatibility/Core/src/iOS/Resources/StringResources.ja.resx index aa6ed1a4df4b..1416ed60858e 100644 --- a/src/Compatibility/Core/src/iOS/Resources/StringResources.ja.resx +++ b/src/Compatibility/Core/src/iOS/Resources/StringResources.ja.resx @@ -122,7 +122,7 @@ ContextActionCell Cancel button - その他 + 表示を増やす ContextActionCell More button \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Resources/StringResources.ko.resx b/src/Compatibility/Core/src/iOS/Resources/StringResources.ko.resx index 2a2de740e4ac..be63cf869026 100644 --- a/src/Compatibility/Core/src/iOS/Resources/StringResources.ko.resx +++ b/src/Compatibility/Core/src/iOS/Resources/StringResources.ko.resx @@ -122,7 +122,7 @@ ContextActionCell Cancel button - 기타 + 자세히 ContextActionCell More button \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Resources/StringResources.ru.resx b/src/Compatibility/Core/src/iOS/Resources/StringResources.ru.resx index 6789a97f6f75..ab8ce04ff490 100644 --- a/src/Compatibility/Core/src/iOS/Resources/StringResources.ru.resx +++ b/src/Compatibility/Core/src/iOS/Resources/StringResources.ru.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Oтменить + Отмена ContextActionCell Cancel button diff --git a/src/Compatibility/Core/src/iOS/Resources/StringResources.tr.resx b/src/Compatibility/Core/src/iOS/Resources/StringResources.tr.resx index 256919f4abdd..306b26e17087 100644 --- a/src/Compatibility/Core/src/iOS/Resources/StringResources.tr.resx +++ b/src/Compatibility/Core/src/iOS/Resources/StringResources.tr.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Vazgeç + İptal ContextActionCell Cancel button diff --git a/src/Compatibility/Core/src/iOS/ResourcesProvider.cs b/src/Compatibility/Core/src/iOS/ResourcesProvider.cs index 409a86a72db0..17a2d9643dac 100644 --- a/src/Compatibility/Core/src/iOS/ResourcesProvider.cs +++ b/src/Compatibility/Core/src/iOS/ResourcesProvider.cs @@ -1,11 +1,10 @@ #if __MOBILE__ -using UIKit; using Microsoft.Maui.Controls.Internals; +using UIKit; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS #else -using Microsoft.Maui.Controls.Compatibility.Internals; namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif diff --git a/src/Compatibility/Core/src/iOS/ShadowEffect.cs b/src/Compatibility/Core/src/iOS/ShadowEffect.cs index 4fd1c7eeae9b..d948678b1dda 100644 --- a/src/Compatibility/Core/src/iOS/ShadowEffect.cs +++ b/src/Compatibility/Core/src/iOS/ShadowEffect.cs @@ -1,9 +1,9 @@ using System; using System.ComponentModel; -using UIKit; using Microsoft.Maui.Controls.Internals; -using PlatformElement = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.VisualElement; using Microsoft.Maui.Graphics; +using UIKit; +using PlatformElement = Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.VisualElement; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS { diff --git a/src/Compatibility/Core/src/iOS/Shapes/EllipseRenderer.cs b/src/Compatibility/Core/src/iOS/Shapes/EllipseRenderer.cs index 99fce51a7ec1..7a641480d8ab 100644 --- a/src/Compatibility/Core/src/iOS/Shapes/EllipseRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Shapes/EllipseRenderer.cs @@ -7,37 +7,37 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public class EllipseRenderer : ShapeRenderer - { - [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] - public EllipseRenderer() - { + public class EllipseRenderer : ShapeRenderer + { + [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] + public EllipseRenderer() + { - } + } - protected override void OnElementChanged(ElementChangedEventArgs args) - { - if (Control == null && args.NewElement != null) - { - SetNativeControl(new EllipseView()); - } + protected override void OnElementChanged(ElementChangedEventArgs args) + { + if (Control == null && args.NewElement != null) + { + SetNativeControl(new EllipseView()); + } - base.OnElementChanged(args); - } - } + base.OnElementChanged(args); + } + } - public class EllipseView : ShapeView - { - public EllipseView() - { - UpdateShape(); - } + public class EllipseView : ShapeView + { + public EllipseView() + { + UpdateShape(); + } - void UpdateShape() - { + void UpdateShape() + { var path = new CGPath(); - path.AddEllipseInRect(new CGRect(0, 0, 1, 1)); - ShapeLayer.UpdateShape(path); - } - } + path.AddEllipseInRect(new CGRect(0, 0, 1, 1)); + ShapeLayer.UpdateShape(path); + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Shapes/LineRenderer.cs b/src/Compatibility/Core/src/iOS/Shapes/LineRenderer.cs index 415308c26a24..e40f63a2d045 100644 --- a/src/Compatibility/Core/src/iOS/Shapes/LineRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Shapes/LineRenderer.cs @@ -9,101 +9,101 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public class LineRenderer : ShapeRenderer - { - [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] - public LineRenderer() - { - - } - - protected override void OnElementChanged(ElementChangedEventArgs args) - { - if (Control == null && args.NewElement != null) - { - SetNativeControl(new LineView()); - } - - base.OnElementChanged(args); - - if (args.NewElement != null) - { - UpdateX1(); - UpdateY1(); - UpdateX2(); - UpdateY2(); - } - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) - { - base.OnElementPropertyChanged(sender, args); - - if (args.PropertyName == Line.X1Property.PropertyName) - UpdateX1(); - else if (args.PropertyName == Line.Y1Property.PropertyName) - UpdateY1(); - else if (args.PropertyName == Line.X2Property.PropertyName) - UpdateX2(); - else if (args.PropertyName == Line.Y2Property.PropertyName) - UpdateY2(); - } - - void UpdateX1() - { - Control.UpdateX1(Element.X1); - } - - void UpdateY1() - { - Control.UpdateY1(Element.Y1); - } - - void UpdateX2() - { - Control.UpdateX2(Element.X2); - } - - void UpdateY2() - { - Control.UpdateY2(Element.Y2); - } - } - - public class LineView : ShapeView - { - nfloat _x1, _y1, _x2, _y2; - - public void UpdateX1(double x1) - { - _x1 = new nfloat(x1); - UpdateShape(); - } - - public void UpdateY1(double y1) - { - _y1 = new nfloat(y1); - UpdateShape(); - } - - public void UpdateX2(double x2) - { - _x2 = new nfloat(x2); - UpdateShape(); - } - - public void UpdateY2(double y2) - { - _y2 = new nfloat(y2); - UpdateShape(); - } - - void UpdateShape() - { + public class LineRenderer : ShapeRenderer + { + [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] + public LineRenderer() + { + + } + + protected override void OnElementChanged(ElementChangedEventArgs args) + { + if (Control == null && args.NewElement != null) + { + SetNativeControl(new LineView()); + } + + base.OnElementChanged(args); + + if (args.NewElement != null) + { + UpdateX1(); + UpdateY1(); + UpdateX2(); + UpdateY2(); + } + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) + { + base.OnElementPropertyChanged(sender, args); + + if (args.PropertyName == Line.X1Property.PropertyName) + UpdateX1(); + else if (args.PropertyName == Line.Y1Property.PropertyName) + UpdateY1(); + else if (args.PropertyName == Line.X2Property.PropertyName) + UpdateX2(); + else if (args.PropertyName == Line.Y2Property.PropertyName) + UpdateY2(); + } + + void UpdateX1() + { + Control.UpdateX1(Element.X1); + } + + void UpdateY1() + { + Control.UpdateY1(Element.Y1); + } + + void UpdateX2() + { + Control.UpdateX2(Element.X2); + } + + void UpdateY2() + { + Control.UpdateY2(Element.Y2); + } + } + + public class LineView : ShapeView + { + nfloat _x1, _y1, _x2, _y2; + + public void UpdateX1(double x1) + { + _x1 = new nfloat(x1); + UpdateShape(); + } + + public void UpdateY1(double y1) + { + _y1 = new nfloat(y1); + UpdateShape(); + } + + public void UpdateX2(double x2) + { + _x2 = new nfloat(x2); + UpdateShape(); + } + + public void UpdateY2(double y2) + { + _y2 = new nfloat(y2); + UpdateShape(); + } + + void UpdateShape() + { var path = new CGPath(); - path.MoveToPoint(_x1, _y1); - path.AddLineToPoint(_x2, _y2); - ShapeLayer.UpdateShape(path); - } - } + path.MoveToPoint(_x1, _y1); + path.AddLineToPoint(_x2, _y2); + ShapeLayer.UpdateShape(path); + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Shapes/PathRenderer.cs b/src/Compatibility/Core/src/iOS/Shapes/PathRenderer.cs index 915c1abc2949..9d866ca73cac 100644 --- a/src/Compatibility/Core/src/iOS/Shapes/PathRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Shapes/PathRenderer.cs @@ -8,55 +8,55 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public class PathRenderer : ShapeRenderer - { - [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] - public PathRenderer() - { - - } - - protected override void OnElementChanged(ElementChangedEventArgs args) - { - if (Control == null && args.NewElement != null) - { - SetNativeControl(new PathView()); - } - - base.OnElementChanged(args); - - if (args.NewElement != null) - { - UpdatePath(); - } - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) - { - base.OnElementPropertyChanged(sender, args); - - if (args.PropertyName == Path.DataProperty.PropertyName || args.PropertyName == Path.RenderTransformProperty.PropertyName) - UpdatePath(); - } - - void UpdatePath() - { - Control.UpdatePath(Element.Data.ToCGPath(Element.RenderTransform)); - } - } + public class PathRenderer : ShapeRenderer + { + [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] + public PathRenderer() + { + + } + + protected override void OnElementChanged(ElementChangedEventArgs args) + { + if (Control == null && args.NewElement != null) + { + SetNativeControl(new PathView()); + } + + base.OnElementChanged(args); + + if (args.NewElement != null) + { + UpdatePath(); + } + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) + { + base.OnElementPropertyChanged(sender, args); + + if (args.PropertyName == Path.DataProperty.PropertyName || args.PropertyName == Path.RenderTransformProperty.PropertyName) + UpdatePath(); + } + + void UpdatePath() + { + Control.UpdatePath(Element.Data.ToCGPath(Element.RenderTransform)); + } + } public class PathData - { - public CGPath Data { get; set; } - public bool IsNonzeroFillRule { get; set; } - } - - public class PathView : ShapeView - { - public void UpdatePath(PathData path) - { - ShapeLayer.UpdateShape(path.Data); - ShapeLayer.UpdateFillMode(path != null && path.IsNonzeroFillRule); - } - } + { + public CGPath Data { get; set; } + public bool IsNonzeroFillRule { get; set; } + } + + public class PathView : ShapeView + { + public void UpdatePath(PathData path) + { + ShapeLayer.UpdateShape(path.Data); + ShapeLayer.UpdateFillMode(path != null && path.IsNonzeroFillRule); + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Shapes/PolygonRenderer.cs b/src/Compatibility/Core/src/iOS/Shapes/PolygonRenderer.cs index 116678d61836..43837d393fa1 100644 --- a/src/Compatibility/Core/src/iOS/Shapes/PolygonRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Shapes/PolygonRenderer.cs @@ -9,96 +9,96 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public class PolygonRenderer : ShapeRenderer - { - PointCollection _points; - - [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] - public PolygonRenderer() - { - - } - - protected override void OnElementChanged(ElementChangedEventArgs args) - { - if (Control == null && args.NewElement != null) - { - SetNativeControl(new PolygonView()); - } - - base.OnElementChanged(args); - - if (args.NewElement != null) - { - var points = args.NewElement.Points; - points.CollectionChanged += OnCollectionChanged; - - UpdatePoints(); - UpdateFillRule(); - } - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) - { - base.OnElementPropertyChanged(sender, args); - - if (args.PropertyName == Polygon.PointsProperty.PropertyName) - UpdatePoints(); - else if (args.PropertyName == Polygon.FillRuleProperty.PropertyName) - UpdateFillRule(); - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (disposing) - { - if (_points != null) - { - _points.CollectionChanged -= OnCollectionChanged; - _points = null; - } - } - } - - void UpdatePoints() - { - if (_points != null) - _points.CollectionChanged -= OnCollectionChanged; - - _points = Element.Points; - - _points.CollectionChanged += OnCollectionChanged; - - Control.UpdatePoints(_points.ToCGPoints()); - } - - public void UpdateFillRule() - { - Control.UpdateFillMode(Element.FillRule == FillRule.Nonzero); - } - - void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - UpdatePoints(); - } - } - - public class PolygonView : ShapeView - { - public void UpdatePoints(CGPoint[] points) - { + public class PolygonRenderer : ShapeRenderer + { + PointCollection _points; + + [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] + public PolygonRenderer() + { + + } + + protected override void OnElementChanged(ElementChangedEventArgs args) + { + if (Control == null && args.NewElement != null) + { + SetNativeControl(new PolygonView()); + } + + base.OnElementChanged(args); + + if (args.NewElement != null) + { + var points = args.NewElement.Points; + points.CollectionChanged += OnCollectionChanged; + + UpdatePoints(); + UpdateFillRule(); + } + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) + { + base.OnElementPropertyChanged(sender, args); + + if (args.PropertyName == Polygon.PointsProperty.PropertyName) + UpdatePoints(); + else if (args.PropertyName == Polygon.FillRuleProperty.PropertyName) + UpdateFillRule(); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (disposing) + { + if (_points != null) + { + _points.CollectionChanged -= OnCollectionChanged; + _points = null; + } + } + } + + void UpdatePoints() + { + if (_points != null) + _points.CollectionChanged -= OnCollectionChanged; + + _points = Element.Points; + + _points.CollectionChanged += OnCollectionChanged; + + Control.UpdatePoints(_points.ToCGPoints()); + } + + public void UpdateFillRule() + { + Control.UpdateFillMode(Element.FillRule == FillRule.Nonzero); + } + + void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + UpdatePoints(); + } + } + + public class PolygonView : ShapeView + { + public void UpdatePoints(CGPoint[] points) + { var path = new CGPath(); - path.AddLines(points); - path.CloseSubpath(); + path.AddLines(points); + path.CloseSubpath(); - ShapeLayer.UpdateShape(path); - } + ShapeLayer.UpdateShape(path); + } - public void UpdateFillMode(bool fillMode) - { - ShapeLayer.UpdateFillMode(fillMode); - } - } + public void UpdateFillMode(bool fillMode) + { + ShapeLayer.UpdateFillMode(fillMode); + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Shapes/PolylineRenderer.cs b/src/Compatibility/Core/src/iOS/Shapes/PolylineRenderer.cs index 7aba3ecbce7e..f4c90e426e2e 100644 --- a/src/Compatibility/Core/src/iOS/Shapes/PolylineRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Shapes/PolylineRenderer.cs @@ -9,91 +9,91 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public class PolylineRenderer : ShapeRenderer - { - PointCollection _points; - - [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] - public PolylineRenderer() - { - - } - - protected override void OnElementChanged(ElementChangedEventArgs args) - { - if (Control == null && args.NewElement != null) - { - SetNativeControl(new PolylineView()); - } - - base.OnElementChanged(args); - - if (args.NewElement != null) - { - UpdatePoints(); - UpdateFillRule(); - } - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) - { - base.OnElementPropertyChanged(sender, args); - - if (args.PropertyName == Polyline.PointsProperty.PropertyName) - UpdatePoints(); - else if (args.PropertyName == Polyline.FillRuleProperty.PropertyName) - UpdateFillRule(); - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (disposing) - { - if (_points != null) - { - _points.CollectionChanged -= OnCollectionChanged; - _points = null; - } - } - } - - void UpdatePoints() - { - if (_points != null) - _points.CollectionChanged -= OnCollectionChanged; - - _points = Element.Points; - - _points.CollectionChanged += OnCollectionChanged; - - Control.UpdatePoints(_points.ToCGPoints()); - } - - public void UpdateFillRule() - { - Control.UpdateFillMode(Element.FillRule == FillRule.Nonzero); - } - - void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - UpdatePoints(); - } - } - - public class PolylineView : ShapeView - { - public void UpdatePoints(CGPoint[] points) - { - var path = new CGPath(); - path.AddLines(points); - ShapeLayer.UpdateShape(path); - } - - public void UpdateFillMode(bool fillMode) - { - ShapeLayer.UpdateFillMode(fillMode); - } - } + public class PolylineRenderer : ShapeRenderer + { + PointCollection _points; + + [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] + public PolylineRenderer() + { + + } + + protected override void OnElementChanged(ElementChangedEventArgs args) + { + if (Control == null && args.NewElement != null) + { + SetNativeControl(new PolylineView()); + } + + base.OnElementChanged(args); + + if (args.NewElement != null) + { + UpdatePoints(); + UpdateFillRule(); + } + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) + { + base.OnElementPropertyChanged(sender, args); + + if (args.PropertyName == Polyline.PointsProperty.PropertyName) + UpdatePoints(); + else if (args.PropertyName == Polyline.FillRuleProperty.PropertyName) + UpdateFillRule(); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (disposing) + { + if (_points != null) + { + _points.CollectionChanged -= OnCollectionChanged; + _points = null; + } + } + } + + void UpdatePoints() + { + if (_points != null) + _points.CollectionChanged -= OnCollectionChanged; + + _points = Element.Points; + + _points.CollectionChanged += OnCollectionChanged; + + Control.UpdatePoints(_points.ToCGPoints()); + } + + public void UpdateFillRule() + { + Control.UpdateFillMode(Element.FillRule == FillRule.Nonzero); + } + + void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + UpdatePoints(); + } + } + + public class PolylineView : ShapeView + { + public void UpdatePoints(CGPoint[] points) + { + var path = new CGPath(); + path.AddLines(points); + ShapeLayer.UpdateShape(path); + } + + public void UpdateFillMode(bool fillMode) + { + ShapeLayer.UpdateFillMode(fillMode); + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Shapes/RectangleRenderer.cs b/src/Compatibility/Core/src/iOS/Shapes/RectangleRenderer.cs index 755d54484009..331bd8018068 100644 --- a/src/Compatibility/Core/src/iOS/Shapes/RectangleRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Shapes/RectangleRenderer.cs @@ -9,106 +9,106 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public class RectangleRenderer : ShapeRenderer - { - // Each corner of the rounded rectangle is one-quarter of an ellipse with axes equal to the RadiusX and Radius parameters. - const double MaximumRadius = 0.5d; - - [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] - public RectangleRenderer() - { - - } - - protected override void OnElementChanged(ElementChangedEventArgs args) - { - if (Control == null && args.NewElement != null) - { - SetNativeControl(new RectangleView()); - } - - base.OnElementChanged(args); - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) - { - base.OnElementPropertyChanged(sender, args); - - if (args.PropertyName == VisualElement.HeightProperty.PropertyName || args.PropertyName == VisualElement.WidthProperty.PropertyName) - UpdateRadius(); - if (args.PropertyName == FormsRectangle.RadiusXProperty.PropertyName) - UpdateRadiusX(); - else if (args.PropertyName == FormsRectangle.RadiusYProperty.PropertyName) - UpdateRadiusY(); - } - - void UpdateRadius() - { - UpdateRadiusX(); - UpdateRadiusY(); - } - - void UpdateRadiusX() - { - if (Element.Width > 0) - { - var radiusX = ValidateRadius(Element.RadiusX / Element.Width); - Control.UpdateRadiusX(radiusX); - } - } - - void UpdateRadiusY() - { - if (Element.Height > 0) - { - var radiusY = ValidateRadius(Element.RadiusY / Element.Height); - Control.UpdateRadiusY(radiusY); - } - } - - double ValidateRadius(double radius) - { - if (radius > MaximumRadius) - radius = MaximumRadius; - - return radius; - } - } - - public class RectangleView : ShapeView - { - public RectangleView() - { - UpdateShape(); - } - - public nfloat RadiusX { set; get; } - - public nfloat RadiusY { set; get; } - - void UpdateShape() - { + public class RectangleRenderer : ShapeRenderer + { + // Each corner of the rounded rectangle is one-quarter of an ellipse with axes equal to the RadiusX and Radius parameters. + const double MaximumRadius = 0.5d; + + [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] + public RectangleRenderer() + { + + } + + protected override void OnElementChanged(ElementChangedEventArgs args) + { + if (Control == null && args.NewElement != null) + { + SetNativeControl(new RectangleView()); + } + + base.OnElementChanged(args); + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) + { + base.OnElementPropertyChanged(sender, args); + + if (args.PropertyName == VisualElement.HeightProperty.PropertyName || args.PropertyName == VisualElement.WidthProperty.PropertyName) + UpdateRadius(); + if (args.PropertyName == FormsRectangle.RadiusXProperty.PropertyName) + UpdateRadiusX(); + else if (args.PropertyName == FormsRectangle.RadiusYProperty.PropertyName) + UpdateRadiusY(); + } + + void UpdateRadius() + { + UpdateRadiusX(); + UpdateRadiusY(); + } + + void UpdateRadiusX() + { + if (Element.Width > 0) + { + var radiusX = ValidateRadius(Element.RadiusX / Element.Width); + Control.UpdateRadiusX(radiusX); + } + } + + void UpdateRadiusY() + { + if (Element.Height > 0) + { + var radiusY = ValidateRadius(Element.RadiusY / Element.Height); + Control.UpdateRadiusY(radiusY); + } + } + + double ValidateRadius(double radius) + { + if (radius > MaximumRadius) + radius = MaximumRadius; + + return radius; + } + } + + public class RectangleView : ShapeView + { + public RectangleView() + { + UpdateShape(); + } + + public nfloat RadiusX { set; get; } + + public nfloat RadiusY { set; get; } + + void UpdateShape() + { var path = new CGPath(); - path.AddRoundedRect(new CGRect(0, 0, 1, 1), RadiusX, RadiusY); - ShapeLayer.UpdateShape(path); - } - - public void UpdateRadiusX(double radiusX) - { - if (double.IsInfinity(radiusX)) - return; - - RadiusX = new nfloat(radiusX); - UpdateShape(); - } - - public void UpdateRadiusY(double radiusY) - { - if (double.IsInfinity(radiusY)) - return; - - RadiusY = new nfloat(radiusY); - UpdateShape(); - } - } + path.AddRoundedRect(new CGRect(0, 0, 1, 1), RadiusX, RadiusY); + ShapeLayer.UpdateShape(path); + } + + public void UpdateRadiusX(double radiusX) + { + if (double.IsInfinity(radiusX)) + return; + + RadiusX = new nfloat(radiusX); + UpdateShape(); + } + + public void UpdateRadiusY(double radiusY) + { + if (double.IsInfinity(radiusY)) + return; + + RadiusY = new nfloat(radiusY); + UpdateShape(); + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Shapes/ShapeRenderer.cs b/src/Compatibility/Core/src/iOS/Shapes/ShapeRenderer.cs index e3819ca29ce3..c5204d15836c 100644 --- a/src/Compatibility/Core/src/iOS/Shapes/ShapeRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Shapes/ShapeRenderer.cs @@ -16,573 +16,573 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS #endif { - public class ShapeRenderer : ViewRenderer - where TShape : Shape - where TNativeShape : ShapeView - { - double _height; - double _width; - - protected override void OnElementChanged(ElementChangedEventArgs args) - { - base.OnElementChanged(args); - - if (args.NewElement != null) - { - UpdateAspect(); - UpdateFill(); - UpdateStroke(); - UpdateStrokeThickness(); - UpdateStrokeDashArray(); - UpdateStrokeDashOffset(); - UpdateStrokeLineCap(); - UpdateStrokeLineJoin(); - UpdateStrokeMiterLimit(); - - if (!args.NewElement.Bounds.IsEmpty) - { - _height = Element.Height; - _width = Element.Width; - - UpdateSize(); - } - } - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) - { - base.OnElementPropertyChanged(sender, args); - - if (args.PropertyName == VisualElement.HeightProperty.PropertyName) - { - _height = Element.Height; - UpdateSize(); - } - else if (args.PropertyName == VisualElement.WidthProperty.PropertyName) - { - _width = Element.Width; - UpdateSize(); - } - else if (args.PropertyName == Shape.AspectProperty.PropertyName) - UpdateAspect(); - else if (args.PropertyName == Shape.FillProperty.PropertyName) - UpdateFill(); - else if (args.PropertyName == Shape.StrokeProperty.PropertyName) - UpdateStroke(); - else if (args.PropertyName == Shape.StrokeThicknessProperty.PropertyName) - UpdateStrokeThickness(); - else if (args.PropertyName == Shape.StrokeDashArrayProperty.PropertyName) - UpdateStrokeDashArray(); - else if (args.PropertyName == Shape.StrokeDashOffsetProperty.PropertyName) - UpdateStrokeDashOffset(); - else if (args.PropertyName == Shape.StrokeLineCapProperty.PropertyName) - UpdateStrokeLineCap(); - else if (args.PropertyName == Shape.StrokeLineJoinProperty.PropertyName) - UpdateStrokeLineJoin(); - else if (args.PropertyName == Shape.StrokeMiterLimitProperty.PropertyName) - UpdateStrokeMiterLimit(); - } - - public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint) - { - if (Control != null) - { - return Control.ShapeLayer.GetDesiredSize(); - } - - return base.GetDesiredSize(widthConstraint, heightConstraint); - } - - void UpdateAspect() - { - Control.ShapeLayer.UpdateAspect(Element.Aspect); - } - - void UpdateSize() - { - Control.ShapeLayer.UpdateSize(new CGSize(new nfloat(_width), new nfloat(_height))); - } - - void UpdateFill() - { - Control.ShapeLayer.UpdateFill(Element.Fill); - } - - void UpdateStroke() - { - Control.ShapeLayer.UpdateStroke(Element.Stroke); - } - - void UpdateStrokeThickness() - { - Control.ShapeLayer.UpdateStrokeThickness(Element.StrokeThickness); - } - - void UpdateStrokeDashArray() - { - if (Element.StrokeDashArray == null || Element.StrokeDashArray.Count == 0) - Control.ShapeLayer.UpdateStrokeDash(new nfloat[0]); - else - { + public class ShapeRenderer : ViewRenderer + where TShape : Shape + where TNativeShape : ShapeView + { + double _height; + double _width; + + protected override void OnElementChanged(ElementChangedEventArgs args) + { + base.OnElementChanged(args); + + if (args.NewElement != null) + { + UpdateAspect(); + UpdateFill(); + UpdateStroke(); + UpdateStrokeThickness(); + UpdateStrokeDashArray(); + UpdateStrokeDashOffset(); + UpdateStrokeLineCap(); + UpdateStrokeLineJoin(); + UpdateStrokeMiterLimit(); + + if (!args.NewElement.Bounds.IsEmpty) + { + _height = Element.Height; + _width = Element.Width; + + UpdateSize(); + } + } + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args) + { + base.OnElementPropertyChanged(sender, args); + + if (args.PropertyName == VisualElement.HeightProperty.PropertyName) + { + _height = Element.Height; + UpdateSize(); + } + else if (args.PropertyName == VisualElement.WidthProperty.PropertyName) + { + _width = Element.Width; + UpdateSize(); + } + else if (args.PropertyName == Shape.AspectProperty.PropertyName) + UpdateAspect(); + else if (args.PropertyName == Shape.FillProperty.PropertyName) + UpdateFill(); + else if (args.PropertyName == Shape.StrokeProperty.PropertyName) + UpdateStroke(); + else if (args.PropertyName == Shape.StrokeThicknessProperty.PropertyName) + UpdateStrokeThickness(); + else if (args.PropertyName == Shape.StrokeDashArrayProperty.PropertyName) + UpdateStrokeDashArray(); + else if (args.PropertyName == Shape.StrokeDashOffsetProperty.PropertyName) + UpdateStrokeDashOffset(); + else if (args.PropertyName == Shape.StrokeLineCapProperty.PropertyName) + UpdateStrokeLineCap(); + else if (args.PropertyName == Shape.StrokeLineJoinProperty.PropertyName) + UpdateStrokeLineJoin(); + else if (args.PropertyName == Shape.StrokeMiterLimitProperty.PropertyName) + UpdateStrokeMiterLimit(); + } + + public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint) + { + if (Control != null) + { + return Control.ShapeLayer.GetDesiredSize(); + } + + return base.GetDesiredSize(widthConstraint, heightConstraint); + } + + void UpdateAspect() + { + Control.ShapeLayer.UpdateAspect(Element.Aspect); + } + + void UpdateSize() + { + Control.ShapeLayer.UpdateSize(new CGSize(new nfloat(_width), new nfloat(_height))); + } + + void UpdateFill() + { + Control.ShapeLayer.UpdateFill(Element.Fill); + } + + void UpdateStroke() + { + Control.ShapeLayer.UpdateStroke(Element.Stroke); + } + + void UpdateStrokeThickness() + { + Control.ShapeLayer.UpdateStrokeThickness(Element.StrokeThickness); + } + + void UpdateStrokeDashArray() + { + if (Element.StrokeDashArray == null || Element.StrokeDashArray.Count == 0) + Control.ShapeLayer.UpdateStrokeDash(new nfloat[0]); + else + { nfloat[] dashArray; double[] array; if (Element.StrokeDashArray.Count % 2 == 0) { array = new double[Element.StrokeDashArray.Count]; - dashArray = new nfloat[Element.StrokeDashArray.Count]; + dashArray = new nfloat[Element.StrokeDashArray.Count]; Element.StrokeDashArray.CopyTo(array, 0); } else { array = new double[2 * Element.StrokeDashArray.Count]; - dashArray = new nfloat[2 * Element.StrokeDashArray.Count]; + dashArray = new nfloat[2 * Element.StrokeDashArray.Count]; Element.StrokeDashArray.CopyTo(array, 0); Element.StrokeDashArray.CopyTo(array, Element.StrokeDashArray.Count); } double thickness = Element.StrokeThickness; - for (int i = 0; i < array.Length; i++) - dashArray[i] = new nfloat(thickness * array[i]); - - Control.ShapeLayer.UpdateStrokeDash(dashArray); - } - } + for (int i = 0; i < array.Length; i++) + dashArray[i] = new nfloat(thickness * array[i]); - void UpdateStrokeDashOffset() - { - Control.ShapeLayer.UpdateStrokeDashOffset((nfloat)Element.StrokeDashOffset); - } + Control.ShapeLayer.UpdateStrokeDash(dashArray); + } + } + + void UpdateStrokeDashOffset() + { + Control.ShapeLayer.UpdateStrokeDashOffset((nfloat)Element.StrokeDashOffset); + } void UpdateStrokeLineCap() { - PenLineCap lineCap = Element.StrokeLineCap; - CGLineCap iLineCap = CGLineCap.Butt; - - switch (lineCap) - { - case PenLineCap.Flat: - iLineCap = CGLineCap.Butt; - break; - case PenLineCap.Square: - iLineCap = CGLineCap.Square; - break; - case PenLineCap.Round: - iLineCap = CGLineCap.Round; - break; - } - - Control.ShapeLayer.UpdateStrokeLineCap(iLineCap); - } - - void UpdateStrokeLineJoin() - { - PenLineJoin lineJoin = Element.StrokeLineJoin; - CGLineJoin iLineJoin = CGLineJoin.Miter; - - switch (lineJoin) - { - case PenLineJoin.Miter: - iLineJoin = CGLineJoin.Miter; - break; - case PenLineJoin.Bevel: - iLineJoin = CGLineJoin.Bevel; - break; - case PenLineJoin.Round: - iLineJoin = CGLineJoin.Round; - break; - } - - Control.ShapeLayer.UpdateStrokeLineJoin(iLineJoin); - } - - void UpdateStrokeMiterLimit() - { - Control.ShapeLayer.UpdateStrokeMiterLimit(new nfloat(Element.StrokeMiterLimit)); - } - } - - public class ShapeView + PenLineCap lineCap = Element.StrokeLineCap; + CGLineCap iLineCap = CGLineCap.Butt; + + switch (lineCap) + { + case PenLineCap.Flat: + iLineCap = CGLineCap.Butt; + break; + case PenLineCap.Square: + iLineCap = CGLineCap.Square; + break; + case PenLineCap.Round: + iLineCap = CGLineCap.Round; + break; + } + + Control.ShapeLayer.UpdateStrokeLineCap(iLineCap); + } + + void UpdateStrokeLineJoin() + { + PenLineJoin lineJoin = Element.StrokeLineJoin; + CGLineJoin iLineJoin = CGLineJoin.Miter; + + switch (lineJoin) + { + case PenLineJoin.Miter: + iLineJoin = CGLineJoin.Miter; + break; + case PenLineJoin.Bevel: + iLineJoin = CGLineJoin.Bevel; + break; + case PenLineJoin.Round: + iLineJoin = CGLineJoin.Round; + break; + } + + Control.ShapeLayer.UpdateStrokeLineJoin(iLineJoin); + } + + void UpdateStrokeMiterLimit() + { + Control.ShapeLayer.UpdateStrokeMiterLimit(new nfloat(Element.StrokeMiterLimit)); + } + } + + public class ShapeView #if __MOBILE__ : UIView #else : NSView #endif - { - public ShapeView() - { + { + public ShapeView() + { #if __MOBILE__ - BackgroundColor = UIColor.Clear; + BackgroundColor = UIColor.Clear; #else WantsLayer = true; #endif - ShapeLayer = new ShapeLayer(); - Layer.AddSublayer(ShapeLayer); - Layer.MasksToBounds = false; - } + ShapeLayer = new ShapeLayer(); + Layer.AddSublayer(ShapeLayer); + Layer.MasksToBounds = false; + } - public ShapeLayer ShapeLayer - { - private set; - get; - } + public ShapeLayer ShapeLayer + { + private set; + get; + } #if !__MOBILE__ public override bool IsFlipped => true; #endif - } + } - public class ShapeLayer : CALayer - { - CGPath _path; - CGRect _pathFillBounds; - CGRect _pathStrokeBounds; + public class ShapeLayer : CALayer + { + CGPath _path; + CGRect _pathFillBounds; + CGRect _pathStrokeBounds; - CGPath _renderPath; - CGRect _renderPathFill; - CGRect _renderPathStroke; + CGPath _renderPath; + CGRect _renderPathFill; + CGRect _renderPathStroke; - bool _fillMode; + bool _fillMode; - Brush _stroke; - Brush _fill; + Brush _stroke; + Brush _fill; - nfloat _strokeWidth; - nfloat[] _strokeDash; - nfloat _dashOffset; + nfloat _strokeWidth; + nfloat[] _strokeDash; + nfloat _dashOffset; - Stretch _stretch; + Stretch _stretch; CGLineCap _strokeLineCap; - CGLineJoin _strokeLineJoin; - nfloat _strokeMiterLimit; + CGLineJoin _strokeLineJoin; + nfloat _strokeMiterLimit; - public ShapeLayer() - { + public ShapeLayer() + { #if __MOBILE__ - ContentsScale = UIScreen.MainScreen.Scale; + ContentsScale = UIScreen.MainScreen.Scale; #else ContentsScale = NSScreen.MainScreen.BackingScaleFactor; #endif - _fillMode = false; - _stretch = Stretch.None; - _strokeLineCap = CGLineCap.Butt; - _strokeLineJoin = CGLineJoin.Miter; - _strokeMiterLimit = 10; - } - - public override void DrawInContext(CGContext ctx) - { - base.DrawInContext(ctx); - RenderShape(ctx); - } - - public void UpdateShape(CGPath path) - { - _path = path; - - if (_path != null) - _pathFillBounds = _path.PathBoundingBox; - else - _pathFillBounds = new CGRect(); - - UpdatePathStrokeBounds(); - } - - public void UpdateFillMode(bool fillMode) - { - _fillMode = fillMode; - SetNeedsDisplay(); - } - - public SizeRequest GetDesiredSize() - { - return new SizeRequest(new Size( - Math.Max(0, nfloat.IsNaN(_pathStrokeBounds.Right) ? 0 : _pathStrokeBounds.Right), - Math.Max(0, nfloat.IsNaN(_pathStrokeBounds.Bottom) ? 0 : _pathStrokeBounds.Bottom))); - } - - public void UpdateSize(CGSize size) - { - Bounds = new CGRect(new CGPoint(), size); - BuildRenderPath(); - } - - public void UpdateAspect(Stretch stretch) - { - _stretch = stretch; - BuildRenderPath(); - } - - public void UpdateFill(Brush fill) - { - _fill = fill; - SetNeedsDisplay(); - } - - public void UpdateStroke(Brush stroke) - { - _stroke = stroke; - SetNeedsDisplay(); - } - - public void UpdateStrokeThickness(double strokeWidth) - { - _strokeWidth = new nfloat(strokeWidth); - BuildRenderPath(); - } - - public void UpdateStrokeDash(nfloat[] dash) - { - _strokeDash = dash; - SetNeedsDisplay(); - } - - public void UpdateStrokeDashOffset(nfloat dashOffset) - { - _dashOffset = dashOffset; - SetNeedsDisplay(); - } - - public void UpdateStrokeLineCap(CGLineCap strokeLineCap) - { - _strokeLineCap = strokeLineCap; - UpdatePathStrokeBounds(); - SetNeedsDisplay(); - } - - public void UpdateStrokeLineJoin(CGLineJoin strokeLineJoin) - { - _strokeLineJoin = strokeLineJoin; - UpdatePathStrokeBounds(); - SetNeedsDisplay(); - } - - public void UpdateStrokeMiterLimit(nfloat strokeMiterLimit) - { - _strokeMiterLimit = strokeMiterLimit; - UpdatePathStrokeBounds(); - SetNeedsDisplay(); - } - - void BuildRenderPath() - { - if (_path == null) - { - _renderPath = null; - _renderPathFill = new CGRect(); - _renderPathStroke = new CGRect(); - return; - } - - CATransaction.Begin(); - CATransaction.DisableActions = true; - - if (_stretch != Stretch.None) - { - CGRect viewBounds = Bounds; - viewBounds.X += _strokeWidth / 2; - viewBounds.Y += _strokeWidth / 2; - viewBounds.Width -= _strokeWidth; - viewBounds.Height -= _strokeWidth; - - nfloat widthScale = viewBounds.Width / _pathFillBounds.Width; - nfloat heightScale = viewBounds.Height / _pathFillBounds.Height; - var stretchTransform = CGAffineTransform.MakeIdentity(); - - switch (_stretch) - { - case Stretch.None: - break; - - case Stretch.Fill: - stretchTransform.Scale(widthScale, heightScale); - - stretchTransform.Translate( - viewBounds.Left - widthScale * _pathFillBounds.Left, - viewBounds.Top - heightScale * _pathFillBounds.Top); - break; - - case Stretch.Uniform: - nfloat minScale = NMath.Min(widthScale, heightScale); - - stretchTransform.Scale(minScale, minScale); - - stretchTransform.Translate( - viewBounds.Left - minScale * _pathFillBounds.Left + - (viewBounds.Width - minScale * _pathFillBounds.Width) / 2, - viewBounds.Top - minScale * _pathFillBounds.Top + - (viewBounds.Height - minScale * _pathFillBounds.Height) / 2); - break; - - case Stretch.UniformToFill: - nfloat maxScale = NMath.Max(widthScale, heightScale); - - stretchTransform.Scale(maxScale, maxScale); - - stretchTransform.Translate( - viewBounds.Left - maxScale * _pathFillBounds.Left, - viewBounds.Top - maxScale * _pathFillBounds.Top); - break; - } - - Frame = Bounds; - _renderPath = _path.CopyByTransformingPath(stretchTransform); - } - else - { - nfloat adjustX = NMath.Min(0, _pathStrokeBounds.X); - nfloat adjustY = NMath.Min(0, _pathStrokeBounds.Y); - - if (adjustX < 0 || adjustY < 0) - { - nfloat width = Bounds.Width; - nfloat height = Bounds.Height; - - if (_pathStrokeBounds.Width > Bounds.Width) - width = Bounds.Width - adjustX; - if (_pathStrokeBounds.Height > Bounds.Height) - height = Bounds.Height - adjustY; - - Frame = new CGRect(adjustX, adjustY, width, height); - var transform = new CGAffineTransform(Bounds.Width / width, 0, 0, Bounds.Height / height, -adjustX, -adjustY); - _renderPath = _path.CopyByTransformingPath(transform); - } - else - { - Frame = Bounds; - _renderPath = _path.CopyByTransformingPath(CGAffineTransform.MakeIdentity()); - } - } - - _renderPathFill = _renderPath.PathBoundingBox; - _renderPathStroke = _renderPath.CopyByStrokingPath(_strokeWidth, _strokeLineCap, _strokeLineJoin, _strokeMiterLimit).PathBoundingBox; - - CATransaction.Commit(); - - SetNeedsDisplay(); - } - - void RenderShape(CGContext graphics) - { - if (_path == null) - return; - - if (_stroke == null && _fill == null) - return; - - CATransaction.Begin(); - CATransaction.DisableActions = true; - - graphics.SetLineWidth(_strokeWidth); - graphics.SetLineDash(_dashOffset * _strokeWidth, _strokeDash); - graphics.SetLineCap(_strokeLineCap); - graphics.SetLineJoin(_strokeLineJoin); - graphics.SetMiterLimit(_strokeMiterLimit * _strokeWidth / 4); - - if (_fill is GradientBrush fillGradientBrush) - { - graphics.AddPath(_renderPath); - - if (_fillMode) - graphics.Clip(); - else - graphics.EOClip(); - - RenderBrush(graphics, _renderPathFill, fillGradientBrush); - } - else - { - CGColor fillColor = + _fillMode = false; + _stretch = Stretch.None; + _strokeLineCap = CGLineCap.Butt; + _strokeLineJoin = CGLineJoin.Miter; + _strokeMiterLimit = 10; + } + + public override void DrawInContext(CGContext ctx) + { + base.DrawInContext(ctx); + RenderShape(ctx); + } + + public void UpdateShape(CGPath path) + { + _path = path; + + if (_path != null) + _pathFillBounds = _path.PathBoundingBox; + else + _pathFillBounds = new CGRect(); + + UpdatePathStrokeBounds(); + } + + public void UpdateFillMode(bool fillMode) + { + _fillMode = fillMode; + SetNeedsDisplay(); + } + + public SizeRequest GetDesiredSize() + { + return new SizeRequest(new Size( + Math.Max(0, nfloat.IsNaN(_pathStrokeBounds.Right) ? 0 : _pathStrokeBounds.Right), + Math.Max(0, nfloat.IsNaN(_pathStrokeBounds.Bottom) ? 0 : _pathStrokeBounds.Bottom))); + } + + public void UpdateSize(CGSize size) + { + Bounds = new CGRect(new CGPoint(), size); + BuildRenderPath(); + } + + public void UpdateAspect(Stretch stretch) + { + _stretch = stretch; + BuildRenderPath(); + } + + public void UpdateFill(Brush fill) + { + _fill = fill; + SetNeedsDisplay(); + } + + public void UpdateStroke(Brush stroke) + { + _stroke = stroke; + SetNeedsDisplay(); + } + + public void UpdateStrokeThickness(double strokeWidth) + { + _strokeWidth = new nfloat(strokeWidth); + BuildRenderPath(); + } + + public void UpdateStrokeDash(nfloat[] dash) + { + _strokeDash = dash; + SetNeedsDisplay(); + } + + public void UpdateStrokeDashOffset(nfloat dashOffset) + { + _dashOffset = dashOffset; + SetNeedsDisplay(); + } + + public void UpdateStrokeLineCap(CGLineCap strokeLineCap) + { + _strokeLineCap = strokeLineCap; + UpdatePathStrokeBounds(); + SetNeedsDisplay(); + } + + public void UpdateStrokeLineJoin(CGLineJoin strokeLineJoin) + { + _strokeLineJoin = strokeLineJoin; + UpdatePathStrokeBounds(); + SetNeedsDisplay(); + } + + public void UpdateStrokeMiterLimit(nfloat strokeMiterLimit) + { + _strokeMiterLimit = strokeMiterLimit; + UpdatePathStrokeBounds(); + SetNeedsDisplay(); + } + + void BuildRenderPath() + { + if (_path == null) + { + _renderPath = null; + _renderPathFill = new CGRect(); + _renderPathStroke = new CGRect(); + return; + } + + CATransaction.Begin(); + CATransaction.DisableActions = true; + + if (_stretch != Stretch.None) + { + CGRect viewBounds = Bounds; + viewBounds.X += _strokeWidth / 2; + viewBounds.Y += _strokeWidth / 2; + viewBounds.Width -= _strokeWidth; + viewBounds.Height -= _strokeWidth; + + nfloat widthScale = viewBounds.Width / _pathFillBounds.Width; + nfloat heightScale = viewBounds.Height / _pathFillBounds.Height; + var stretchTransform = CGAffineTransform.MakeIdentity(); + + switch (_stretch) + { + case Stretch.None: + break; + + case Stretch.Fill: + stretchTransform.Scale(widthScale, heightScale); + + stretchTransform.Translate( + viewBounds.Left - widthScale * _pathFillBounds.Left, + viewBounds.Top - heightScale * _pathFillBounds.Top); + break; + + case Stretch.Uniform: + nfloat minScale = NMath.Min(widthScale, heightScale); + + stretchTransform.Scale(minScale, minScale); + + stretchTransform.Translate( + viewBounds.Left - minScale * _pathFillBounds.Left + + (viewBounds.Width - minScale * _pathFillBounds.Width) / 2, + viewBounds.Top - minScale * _pathFillBounds.Top + + (viewBounds.Height - minScale * _pathFillBounds.Height) / 2); + break; + + case Stretch.UniformToFill: + nfloat maxScale = NMath.Max(widthScale, heightScale); + + stretchTransform.Scale(maxScale, maxScale); + + stretchTransform.Translate( + viewBounds.Left - maxScale * _pathFillBounds.Left, + viewBounds.Top - maxScale * _pathFillBounds.Top); + break; + } + + Frame = Bounds; + _renderPath = _path.CopyByTransformingPath(stretchTransform); + } + else + { + nfloat adjustX = NMath.Min(0, _pathStrokeBounds.X); + nfloat adjustY = NMath.Min(0, _pathStrokeBounds.Y); + + if (adjustX < 0 || adjustY < 0) + { + nfloat width = Bounds.Width; + nfloat height = Bounds.Height; + + if (_pathStrokeBounds.Width > Bounds.Width) + width = Bounds.Width - adjustX; + if (_pathStrokeBounds.Height > Bounds.Height) + height = Bounds.Height - adjustY; + + Frame = new CGRect(adjustX, adjustY, width, height); + var transform = new CGAffineTransform(Bounds.Width / width, 0, 0, Bounds.Height / height, -adjustX, -adjustY); + _renderPath = _path.CopyByTransformingPath(transform); + } + else + { + Frame = Bounds; + _renderPath = _path.CopyByTransformingPath(CGAffineTransform.MakeIdentity()); + } + } + + _renderPathFill = _renderPath.PathBoundingBox; + _renderPathStroke = _renderPath.CopyByStrokingPath(_strokeWidth, _strokeLineCap, _strokeLineJoin, _strokeMiterLimit).PathBoundingBox; + + CATransaction.Commit(); + + SetNeedsDisplay(); + } + + void RenderShape(CGContext graphics) + { + if (_path == null) + return; + + if (_stroke == null && _fill == null) + return; + + CATransaction.Begin(); + CATransaction.DisableActions = true; + + graphics.SetLineWidth(_strokeWidth); + graphics.SetLineDash(_dashOffset * _strokeWidth, _strokeDash); + graphics.SetLineCap(_strokeLineCap); + graphics.SetLineJoin(_strokeLineJoin); + graphics.SetMiterLimit(_strokeMiterLimit * _strokeWidth / 4); + + if (_fill is GradientBrush fillGradientBrush) + { + graphics.AddPath(_renderPath); + + if (_fillMode) + graphics.Clip(); + else + graphics.EOClip(); + + RenderBrush(graphics, _renderPathFill, fillGradientBrush); + } + else + { + CGColor fillColor = #if __MOBILE__ - UIColor.Clear.CGColor; + UIColor.Clear.CGColor; #else NSColor.Clear.CGColor; #endif - if (_fill is SolidColorBrush solidColorBrush && solidColorBrush.Color != null) - fillColor = solidColorBrush.Color.ToCGColor(); - - graphics.AddPath(_renderPath); - graphics.SetFillColor(fillColor); - graphics.DrawPath(_fillMode ? CGPathDrawingMode.FillStroke : CGPathDrawingMode.EOFillStroke); - } - - if (_stroke is GradientBrush strokeGradientBrush) - { - graphics.AddPath(_renderPath); - graphics.ReplacePathWithStrokedPath(); - graphics.Clip(); - RenderBrush(graphics, _renderPathStroke, strokeGradientBrush); - } - else - { - CGColor strokeColor = + if (_fill is SolidColorBrush solidColorBrush && solidColorBrush.Color != null) + fillColor = solidColorBrush.Color.ToCGColor(); + + graphics.AddPath(_renderPath); + graphics.SetFillColor(fillColor); + graphics.DrawPath(_fillMode ? CGPathDrawingMode.FillStroke : CGPathDrawingMode.EOFillStroke); + } + + if (_stroke is GradientBrush strokeGradientBrush) + { + graphics.AddPath(_renderPath); + graphics.ReplacePathWithStrokedPath(); + graphics.Clip(); + RenderBrush(graphics, _renderPathStroke, strokeGradientBrush); + } + else + { + CGColor strokeColor = #if __MOBILE__ - UIColor.Clear.CGColor; + UIColor.Clear.CGColor; #else NSColor.Clear.CGColor; #endif - if (_stroke is SolidColorBrush solidColorBrush && solidColorBrush.Color != null) - strokeColor = solidColorBrush.Color.ToCGColor(); - - graphics.AddPath(_renderPath); - graphics.SetStrokeColor(strokeColor); - graphics.DrawPath(CGPathDrawingMode.Stroke); - } - - CATransaction.Commit(); - } - - void RenderBrush(CGContext graphics, CGRect pathBounds, GradientBrush brush) - { - if (brush == null) - return; - - using (CGColorSpace rgb = CGColorSpace.CreateDeviceRGB()) - { - CGColor[] colors = new CGColor[brush.GradientStops.Count]; - nfloat[] locations = new nfloat[brush.GradientStops.Count]; - - for (int index = 0; index < brush.GradientStops.Count; index++) - { - Color color = brush.GradientStops[index].Color; - colors[index] = new CGColor(new nfloat(color.Red), new nfloat(color.Green), new nfloat(color.Blue), new nfloat(color.Alpha)); - locations[index] = new nfloat(brush.GradientStops[index].Offset); - } - - CGGradient gradient = new CGGradient(rgb, colors, locations); - - if (brush is LinearGradientBrush linearGradientBrush) - { - graphics.DrawLinearGradient( - gradient, - new CGPoint(pathBounds.Left + linearGradientBrush.StartPoint.X * pathBounds.Width, pathBounds.Top + linearGradientBrush.StartPoint.Y * pathBounds.Height), - new CGPoint(pathBounds.Left + linearGradientBrush.EndPoint.X * pathBounds.Width, pathBounds.Top + linearGradientBrush.EndPoint.Y * pathBounds.Height), - CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); - } - - if (brush is RadialGradientBrush radialGradientBrush) - { - graphics.DrawRadialGradient( - gradient, - new CGPoint(radialGradientBrush.Center.X * pathBounds.Width + pathBounds.Left, radialGradientBrush.Center.Y * pathBounds.Height + pathBounds.Top), - 0.0f, - new CGPoint(radialGradientBrush.Center.X * pathBounds.Width + pathBounds.Left, radialGradientBrush.Center.Y * pathBounds.Height + pathBounds.Top), - (nfloat)(radialGradientBrush.Radius * Math.Max(pathBounds.Height, pathBounds.Width)), - CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); - } - } - } - - void UpdatePathStrokeBounds() - { - if (_path != null) - _pathStrokeBounds = _path.CopyByStrokingPath(_strokeWidth, _strokeLineCap, _strokeLineJoin, _strokeMiterLimit).PathBoundingBox; - else - _pathStrokeBounds = new CGRect(); - - BuildRenderPath(); - } - } + if (_stroke is SolidColorBrush solidColorBrush && solidColorBrush.Color != null) + strokeColor = solidColorBrush.Color.ToCGColor(); + + graphics.AddPath(_renderPath); + graphics.SetStrokeColor(strokeColor); + graphics.DrawPath(CGPathDrawingMode.Stroke); + } + + CATransaction.Commit(); + } + + void RenderBrush(CGContext graphics, CGRect pathBounds, GradientBrush brush) + { + if (brush == null) + return; + + using (CGColorSpace rgb = CGColorSpace.CreateDeviceRGB()) + { + CGColor[] colors = new CGColor[brush.GradientStops.Count]; + nfloat[] locations = new nfloat[brush.GradientStops.Count]; + + for (int index = 0; index < brush.GradientStops.Count; index++) + { + Color color = brush.GradientStops[index].Color; + colors[index] = new CGColor(new nfloat(color.Red), new nfloat(color.Green), new nfloat(color.Blue), new nfloat(color.Alpha)); + locations[index] = new nfloat(brush.GradientStops[index].Offset); + } + + CGGradient gradient = new CGGradient(rgb, colors, locations); + + if (brush is LinearGradientBrush linearGradientBrush) + { + graphics.DrawLinearGradient( + gradient, + new CGPoint(pathBounds.Left + linearGradientBrush.StartPoint.X * pathBounds.Width, pathBounds.Top + linearGradientBrush.StartPoint.Y * pathBounds.Height), + new CGPoint(pathBounds.Left + linearGradientBrush.EndPoint.X * pathBounds.Width, pathBounds.Top + linearGradientBrush.EndPoint.Y * pathBounds.Height), + CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); + } + + if (brush is RadialGradientBrush radialGradientBrush) + { + graphics.DrawRadialGradient( + gradient, + new CGPoint(radialGradientBrush.Center.X * pathBounds.Width + pathBounds.Left, radialGradientBrush.Center.Y * pathBounds.Height + pathBounds.Top), + 0.0f, + new CGPoint(radialGradientBrush.Center.X * pathBounds.Width + pathBounds.Left, radialGradientBrush.Center.Y * pathBounds.Height + pathBounds.Top), + (nfloat)(radialGradientBrush.Radius * Math.Max(pathBounds.Height, pathBounds.Width)), + CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); + } + } + } + + void UpdatePathStrokeBounds() + { + if (_path != null) + _pathStrokeBounds = _path.CopyByStrokingPath(_strokeWidth, _strokeLineCap, _strokeLineJoin, _strokeMiterLimit).PathBoundingBox; + else + _pathStrokeBounds = new CGRect(); + + BuildRenderPath(); + } + } } \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/ViewRenderer.cs b/src/Compatibility/Core/src/iOS/ViewRenderer.cs index d0b5536bd72b..d98b5fa96c67 100644 --- a/src/Compatibility/Core/src/iOS/ViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/ViewRenderer.cs @@ -4,6 +4,7 @@ using RectangleF = CoreGraphics.CGRect; using SizeF = CoreGraphics.CGSize; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; #if __MOBILE__ using UIKit; @@ -137,7 +138,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e) if (Control != null && e.OldElement != null && e.OldElement.BackgroundColor != e.NewElement.BackgroundColor || e.NewElement.BackgroundColor != null) SetBackgroundColor(e.NewElement.BackgroundColor); - if(Control != null && e.OldElement != null && e.OldElement.Background != e.NewElement.Background) + if (Control != null && e.OldElement != null && e.OldElement.Background != e.NewElement.Background) SetBackground(e.NewElement.Background); e.NewElement.FocusChangeRequested += ViewOnFocusChangeRequested; @@ -301,7 +302,7 @@ void ViewOnFocusChangeRequested(object sender, VisualElement.FocusRequestArgs fo { if (Control == null) return; - + #if __MOBILE__ focusRequestArgs.Result = focusRequestArgs.Focus ? Control.BecomeFirstResponder() : Control.ResignFirstResponder(); #else diff --git a/src/Compatibility/Core/src/iOS/VisualElementPackager.cs b/src/Compatibility/Core/src/iOS/VisualElementPackager.cs index 5970dfa96356..da169226ee55 100644 --- a/src/Compatibility/Core/src/iOS/VisualElementPackager.cs +++ b/src/Compatibility/Core/src/iOS/VisualElementPackager.cs @@ -49,7 +49,7 @@ public void Load() OnChildAdded(child); } } - + internal void Disconnect() { Disconnect(_element); diff --git a/src/Compatibility/Core/src/iOS/VisualElementRenderer.cs b/src/Compatibility/Core/src/iOS/VisualElementRenderer.cs index ecd7563cadb4..4e94f5587c85 100644 --- a/src/Compatibility/Core/src/iOS/VisualElementRenderer.cs +++ b/src/Compatibility/Core/src/iOS/VisualElementRenderer.cs @@ -3,11 +3,11 @@ using System.ComponentModel; using RectangleF = CoreGraphics.CGRect; using SizeF = CoreGraphics.CGSize; -using Microsoft.Maui.Controls.Compatibility.Internals; using CoreAnimation; using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Controls.Platform; #if __MOBILE__ using UIKit; diff --git a/src/Compatibility/Core/src/iOS/VisualElementTracker.cs b/src/Compatibility/Core/src/iOS/VisualElementTracker.cs index 33b4733f05c8..39cb647e6882 100644 --- a/src/Compatibility/Core/src/iOS/VisualElementTracker.cs +++ b/src/Compatibility/Core/src/iOS/VisualElementTracker.cs @@ -266,7 +266,7 @@ void update() #endif // must reset transform prior to setting frame... - if(caLayer.AnchorPoint != _originalAnchor) + if (caLayer.AnchorPoint != _originalAnchor) caLayer.AnchorPoint = _originalAnchor; caLayer.Transform = transform; @@ -489,6 +489,6 @@ bool ShouldUpdateClip() return true; return false; - } + } } } \ No newline at end of file diff --git a/src/Compatibility/Core/tests/WinUI/BackgroundColorTests.cs b/src/Compatibility/Core/tests/WinUI/BackgroundColorTests.cs index f100e59b7770..943fe4347683 100644 --- a/src/Compatibility/Core/tests/WinUI/BackgroundColorTests.cs +++ b/src/Compatibility/Core/tests/WinUI/BackgroundColorTests.cs @@ -1,13 +1,13 @@ using System.Collections; using System.Linq; using System.Threading.Tasks; -using NUnit.Framework; +using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.Maui.Graphics; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media; -using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using NUnit.Framework; using WColor = Windows.UI.Color; using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush; -using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { diff --git a/src/Compatibility/Core/tests/WinUI/ColorTests.cs b/src/Compatibility/Core/tests/WinUI/ColorTests.cs index 24fb1ea9260b..f5db20b19bf0 100644 --- a/src/Compatibility/Core/tests/WinUI/ColorTests.cs +++ b/src/Compatibility/Core/tests/WinUI/ColorTests.cs @@ -1,6 +1,6 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; using Microsoft.Maui.Graphics; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { @@ -8,7 +8,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests public class ColorTests { [Test, Category("Color")] - public void PrimaryColorConversions() + public void PrimaryColorConversions() { // 11:15, restate my assumptions... diff --git a/src/Compatibility/Core/tests/WinUI/Compatibility.Windows.UnitTests.csproj b/src/Compatibility/Core/tests/WinUI/Compatibility.Windows.UnitTests.csproj index 7e154921d89c..ebe7596c7dbe 100644 --- a/src/Compatibility/Core/tests/WinUI/Compatibility.Windows.UnitTests.csproj +++ b/src/Compatibility/Core/tests/WinUI/Compatibility.Windows.UnitTests.csproj @@ -4,7 +4,7 @@ 10.0.17134.0 Microsoft.Maui.Controls.Compatibility.UAP.UnitTests win10-x86;win10-x64;win10-arm64 - $(DefineConstants);DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP;UWP_16299 + $(DefineConstants);DEBUG;TRACE;NETFX_CORE;WINDOWS;UWP_16299 1701;1702;CS8305;8305;CA1416 @@ -62,7 +62,7 @@ full false bin\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS prompt 4 @@ -71,7 +71,7 @@ pdbonly true bin\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS prompt 4 @@ -79,7 +79,7 @@ x86 true bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full false @@ -88,7 +88,7 @@ x86 bin\x86\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly @@ -99,7 +99,7 @@ ARM true bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full false @@ -108,7 +108,7 @@ ARM bin\ARM\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly @@ -119,7 +119,7 @@ ARM64 true bin\ARM64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full false @@ -128,7 +128,7 @@ ARM64 bin\ARM64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly @@ -139,7 +139,7 @@ x64 true bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full false @@ -148,7 +148,7 @@ x64 bin\x64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly diff --git a/src/Compatibility/Core/tests/WinUI/EmbeddingTests.cs b/src/Compatibility/Core/tests/WinUI/EmbeddingTests.cs index 5e645454ff87..e95645021ccf 100644 --- a/src/Compatibility/Core/tests/WinUI/EmbeddingTests.cs +++ b/src/Compatibility/Core/tests/WinUI/EmbeddingTests.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using NUnit.Framework; -using Microsoft.UI.Xaml; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.UI.Xaml; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { @@ -12,7 +12,8 @@ public class EmbeddingTests public async Task CanCreateFrameworkElementFromContentPage() { var contentPage = new ContentPage { Title = "Embedded Page" }; - await Device.InvokeOnMainThreadAsync(() => { + await Device.InvokeOnMainThreadAsync(() => + { FrameworkElement frameworkElement = contentPage.CreateFrameworkElement(); }); } diff --git a/src/Compatibility/Core/tests/WinUI/FlowDirectionTests.cs b/src/Compatibility/Core/tests/WinUI/FlowDirectionTests.cs index 57fad702effa..07d720751806 100644 --- a/src/Compatibility/Core/tests/WinUI/FlowDirectionTests.cs +++ b/src/Compatibility/Core/tests/WinUI/FlowDirectionTests.cs @@ -1,8 +1,8 @@ +using System; using System.Threading.Tasks; using NUnit.Framework; -using WTextAlignment = Microsoft.UI.Xaml.TextAlignment; using WFlowDirection = Microsoft.UI.Xaml.FlowDirection; -using System; +using WTextAlignment = Microsoft.UI.Xaml.TextAlignment; namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { @@ -26,7 +26,8 @@ public async Task EntryAlignmentMatchesFlowDirection(bool isExpl contentPage.FlowDirection = flowDirection; } - var nativeAlignment = await Device.InvokeOnMainThreadAsync(() => { + var nativeAlignment = await Device.InvokeOnMainThreadAsync(() => + { if (!isExplicit) { GetRenderer(contentPage); @@ -38,7 +39,7 @@ public async Task EntryAlignmentMatchesFlowDirection(bool isExpl return nativeAlignment; } - async Task> GetEditorAlignmentAndFlowDirection(bool isExplicit, FlowDirection flowDirection) + async Task> GetEditorAlignmentAndFlowDirection(bool isExplicit, FlowDirection flowDirection) { var editor = new Editor { Text = " تسجيل الدخول" }; var contentPage = new ContentPage { Title = "Flow Direction", Content = editor }; @@ -52,7 +53,8 @@ async Task> GetEditorAlignmentAndFlowDirec contentPage.FlowDirection = flowDirection; } - var (nativeAlignment, nativeFlowDirection) = await Device.InvokeOnMainThreadAsync(() => { + var (nativeAlignment, nativeFlowDirection) = await Device.InvokeOnMainThreadAsync(() => + { if (!isExplicit) { GetRenderer(contentPage); diff --git a/src/Compatibility/Core/tests/WinUI/IsEnabledTests.cs b/src/Compatibility/Core/tests/WinUI/IsEnabledTests.cs index 9b34017d8254..06d899c9bb0c 100644 --- a/src/Compatibility/Core/tests/WinUI/IsEnabledTests.cs +++ b/src/Compatibility/Core/tests/WinUI/IsEnabledTests.cs @@ -5,7 +5,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { [TestFixture] - public class IsEnabledTests : PlatformTestFixture + public class IsEnabledTests : PlatformTestFixture { static IEnumerable TestCases { diff --git a/src/Compatibility/Core/tests/WinUI/PlatformTestFixture.cs b/src/Compatibility/Core/tests/WinUI/PlatformTestFixture.cs index 2bc24ee6708f..07b5f0e175eb 100644 --- a/src/Compatibility/Core/tests/WinUI/PlatformTestFixture.cs +++ b/src/Compatibility/Core/tests/WinUI/PlatformTestFixture.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using NUnit.Framework; -using Microsoft.UI.Xaml.Controls; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using Microsoft.UI.Xaml.Controls; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { @@ -53,18 +53,18 @@ protected Control GetNativeControl(VisualElement element) return GetRenderer(element).GetNativeElement() as Control; } - protected Panel GetPanel(VisualElement element) + protected Panel GetPanel(VisualElement element) { return GetRenderer(element).ContainerElement as Panel; } - protected Border GetBorder(VisualElement element) + protected Border GetBorder(VisualElement element) { var renderer = GetRenderer(element); var nativeElement = renderer.GetNativeElement(); return nativeElement as Border; } - + protected TextBlock GetNativeControl(Label label) { return GetRenderer(label).GetNativeElement() as TextBlock; @@ -72,7 +72,8 @@ protected TextBlock GetNativeControl(Label label) protected async Task GetControlProperty(Label label, Func getProperty) { - return await Device.InvokeOnMainThreadAsync(() => { + return await Device.InvokeOnMainThreadAsync(() => + { var textBlock = GetNativeControl(label); return getProperty(textBlock); }); @@ -96,7 +97,8 @@ protected FormsTextBox GetNativeControl(Editor editor) protected async Task GetRendererProperty(View view, Func getProperty) { - return await Device.InvokeOnMainThreadAsync(() => { + return await Device.InvokeOnMainThreadAsync(() => + { var renderer = GetRenderer(view); return getProperty(renderer); }); diff --git a/src/Compatibility/Core/tests/WinUI/RotationTests.cs b/src/Compatibility/Core/tests/WinUI/RotationTests.cs index 099fd6929db0..f16b209f3c55 100644 --- a/src/Compatibility/Core/tests/WinUI/RotationTests.cs +++ b/src/Compatibility/Core/tests/WinUI/RotationTests.cs @@ -1,14 +1,14 @@ using System; using System.Collections; using System.Threading.Tasks; -using NUnit.Framework; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Media; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { [TestFixture] - public class RotationTests : PlatformTestFixture + public class RotationTests : PlatformTestFixture { static IEnumerable RotationXCases { @@ -73,7 +73,7 @@ public async Task RotationConsistent(View view) Assert.That(actual, Is.EqualTo(expected)); } - double GetRotationX(FrameworkElement fe) + double GetRotationX(FrameworkElement fe) { if (fe.Projection is PlaneProjection planeProjection) { diff --git a/src/Compatibility/Core/tests/WinUI/ScaleTests.cs b/src/Compatibility/Core/tests/WinUI/ScaleTests.cs index 4b91cd801574..c4b6c8344839 100644 --- a/src/Compatibility/Core/tests/WinUI/ScaleTests.cs +++ b/src/Compatibility/Core/tests/WinUI/ScaleTests.cs @@ -1,9 +1,9 @@ using System; using System.Collections; using System.Threading.Tasks; -using NUnit.Framework; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Media; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { diff --git a/src/Compatibility/Core/tests/WinUI/ScrollBarVisibilityTests.cs b/src/Compatibility/Core/tests/WinUI/ScrollBarVisibilityTests.cs index d320b5ff0821..a479e15e7ff2 100644 --- a/src/Compatibility/Core/tests/WinUI/ScrollBarVisibilityTests.cs +++ b/src/Compatibility/Core/tests/WinUI/ScrollBarVisibilityTests.cs @@ -1,5 +1,5 @@ -using NUnit.Framework; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using NUnit.Framework; namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests { diff --git a/src/Compatibility/Core/tests/WinUI/ShellTests.cs b/src/Compatibility/Core/tests/WinUI/ShellTests.cs index e0104c1113f4..c8f94981c238 100644 --- a/src/Compatibility/Core/tests/WinUI/ShellTests.cs +++ b/src/Compatibility/Core/tests/WinUI/ShellTests.cs @@ -3,10 +3,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using NUnit.Framework; using Microsoft.Maui.Controls.Compatibility; using Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests; using Microsoft.Maui.Controls.Compatibility.Platform.UWP; +using NUnit.Framework; [assembly: ExportRenderer(typeof(TestShell), typeof(TestShellRenderer))] namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.UnitTests @@ -33,7 +33,7 @@ await Device.InvokeOnMainThreadAsync(() => var r = GetRenderer(shell); }); } - catch (Exception exc) + catch (Exception exc) { Assert.Fail(exc.ToString()); } @@ -68,8 +68,8 @@ Shell CreateShell() } } - public class TestShell : Shell { } - + public class TestShell : Shell { } + public class TestShellRenderer : ShellRenderer { } diff --git a/src/Compatibility/Maps/src/UWP/Compatibility.Maps.UWP.csproj b/src/Compatibility/Maps/src/UWP/Compatibility.Maps.UWP.csproj index e2437ce16ec6..d0200a24760e 100644 --- a/src/Compatibility/Maps/src/UWP/Compatibility.Maps.UWP.csproj +++ b/src/Compatibility/Maps/src/UWP/Compatibility.Maps.UWP.csproj @@ -8,12 +8,12 @@ false - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS true bin\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS diff --git a/src/Controls/DualScreen/sample/DualScreen.UWP/DualScreen.UWP.csproj b/src/Controls/DualScreen/sample/DualScreen.UWP/DualScreen.UWP.csproj index bc44d1067c54..9f1516b5fdd6 100644 --- a/src/Controls/DualScreen/sample/DualScreen.UWP/DualScreen.UWP.csproj +++ b/src/Controls/DualScreen/sample/DualScreen.UWP/DualScreen.UWP.csproj @@ -22,7 +22,7 @@ true bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full ARM @@ -32,7 +32,7 @@ bin\ARM\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly @@ -45,7 +45,7 @@ true bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full x64 @@ -55,7 +55,7 @@ bin\x64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly @@ -68,7 +68,7 @@ true bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + DEBUG;TRACE;NETFX_CORE;WINDOWS ;2008 full x86 @@ -78,7 +78,7 @@ bin\x86\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP + TRACE;NETFX_CORE;WINDOWS true ;2008 pdbonly diff --git a/src/Controls/samples/Controls.Sample.SingleProject/MainWindow.cs b/src/Controls/samples/Controls.Sample.SingleProject/MainWindow.cs index 8aad3f92d9f3..a8a88a8d8b74 100644 --- a/src/Controls/samples/Controls.Sample.SingleProject/MainWindow.cs +++ b/src/Controls/samples/Controls.Sample.SingleProject/MainWindow.cs @@ -1,17 +1,13 @@ using Microsoft.Maui; +using Microsoft.Maui.Controls; namespace Maui.Controls.Sample.SingleProject { - public class MainWindow : IWindow + public class MainWindow : Window { - public MainWindow() + static bool useBlazor = false; + public MainWindow() : base(useBlazor ? new BlazorPage() : new MainPage()) { - var useBlazor = false; - Page = useBlazor ? new BlazorPage() : new MainPage(); } - - public IPage Page { get; set; } - - public IMauiContext MauiContext { get; set; } } } \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj b/src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj index 5e22a7797428..c49e5806972d 100644 --- a/src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj +++ b/src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj @@ -40,7 +40,7 @@ - + \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample.SingleProject/MyApp.cs b/src/Controls/samples/Controls.Sample.SingleProject/MyApp.cs index 8cba5f934cc0..b4cdfd67edf2 100644 --- a/src/Controls/samples/Controls.Sample.SingleProject/MyApp.cs +++ b/src/Controls/samples/Controls.Sample.SingleProject/MyApp.cs @@ -1,14 +1,20 @@ using Microsoft.Maui; +using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; namespace Maui.Controls.Sample.SingleProject { public class MyApp : IApplication { + List _windows = new List(); + public IReadOnlyList Windows => _windows.AsReadOnly(); + public IWindow CreateWindow(IActivationState activationState) { Microsoft.Maui.Controls.Compatibility.Forms.Init(activationState); - - return new MainWindow(); + var window = new MainWindow(); + _windows.Add(window); + return window; } } } \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample.WinUI (Package)/Maui.Controls.Sample.WinUI (Package).wapproj b/src/Controls/samples/Controls.Sample.WinUI (Package)/Maui.Controls.Sample.WinUI (Package).wapproj index a389a392ae6a..edb3050cd2ed 100644 --- a/src/Controls/samples/Controls.Sample.WinUI (Package)/Maui.Controls.Sample.WinUI (Package).wapproj +++ b/src/Controls/samples/Controls.Sample.WinUI (Package)/Maui.Controls.Sample.WinUI (Package).wapproj @@ -3,9 +3,6 @@ 15.0 - - true - Debug @@ -41,6 +38,7 @@ 503b7824-7376-450b-9ef7-ea587df2c8be 10.0.19041.0 10.0.17763.0 + net6.0-windows$(TargetPlatformVersion);$(AssetTargetFallback) en-US false $(MSBuildThisFileDirectory)build\ diff --git a/src/Controls/samples/Controls.Sample.iOS/Controls.Sample.iOS.csproj b/src/Controls/samples/Controls.Sample.iOS/Controls.Sample.iOS.csproj index 3369fef720b3..9d2c1bb42bd8 100644 --- a/src/Controls/samples/Controls.Sample.iOS/Controls.Sample.iOS.csproj +++ b/src/Controls/samples/Controls.Sample.iOS/Controls.Sample.iOS.csproj @@ -70,9 +70,6 @@ - - - diff --git a/src/Controls/samples/Controls.Sample/Controls.Sample.csproj b/src/Controls/samples/Controls.Sample/Controls.Sample.csproj index ed0ef7d6176f..9b4096475953 100644 --- a/src/Controls/samples/Controls.Sample/Controls.Sample.csproj +++ b/src/Controls/samples/Controls.Sample/Controls.Sample.csproj @@ -1,13 +1,15 @@ - + - MonoAndroid10.0;Xamarin.iOS10 + $(NonNet6Platforms) + + @@ -25,16 +27,14 @@ + + + - - - - - SemanticsPage.xaml - + diff --git a/src/Controls/samples/Controls.Sample/Controls/BasePage.cs b/src/Controls/samples/Controls.Sample/Controls/BasePage.cs index 61fedff57dd8..b542df270d29 100644 --- a/src/Controls/samples/Controls.Sample/Controls/BasePage.cs +++ b/src/Controls/samples/Controls.Sample/Controls/BasePage.cs @@ -6,5 +6,14 @@ namespace Maui.Controls.Sample.Controls public class BasePage : ContentPage, IPage { + protected override void OnAppearing() + { + System.Diagnostics.Debug.WriteLine($"OnAppearing: {this}"); + } + + protected override void OnDisappearing() + { + System.Diagnostics.Debug.WriteLine($"OnDisappearing: {this}"); + } } } \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButton.cs b/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButton.cs new file mode 100644 index 000000000000..890476929219 --- /dev/null +++ b/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButton.cs @@ -0,0 +1,12 @@ +using Microsoft.Maui.Controls; + +namespace Maui.Controls.Sample.Controls +{ + public class RedButton : Button + { + static RedButton() + { + RedServiceBuilder.TryAddHandler(); + } + } +} \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButtonAppHostBuilderExtensions.cs b/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButtonAppHostBuilderExtensions.cs new file mode 100644 index 000000000000..e7fadcff1a78 --- /dev/null +++ b/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButtonAppHostBuilderExtensions.cs @@ -0,0 +1,15 @@ +using System; +using Microsoft.Maui.Hosting; + +namespace Maui.Controls.Sample.Controls +{ + static class RedButtonAppHostBuilderExtensions + { + public static IAppHostBuilder UseRed(this IAppHostBuilder builder, Action configureDelegate = null) + { + builder.ConfigureServices((ctx, red) => configureDelegate?.Invoke(red)); + + return builder; + } + } +} \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButtonHandler.cs b/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButtonHandler.cs new file mode 100644 index 000000000000..0129c76e4edd --- /dev/null +++ b/src/Controls/samples/Controls.Sample/Controls/RedButton/RedButtonHandler.cs @@ -0,0 +1,41 @@ +using Microsoft.Maui; +using Microsoft.Maui.Graphics; +using Microsoft.Maui.Handlers; + +namespace Maui.Controls.Sample.Controls +{ + public partial class RedButtonHandler : ButtonHandler + { + public static PropertyMapper RedButtonMapper = new PropertyMapper(ButtonHandler.ButtonMapper) + { + [nameof(IButton.Background)] = MapBackground, + }; + + public RedButtonHandler() + : base(RedButtonMapper) + { + } + + public RedButtonHandler(PropertyMapper mapper = null) + : base(mapper ?? RedButtonMapper) + { + } + +#if __ANDROID__ + public static void MapBackground(RedButtonHandler handler, RedButton redButton) + { + handler.NativeView.SetBackgroundColor(Colors.Red.ToNative()); + } +#elif __IOS__ + public static void MapBackground(RedButtonHandler handler, RedButton redButton) + { + handler.NativeView.BackgroundColor = Colors.Red.ToNative(); + } +#elif WINDOWS + public static void MapBackground(RedButtonHandler handler, RedButton redButton) + { + handler.NativeView.Background = Colors.Red.ToNative(); + } +#endif + } +} \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Controls/RedButton/RedServiceBuilder.cs b/src/Controls/samples/Controls.Sample/Controls/RedButton/RedServiceBuilder.cs new file mode 100644 index 000000000000..ef0411008dec --- /dev/null +++ b/src/Controls/samples/Controls.Sample/Controls/RedButton/RedServiceBuilder.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace Maui.Controls.Sample.Controls +{ + class RedServiceBuilder : IMauiServiceBuilder + { + static IMauiHandlersCollection handlersCollection; + static Dictionary pendingHandlers = new(); + + public static void TryAddHandler() + where TType : IFrameworkElement + where TTypeRender : IViewHandler + { + if (handlersCollection == null) + pendingHandlers[typeof(TType)] = typeof(TTypeRender); + else + handlersCollection.TryAddHandler(); + } + + void IMauiServiceBuilder.ConfigureServices(HostBuilderContext context, IServiceCollection services) + { + // no-op + } + + void IMauiServiceBuilder.Configure(HostBuilderContext context, IServiceProvider services) + { + handlersCollection ??= services.GetRequiredService().GetCollection(); + + if (pendingHandlers.Count > 0) + { + handlersCollection.TryAddHandlers(pendingHandlers); + pendingHandlers.Clear(); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Controls/Window.cs b/src/Controls/samples/Controls.Sample/Controls/Window.cs deleted file mode 100644 index a85ea55c7ae9..000000000000 --- a/src/Controls/samples/Controls.Sample/Controls/Window.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.Maui; - -namespace Maui.Controls.Sample.Controls -{ - public class Window : IWindow - { - public IPage Page { get; set; } - - public IMauiContext MauiContext { get; set; } - } -} diff --git a/src/Controls/samples/Controls.Sample/Extensions/EssentialsExtensions.cs b/src/Controls/samples/Controls.Sample/Extensions/EssentialsExtensions.cs index 96271d41f22a..0a3fd4ad913c 100644 --- a/src/Controls/samples/Controls.Sample/Extensions/EssentialsExtensions.cs +++ b/src/Controls/samples/Controls.Sample/Extensions/EssentialsExtensions.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; using Microsoft.Maui.Hosting; using Microsoft.Maui.LifecycleEvents; @@ -119,14 +120,23 @@ public void ConfigureServices(HostBuilderContext context, IServiceCollection ser public async void Configure(HostBuilderContext context, IServiceProvider services) { #if WINDOWS - // Platform.MapServiceToken = _mapServiceToken; + Platform.MapServiceToken = _mapServiceToken; #elif __ANDROID__ SecureStorage.LegacyKeyHashFallback = _useLegaceSecureStorage; #endif AppActions.OnAppAction += HandleOnAppAction; - await AppActions.SetAsync(_appActions); + try + { + await AppActions.SetAsync(_appActions); + } + catch (FeatureNotSupportedException ex) + { + services.GetService()? + .CreateLogger()? + .LogError(ex, "App Actions are not supported on this platform."); + } if (_trackVersions) VersionTracking.Track(); diff --git a/src/Controls/samples/Controls.Sample/MainWindow.cs b/src/Controls/samples/Controls.Sample/MainWindow.cs deleted file mode 100644 index 5059d7ab1539..000000000000 --- a/src/Controls/samples/Controls.Sample/MainWindow.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Maui.Controls.Sample.Controls; -using Microsoft.Maui; - -namespace Maui.Controls.Sample -{ - public class MainWindow : Window - { - public MainWindow(IPage page) - { - Page = page; - } - } -} \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Maui.Controls.Sample-net6.csproj b/src/Controls/samples/Controls.Sample/Maui.Controls.Sample-net6.csproj index 98d6be1d4af4..a64342e54dd9 100644 --- a/src/Controls/samples/Controls.Sample/Maui.Controls.Sample-net6.csproj +++ b/src/Controls/samples/Controls.Sample/Maui.Controls.Sample-net6.csproj @@ -11,12 +11,14 @@ $(NoWarn);CA1416;CS8305 - $(DefineConstants);WINDOWS_UWP;WINDOWS + $(DefineConstants);WINDOWS + + @@ -37,10 +39,14 @@ + + + + diff --git a/src/Controls/samples/Controls.Sample/MyApp.cs b/src/Controls/samples/Controls.Sample/MyApp.cs index a8f23aa0dce3..c212248c739f 100644 --- a/src/Controls/samples/Controls.Sample/MyApp.cs +++ b/src/Controls/samples/Controls.Sample/MyApp.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using Maui.Controls.Sample.Services; using Microsoft.Extensions.DependencyInjection; @@ -8,20 +9,25 @@ namespace Maui.Controls.Sample { public class MyApp : IApplication { - public MyApp(IServiceProvider services, ITextService textService) + readonly List _windows = new(); + + public MyApp(IServiceProvider services, ITextService textService, IImageSourceServiceConfiguration imageConfig) { Services = services; - Debug.WriteLine($"The injected text service had a message: '{textService.GetText()}'"); + imageConfig.SetImageDirectory("Assets"); } + public IReadOnlyList Windows => _windows.AsReadOnly(); + public IServiceProvider Services { get; } public IWindow CreateWindow(IActivationState activationState) { Microsoft.Maui.Controls.Compatibility.Forms.Init(activationState); - - return Services.GetRequiredService(); + var window = Services.GetRequiredService(); + _windows.Add(window); + return window; } } } \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Pages/MainPage.cs b/src/Controls/samples/Controls.Sample/Pages/MainPage.cs index bbbb6a15aeac..e636a324877f 100644 --- a/src/Controls/samples/Controls.Sample/Pages/MainPage.cs +++ b/src/Controls/samples/Controls.Sample/Pages/MainPage.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using Maui.Controls.Sample.Controls; using Maui.Controls.Sample.ViewModel; @@ -10,6 +11,7 @@ using Microsoft.Maui.Graphics; using Microsoft.Maui.LifecycleEvents; using Debug = System.Diagnostics.Debug; +using GradientStop = Microsoft.Maui.Controls.GradientStop; namespace Maui.Controls.Sample.Pages { @@ -20,28 +22,60 @@ public class MainPage : BasePage public MainPage(IServiceProvider services, MainPageViewModel viewModel) { + BackgroundColor = Colors.White; + ToolbarItems.Add(new ToolbarItem() + { + Text = "Page" + }); + + Title = "Welcome to the Samples"; _services = services; BindingContext = _viewModel = viewModel; SetupMauiLayout(); + + NavigationPage.SetHasNavigationBar(this, false); + //SetupCompatibilityLayout(); + //SetupVisibilityTest(); } - const string loremIpsum = - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + - "Quisque ut dolor metus. Duis vel iaculis mauris, sit amet finibus mi. " + - "Etiam congue ornare risus, in facilisis libero tempor eget. " + - "Phasellus mattis mollis libero ut semper. In sit amet sapien odio. " + - "Sed interdum ullamcorper dui eu rutrum. Vestibulum non sagittis justo. " + - "Cras rutrum scelerisque elit, et porta est lobortis ac. " + - "Pellentesque eu ornare tortor. Sed bibendum a nisl at laoreet."; + public class VisibilityLabel : Label, IFrameworkElement + { + private Visibility _visibility; + + public void SetVisibility(Visibility visibility) + { + _visibility = visibility; + Handler?.UpdateValue(nameof(Visibility)); + } + + Visibility IFrameworkElement.Visibility + { + get + { + return _visibility; + } + } + } + + const string LoremIpsum = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + + "Quisque ut dolor metus. Duis vel iaculis mauris, sit amet finibus mi. " + + "Etiam congue ornare risus, in facilisis libero tempor eget. " + + "Phasellus mattis mollis libero ut semper. In sit amet sapien odio. " + + "Sed interdum ullamcorper dui eu rutrum. Vestibulum non sagittis justo. " + + "Cras rutrum scelerisque elit, et porta est lobortis ac. " + + "Pellentesque eu ornare tortor. Sed bibendum a nisl at laoreet."; void SetupMauiLayout() { var verticalStack = new VerticalStackLayout() { Spacing = 5, BackgroundColor = Colors.AntiqueWhite }; var horizontalStack = new HorizontalStackLayout() { Spacing = 2, BackgroundColor = Colors.CornflowerBlue }; - verticalStack.Add(CreateSampleGrid()); + //verticalStack.Add(CreateSampleGrid()); + verticalStack.Add(CreateResizingButton()); + AddTextResizeDemo(verticalStack); verticalStack.Add(new Label { Text = " ", Padding = new Thickness(10) }); @@ -58,24 +92,51 @@ void SetupMauiLayout() verticalStack.Add(new Label { Text = "This should be BOLD text!", FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.Center }); verticalStack.Add(new Label { Text = "This should have character spacing!", CharacterSpacing = 3 }); verticalStack.Add(new Label { Text = "This should be a CUSTOM font!", FontFamily = "Dokdo" }); + verticalStack.Add( + new Button + { + Text = "Push a Page", + Command = new Command(async () => + { + await Navigation.PushAsync(new SemanticsPage()); + }) + } + ); - -#if __ANDROID__ - string fontFamily = "ionicons.ttf#"; -#elif WINDOWS - string fontFamily = "Assets/ionicons.ttf#ionicons"; -#else - string fontFamily = "Ionicons"; -#endif - - verticalStack.Add(new Image { Source = new FontImageSource() { FontFamily = fontFamily, Glyph = '\uf2fe'.ToString() } }); verticalStack.Add(new Label { Text = "This should have padding", Padding = new Thickness(40), BackgroundColor = Colors.LightBlue }); - verticalStack.Add(new Label { Text = loremIpsum }); - verticalStack.Add(new Label { Text = loremIpsum, MaxLines = 2 }); - verticalStack.Add(new Label { Text = loremIpsum, LineBreakMode = LineBreakMode.TailTruncation }); - verticalStack.Add(new Label { Text = loremIpsum, MaxLines = 2, LineBreakMode = LineBreakMode.TailTruncation }); - verticalStack.Add(new Label { Text = "This should have five times the line height! " + loremIpsum, LineHeight = 5, MaxLines = 2 }); - verticalStack.Add(new Editor { Text = "Start", HorizontalTextAlignment = TextAlignment.Start }); + verticalStack.Add(new Label { Text = LoremIpsum }); + verticalStack.Add(new Label { Text = LoremIpsum, MaxLines = 2 }); + verticalStack.Add(new Label { Text = LoremIpsum, LineBreakMode = LineBreakMode.TailTruncation }); + verticalStack.Add(new Label { Text = LoremIpsum, MaxLines = 2, LineBreakMode = LineBreakMode.TailTruncation }); + verticalStack.Add(new Label { Text = "This should have five times the line height! " + LoremIpsum, LineHeight = 5, MaxLines = 2 }); + verticalStack.Add(new Label + { + FontSize = 24, + Text = "LinearGradient Text", + Background = new LinearGradientBrush( + new GradientStopCollection + { + new GradientStop(Colors.Green, 0), + new GradientStop(Colors.Blue, 1) + }, + new Point(0, 0), + new Point(1, 0)) + }); + verticalStack.Add(new Label + { + Text = "RadialGradient", + Padding = new Thickness(30), + Background = new RadialGradientBrush( + new GradientStopCollection + { + new GradientStop(Colors.DarkBlue, 0), + new GradientStop(Colors.Yellow, 0.6f), + new GradientStop(Colors.LightPink, 1) + }, + new Point(0.5, 0.5), + 0.3f) + }); + verticalStack.Add(new Editor { Text = "Start", HorizontalTextAlignment = TextAlignment.Start }); verticalStack.Add(new Editor { Text = "End", HorizontalTextAlignment = TextAlignment.End }); verticalStack.Add(new Editor { Text = "Center", HorizontalTextAlignment = TextAlignment.Center }); @@ -132,6 +193,8 @@ void SetupMauiLayout() verticalStack.Add(new Button { Text = "CharacterSpacing" }); verticalStack.Add(new Button { CharacterSpacing = 8, Text = "CharacterSpacing" }); + verticalStack.Add(new RedButton { Text = "Dynamically Registered" }); + var checkbox = new CheckBox(); checkbox.CheckedChanged += (sender, e) => { @@ -141,11 +204,17 @@ void SetupMauiLayout() verticalStack.Add(new CheckBox { BackgroundColor = Colors.LightPink }); verticalStack.Add(new CheckBox { IsChecked = true, Color = Colors.Aquamarine }); - verticalStack.Add(new Editor()); + var editor = new Editor(); + editor.Completed += (sender, args) => + { + Debug.WriteLine($"Editor Completed"); + }; + + verticalStack.Add(editor); verticalStack.Add(new Editor { Text = "Editor" }); verticalStack.Add(new Editor { Text = "Lorem ipsum dolor sit amet", MaxLength = 10 }); verticalStack.Add(new Editor { Text = "Predictive Text Off", IsTextPredictionEnabled = false }); - verticalStack.Add(new Editor { Text = "Lorem ipsum dolor sit amet", FontSize = 10, FontFamily = "dokdo_regular" }); + verticalStack.Add(new Editor { Text = "Lorem ipsum dolor sit amet", FontSize = 10, FontFamily = "Dokdo" }); verticalStack.Add(new Editor { Text = "ReadOnly Editor", IsReadOnly = true }); @@ -172,13 +241,17 @@ void SetupMauiLayout() verticalStack.Add(new ProgressBar { Progress = 0.5, BackgroundColor = Colors.LightCoral }); verticalStack.Add(new ProgressBar { Progress = 0.5, ProgressColor = Colors.Purple }); - var searchBar = new SearchBar(); - searchBar.CharacterSpacing = 4; - searchBar.Text = "A search query"; + var searchBar = new SearchBar + { + CharacterSpacing = 4, + Text = "A search query" + }; verticalStack.Add(searchBar); - var placeholderSearchBar = new SearchBar(); - placeholderSearchBar.Placeholder = "Placeholder"; + var placeholderSearchBar = new SearchBar + { + Placeholder = "Placeholder" + }; verticalStack.Add(placeholderSearchBar); var monkeyList = new List @@ -192,7 +265,7 @@ void SetupMauiLayout() "Japanese Macaque" }; - var picker = new Picker { Title = "Select a monkey", FontFamily = "Dokdo", HorizontalTextAlignment = TextAlignment.Center}; + var picker = new Picker { Title = "Select a monkey", FontFamily = "Dokdo", HorizontalTextAlignment = TextAlignment.Center }; picker.ItemsSource = monkeyList; verticalStack.Add(picker); @@ -215,7 +288,8 @@ void SetupMauiLayout() verticalStack.Add(new TimePicker()); verticalStack.Add(new TimePicker { Time = TimeSpan.FromHours(8), CharacterSpacing = 6 }); - verticalStack.Add(new Image() { Source = "dotnet_bot.png" }); + verticalStack.Add(new Label { Text = "IMAGES (static | animated):" }); + verticalStack.Add(CreateImagesGrid()); Content = new ScrollView { @@ -223,6 +297,51 @@ void SetupMauiLayout() }; } + Button CreateResizingButton() + { + var initialWidth = 200; + var otherWidth = 100; + + var initialHeight = 80; + var otherHeight = 140; + + var count = 1; + + var resizeButton = new Button + { + Text = "Resize", + BackgroundColor = Colors.Gray, + WidthRequest = initialWidth, + HeightRequest = initialHeight + }; + + resizeButton.Clicked += (sender, args) => + { + + count += 1; + + if (count == 1) + { + resizeButton.WidthRequest = initialWidth; + resizeButton.HeightRequest = initialHeight; + } + else if (count == 2) + { + resizeButton.WidthRequest = otherWidth; + resizeButton.HeightRequest = otherHeight; + } + else + { + // Go back to using whatever the layout gives us + resizeButton.WidthRequest = -1; + resizeButton.HeightRequest = -1; + count = 0; + } + }; + + return resizeButton; + } + void SetupCompatibilityLayout() { var verticalStack = new StackLayout() { Spacing = 5, BackgroundColor = Colors.AntiqueWhite }; @@ -262,6 +381,78 @@ void SetupCompatibilityLayout() Content = verticalStack; } + IView CreateImagesGrid() + { + var layout = new Microsoft.Maui.Controls.Layout2.GridLayout { ColumnSpacing = 10, RowSpacing = 10, Margin = 10 }; + + layout.AddRowDefinition(new RowDefinition { Height = GridLength.Auto }); + layout.AddRowDefinition(new RowDefinition { Height = new GridLength(120) }); + layout.AddRowDefinition(new RowDefinition { Height = GridLength.Auto }); + layout.AddRowDefinition(new RowDefinition { Height = new GridLength(120) }); + layout.AddRowDefinition(new RowDefinition { Height = GridLength.Auto }); + layout.AddRowDefinition(new RowDefinition { Height = new GridLength(120) }); + layout.AddRowDefinition(new RowDefinition { Height = GridLength.Auto }); + layout.AddRowDefinition(new RowDefinition { Height = new GridLength(120) }); + layout.AddRowDefinition(new RowDefinition { Height = GridLength.Auto }); + layout.AddRowDefinition(new RowDefinition { Height = new GridLength(120) }); + + layout.AddColumnDefinition(new ColumnDefinition { Width = new GridLength(120) }); + layout.AddColumnDefinition(new ColumnDefinition { Width = new GridLength(120) }); + + var row = -1; + + Add(new Label { Text = "App Bundle", WidthRequest = 150 }, row: (row += 2) - 1, col: 0, colSpan: 2); + Add(new Image { Source = "dotnet_bot.png" }, row: row, col: 0); + Add(new Image { Source = "animated_heart.gif", IsAnimationPlaying = true }, row: row, col: 1); + + Add(new Label { Text = "File", WidthRequest = 150 }, row: (row += 2) - 1, col: 0, colSpan: 2); + Add(new Image { Source = CopyLocal("dotnet_bot.png") }, row: row, col: 0); + Add(new Image { Source = CopyLocal("animated_heart.gif"), IsAnimationPlaying = true }, row: row, col: 1); + + Add(new Label { Text = "Font", WidthRequest = 150 }, row: (row += 2) - 1, col: 0, colSpan: 2); + Add(new Image { Source = new FontImageSource { FontFamily = "Ionicons", Glyph = "\uf2fe" }, BackgroundColor = Color.FromUint(0xFF512BD4), Aspect = Aspect.Center }, row: row, col: 0); + Add(new Image { Source = new FontImageSource { FontFamily = "Dokdo", Glyph = "M" }, BackgroundColor = Color.FromUint(0xFF512BD4), Aspect = Aspect.Center }, row: row, col: 1); + + Add(new Label { Text = "URI", WidthRequest = 150 }, row: (row += 2) - 1, col: 0, colSpan: 2); + Add(new Image { Source = "https://raw.githubusercontent.com/dotnet-foundation/swag/05cc70d33fa8c310147b9bd70ae9e103a072cae0/dotnet-bot/dotnet-bot-pot.png" }, row: row, col: 0); + Add(new Image { Source = "https://raw.githubusercontent.com/mono/SkiaSharp/6753bfad91dce1894c69084555dab6494efa90eb/samples/Gallery/Shared/Media/animated-heart.gif", IsAnimationPlaying = true }, row: row, col: 1); + + Add(new Label { Text = "Stream", WidthRequest = 150 }, row: (row += 2) - 1, col: 0, colSpan: 2); + Add(new Image { Source = ImageSource.FromStream(() => GetEmbedded("dotnet_bot.png")) }, row: row, col: 0); + Add(new Image { Source = ImageSource.FromStream(() => GetEmbedded("animated_heart.gif")), IsAnimationPlaying = true }, row: row, col: 1); + + return layout; + + void Add(IView view, int row = 0, int col = 0, int rowSpan = 1, int colSpan = 1) + { + layout.Add(view); + layout.SetRow(view, row); + layout.SetRowSpan(view, rowSpan); + layout.SetColumn(view, col); + layout.SetColumnSpan(view, colSpan); + } + + string CopyLocal(string embeddedPath) + { + var path = Path.Combine(FileSystem.CacheDirectory, Guid.NewGuid().ToString("N")); + + using var stream = GetEmbedded(embeddedPath); + using var file = File.Create(path); + stream.CopyTo(file); + + return path; + } + + Stream GetEmbedded(string embeddedPath) + { + var assembly = GetType().Assembly; + var name = assembly + .GetManifestResourceNames() + .First(n => n.EndsWith(embeddedPath, StringComparison.InvariantCultureIgnoreCase)); + return assembly.GetManifestResourceStream(name); + } + } + IView CreateSampleGrid() { var layout = new Microsoft.Maui.Controls.Layout2.GridLayout() { ColumnSpacing = 0, RowSpacing = 0 }; @@ -305,9 +496,9 @@ void AddTextResizeDemo(Microsoft.Maui.ILayout layout) { if (resizeTestLabel.Text == "Short Text") { - resizeTestLabel.Text = loremIpsum; - explicitWidthTestLabel.Text = loremIpsum; - widthAndHeightTestLabel.Text = loremIpsum; + resizeTestLabel.Text = LoremIpsum; + explicitWidthTestLabel.Text = LoremIpsum; + widthAndHeightTestLabel.Text = LoremIpsum; } else { @@ -322,5 +513,49 @@ void AddTextResizeDemo(Microsoft.Maui.ILayout layout) layout.Add(widthAndHeightTestLabel); layout.Add(explicitWidthTestLabel); } + + void SetupVisibilityTest() + { + var layout = new VerticalStackLayout() { BackgroundColor = Colors.BurlyWood }; + + var button1 = new Button { Text = "Controls", Margin = new Thickness(0, 40) }; + + var button2 = new Button { Text = "MAUI" }; + + var controlsLabel = new Label { Text = "Controls Label" }; + controlsLabel.IsVisible = true; + + var alwaysVisible = new Label { Text = "Always visible" }; + + var mauiLabel = new VisibilityLabel() { Text = "Core Label" }; + + button1.Clicked += (sender, args) => { + controlsLabel.IsVisible = !controlsLabel.IsVisible; + }; + + button2.Clicked += (sender, args) => + { + switch ((mauiLabel as IFrameworkElement).Visibility) + { + case Visibility.Visible: + mauiLabel.SetVisibility(Visibility.Hidden); + break; + case Visibility.Hidden: + mauiLabel.SetVisibility(Visibility.Collapsed); + break; + case Visibility.Collapsed: + mauiLabel.SetVisibility(Visibility.Visible); + break; + } + }; + + layout.Add(button1); + layout.Add(button2); + layout.Add(controlsLabel); + layout.Add(mauiLabel); + layout.Add(alwaysVisible); + + Content = layout; + } } -} \ No newline at end of file +} diff --git a/src/Controls/samples/Controls.Sample/Pages/NavPage.cs b/src/Controls/samples/Controls.Sample/Pages/NavPage.cs new file mode 100644 index 000000000000..37f72f1ba8d2 --- /dev/null +++ b/src/Controls/samples/Controls.Sample/Pages/NavPage.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Maui.Controls.Sample.ViewModel; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Pages +{ + public class NavPage : NavigationPage + { + public NavPage(IServiceProvider services, MainPageViewModel viewModel) : + base(new MainPage(services, viewModel)) + { + ToolbarItems.Add(new ToolbarItem() + { + Text = "Nav Page" + }); + BarBackgroundColor = Colors.Purple; + BarTextColor = Colors.Green; + + } + } +} diff --git a/src/Controls/samples/Controls.Sample/Pages/SemanticsPage.xaml b/src/Controls/samples/Controls.Sample/Pages/SemanticsPage.xaml index e720e8260783..405998af7322 100644 --- a/src/Controls/samples/Controls.Sample/Pages/SemanticsPage.xaml +++ b/src/Controls/samples/Controls.Sample/Pages/SemanticsPage.xaml @@ -1,7 +1,9 @@  + x:Class="Maui.Controls.Sample.Pages.SemanticsPage" + Title="Semantics Page" + BackgroundColor="White"> @@ -38,6 +40,7 @@