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
- $(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
+
+
+
+
@@ -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
-
- true
-
-
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.cs.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.cs.resx
new file mode 100644
index 000000000000..027b175bbd99
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.cs.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Pro {0}{1} není nadefinovaná žádná metoda Add().
+ 0 is type name, 1 is property name
+
+
+ Vazba: Indexer neobsahoval argumenty.
+
+
+ Vazba: Indexer neobsahoval pravou hranatou závorku.
+
+
+ Vazba: {0} nejde analyzovat jako index pro vlastnost {1}.
+ 0 is indexer value, 1 is property name
+
+
+ Vazba: Nepodporovaný typ indexu indexeru: {0}
+ 0 is indexer type name
+
+
+ Vazba: Vlastnost {0} nejde u typu {1} najít.
+ 0 is property name, 1 is type name
+
+
+ Chybí veřejná statická metoda Get{0} nebo metoda getter veřejné vlastnosti instance pro připojenou vlastnost {1}.{0}Property.
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ Název vlastnosti {0} typu BindableProperty nekončí na Property.
+ 0 is BindableProperty name
+
+
+ Chybí výchozí konstruktor pro typ {0}.
+ 0 is type name
+
+
+ Chybí konstruktor pro typ {0} s odpovídajícím atributem x:Arguments.
+ 0 is type name
+
+
+ Nejde nastavit obsah typu {0}, protože nemá atribut [ContentProperty].
+ 0 is type name
+
+
+ Hodnotu {0} nejde převést na typ {1}.
+ 0 is a value, 1 is a type
+
+
+ Pro hodnotu {0} nešlo najít hodnotu výčtu.
+ 0 is enum value
+
+
+ Neplatný kód XAML: {0}
+ 0 is the invalid xaml snippet
+
+
+ Výraz značky není uzavřený.
+
+
+ Při analýze výrazu značky došlo k chybě.
+
+
+ Pro člen {0} nešlo najít žádnou vlastnost, BindableProperty nebo událost nebo došlo k neshodě typu mezi hodnotou a vlastností.
+ 0 is member name
+
+
+ Pro {0}::{1} ({2}) se nenašla žádná statická metoda.
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ V typu {1} nešlo najít obslužnou rutinu událostí {0} se správnou signaturou.
+ 0 is the handler name, 1 is the declaring type
+
+
+ Element s názvem {0} už v tomto oboru názvů existuje.
+ 0 is the duplicated key
+
+
+ Chybí povinná vlastnost {0} pro typ {1}.
+ 0 is a property name, 1 is a type
+
+
+ Nejde přeložit vlastnost {0} pro typ {1} (vlastnost chybí nebo chybí přístupové objekty).
+ 0 is a property name, 1 is a type name
+
+
+ Prostředek s klíčem {0} už v ResourceDictionary existuje.
+ 0 is key name
+
+
+ Prostředky v ResourceDictionary vyžadují atribut x:Key.
+
+
+ Prostředek {0} se nenašel.
+ 0 is a resourceId
+
+
+ Výčty s více hodnotami nejsou platné pro typy výčtu sbyte.
+
+
+ Šablona stylů vyžaduje buď zdroj, nebo obsah.
+
+
+ Zdrojová vlastnost není řetězcový literál.
+
+
+ Šablona stylů nemůže obsahovat jak zdroj, tak obsah.
+
+
+ Vlastnost Style nebo obsah není řetězcový literál.
+
+
+ Typ {0} nejde přeložit.
+ 0 is a type name
+
+
+ x:DataType očekává řetězcový literál, značku {{x:Type}} nebo {{x:Nul}l}.
+
+
+ Nedeklarovaná předpona xmlns: {0}
+ 0 is the xmlns prefix
+
+
+ x:Static: nejde najít veřejné nebo přístupné interní statické pole, statickou vlastnost, konstantu nebo hodnotu výčtu s názvem {0} v typu {1}.
+ 0 is membername, 1 is type name
+
+
+ Syntaxe pro x:Static je [Člen=][předpona:]názevTypu.názevStatickéhoČlenu.
+
+
+ x:Key očekává řetězcový literál.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.de.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.de.resx
new file mode 100644
index 000000000000..5188c521bb24
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.de.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Für "{0}{1}" wurde keine Add()-Methode definiert.
+ 0 is type name, 1 is property name
+
+
+ Bindung: Der Indexer enthielt keine Argumente.
+
+
+ Bindung: Der Indexer enthielt keine schließende Klammer.
+
+
+ Bindung: "{0}" kann nicht als Index für "{1}" analysiert werden.
+ 0 is indexer value, 1 is property name
+
+
+ Binding: nicht unterstützter Indexer-Indextyp: "{0}".
+ 0 is indexer type name
+
+
+ Bindung: Die Eigenschaft "{0}" wurde in "{1}" nicht gefunden.
+ 0 is property name, 1 is type name
+
+
+ Es fehlt eine Methode "public static Get{0}" oder ein Eigenschaftengetter der öffentlichen Instanz für die angefügte Eigenschaft "{1}.{0}Property".
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ Der Name der BindableProperty "{0}" endet nicht mit "Property".
+ 0 is BindableProperty name
+
+
+ Fehlender Standardkonstruktor für "{0}".
+ 0 is type name
+
+
+ Fehlender Konstruktor für "{0}" mit übereinstimmendem Attribut "x:Arguments".
+ 0 is type name
+
+
+ Der Inhalt von "{0}" kann nicht festgelegt werden, weil kein [ContentProperty]-Attribut vorhanden ist.
+ 0 is type name
+
+
+ Der Wert "{0}" kann nicht in "{1}" konvertiert werden.
+ 0 is a value, 1 is a type
+
+
+ Der Enumerationswert für "{0}" wurde nicht gefunden.
+ 0 is enum value
+
+
+ Ungültiger XAML-Codeausschnitt "{0}".
+ 0 is the invalid xaml snippet
+
+
+ Der Markupausdruck wurde nicht geschlossen.
+
+
+ Fehler beim Analysieren des Markupausdrucks.
+
+
+ Für "{0}" wurde keine Eigenschaft, keine BindableProperty oder kein Ereignis gefunden, oder es gibt eine Typdiskrepanz zwischen Wert und Eigenschaft.
+ 0 is member name
+
+
+ Für "{0}::{1} ({2})" wurde keine statische Methode gefunden.
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ Der EventHandler "{0}" mit der richtigen Signatur wurde im Typ "{1}" nicht gefunden.
+ 0 is the handler name, 1 is the declaring type
+
+
+ Ein Element mit dem Namen "{0}" ist in diesem NameScope bereits vorhanden.
+ 0 is the duplicated key
+
+
+ Die erforderliche Eigenschaft "{0}" für "{1}" fehlt.
+ 0 is a property name, 1 is a type
+
+
+ Die Eigenschaft "{0}" für den Typ "{1} (Eigenschaft fehlt oder fehlende Accessoren)" kann nicht aufgelöst werden.
+ 0 is a property name, 1 is a type name
+
+
+ "Eine Ressource mit dem Schlüssel "{0}" ist im ResourceDictionary bereits vorhanden.
+ 0 is key name
+
+
+ Die Ressourcen im ResourceDictionary erfordern ein x:Key-Attribut.
+
+
+ Die Ressource "{0}" wurde nicht gefunden.
+ 0 is a resourceId
+
+
+ Mehrwertige Enumerationen sind für sbyte-Enumerationstypen ungültig.
+
+
+ Das StyleSheet erfordert entweder eine Source-Eigenschaft oder einen Inhalt.
+
+
+ Die Source-Eigenschaft ist kein Zeichenfolgenliteral.
+
+
+ Das StyleSheet kann nicht gleichzeitig eine Source-Eigenschaft und einen Inhalt aufweisen.
+
+
+ Die Style-Eigenschaft oder der Inhalt ist kein Zeichenfolgenliteral.
+
+
+ Der Typ "{0}" kann nicht aufgelöst werden.
+ 0 is a type name
+
+
+ x:DataType erwartet ein Zeichenfolgenliteral, ein {{x:Type}}-Markup oder {{x:Nul}l}.
+
+
+ Nicht deklariertes xmlns-Präfix "{0}".
+ 0 is the xmlns prefix
+
+
+ x:Static: Ein öffentliches – oder zugängliches internes – statisches Feld, eine statische Eigenschaft oder ein const- oder enum-Wert mit dem Namen "{0}" wurde in "{1}" nicht gefunden.
+ 0 is membername, 1 is type name
+
+
+ Die Syntax für "x:Static" lautet "[Member=][prefix:]typeName.staticMemberName".
+
+
+ Für "x:Key" wird ein Zeichenfolgenliteral erwartet.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.es.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.es.resx
new file mode 100644
index 000000000000..f175a0f30b1d
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.es.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ No se ha definido ningún método Add() en "{0}{1}".
+ 0 is type name, 1 is property name
+
+
+ Enlace: el indizador no contenía argumentos.
+
+
+ Enlace: el indizador no contenía un corchete de cierre.
+
+
+ Enlace: no se puede analizar "{0}" como un índice para "{1}".
+ 0 is indexer value, 1 is property name
+
+
+ Enlace: tipo de índice del indizador no admitido: "{0}".
+ 0 is indexer type name
+
+
+ Enlace: no se encontró la propiedad "{0}" en "{1}".
+ 0 is property name, 1 is type name
+
+
+ Falta un método "public static Get{0}" o un captador de propiedad de instancia pública para la propiedad adjunta "{1}.{0}Property".
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ El nombre de BindableProperty {0} no termina con "Property".
+ 0 is BindableProperty name
+
+
+ Falta el constructor predeterminado para "{0}".
+ 0 is type name
+
+
+ Falta un constructor para "{0}" con x:Arguments coincidentes.
+ 0 is type name
+
+
+ No se puede establecer el contenido de "{0}" porque no tiene un atributo [ContentProperty].
+ 0 is type name
+
+
+ No se puede convertir el valor "{0}" en "{1}".
+ 0 is a value, 1 is a type
+
+
+ No se encontró el valor de enumeración para "{0}".
+ 0 is enum value
+
+
+ XAML no válido "{0}".
+ 0 is the invalid xaml snippet
+
+
+ Expresión de marcado no cerrada.
+
+
+ Error al analizar la expresión de marcado.
+
+
+ No se encontró ninguna propiedad, BindableProperty o evento para "{0}", o el tipo entre el valor y la propiedad no coincide.
+ 0 is member name
+
+
+ No se encontró ningún método estático para "{0}::{1} ({2})".
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ No se encontró el elemento EventHandler "{0}" con la signatura correcta en el tipo "{1}".
+ 0 is the handler name, 1 is the declaring type
+
+
+ Ya existe un elemento con el nombre "{0}" en este elemento NameScope.
+ 0 is the duplicated key
+
+
+ Falta la propiedad obligatoria "{0}" en "{1}".
+ 0 is a property name, 1 is a type
+
+
+ No se puede resolver la propiedad "{0}" del tipo "{1} (falta la propiedad o faltan los descriptores de acceso)".
+ 0 is a property name, 1 is a type name
+
+
+ Ya hay un recurso con la clave "{0}" en ResourceDictionary.
+ 0 is key name
+
+
+ Los recursos de ResourceDictionary requieren un atributo x:Key.
+
+
+ No se encontró el recurso "{0}".
+ 0 is a resourceId
+
+
+ Las enumeraciones con varios valores no son válidas en los tipos de enumeración SByte.
+
+
+ StyleSheet requiere un origen o un contenido.
+
+
+ La propiedad Source no es un literal de cadena.
+
+
+ StyleSheet no puede tener un origen y un contenido.
+
+
+ La propiedad Style o Content no es un literal de cadena.
+
+
+ No se puede resolver el tipo "{0}".
+ 0 is a type name
+
+
+ x:DataType espera un literal de cadena, una marca {{x:Type}} o {{x:Nul}l}.
+
+
+ Prefijo xmlns no declarado "{0}".
+ 0 is the xmlns prefix
+
+
+ x:Static: no puede encontrar un campo estático público (o interno accesible), una propiedad estática o un valor constante o de enumeración llamados "{0}" en "{1}".
+ 0 is membername, 1 is type name
+
+
+ La sintaxis de x:Static es "[Member=][prefix:]typeName.staticMemberName".
+
+
+ x:Clave espera un literal de cadena.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.fr.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.fr.resx
new file mode 100644
index 000000000000..793cec9e7c91
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.fr.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Aucune méthode Add() définie sur "{0}{1}".
+ 0 is type name, 1 is property name
+
+
+ Liaison : l'indexeur ne contient pas d'arguments.
+
+
+ Liaison : l'indexeur ne contient pas de crochet fermant.
+
+
+ Liaison : "{0}" ne peut pas être analysé en tant qu'index pour "{1}".
+ 0 is indexer value, 1 is property name
+
+
+ Liaison : type d'index d'indexeur non pris en charge : "{0}".
+ 0 is indexer type name
+
+
+ Liaison : propriété "{0}" introuvable sur "{1}".
+ 0 is property name, 1 is type name
+
+
+ Il manque une méthode "public static Get{0}" ou un getter de propriété d'instance publique pour la propriété jointe "{1}.{0}Property".
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ Le nom du BindableProperty {0} ne finit pas par "Property".
+ 0 is BindableProperty name
+
+
+ Constructeur par défaut manquant pour "{0}".
+ 0 is type name
+
+
+ Constructeur manquant pour "{0}" avec un x:Arguments correspondant.
+ 0 is type name
+
+
+ Impossible de définir le contenu de "{0}", car il n'a pas d'attribut [ContentProperty].
+ 0 is type name
+
+
+ Impossible de convertir la valeur "{0}" en "{1}".
+ 0 is a value, 1 is a type
+
+
+ Valeur enum introuvable pour "{0}".
+ 0 is enum value
+
+
+ Extrait XAML "{0}" non valide.
+ 0 is the invalid xaml snippet
+
+
+ Expression de balise non fermée.
+
+
+ Erreur durant l'analyse de l'expression de balise.
+
+
+ Propriété, BindableProperty ou événement introuvable pour "{0}", ou type incompatible entre la valeur et la propriété.
+ 0 is member name
+
+
+ Méthode statique introuvable pour "{0}::{1} ({2})".
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ Impossible de localiser un EventHandler "{0}" avec une signature correcte dans le type "{1}".
+ 0 is the handler name, 1 is the declaring type
+
+
+ Un élément nommé "{0}" existe déjà dans ce NameScope.
+ 0 is the duplicated key
+
+
+ Propriété obligatoire "{0}" manquante sur "{1}".
+ 0 is a property name, 1 is a type
+
+
+ Impossible de résoudre la propriété "{0}" sur le type "{1} (propriété manquante ou accesseurs manquants)".
+ 0 is a property name, 1 is a type name
+
+
+ "Une ressource avec la clé "{0}" est déjà présente dans ResourceDictionary.
+ 0 is key name
+
+
+ Les ressources de ResourceDictionary nécessitent un attribut x:Key.
+
+
+ Ressource "{0}" introuvable.
+ 0 is a resourceId
+
+
+ Les enums à valeurs multiples sont non valides sur les types enum sbyte.
+
+
+ StyleSheet nécessite Source ou un contenu.
+
+
+ La propriété Source n'est pas un littéral de chaîne.
+
+
+ StyleSheet ne peut pas avoir à la fois Source et un contenu.
+
+
+ La propriété Style ou le contenu n'est pas un littéral de chaîne.
+
+
+ Impossible de résoudre le type "{0}".
+ 0 is a type name
+
+
+ x:DataType attend un littéral de chaîne, une balise {{x:Type}} ou {{x:Nul}l}.
+
+
+ Préfixe xmlns non déclaré "{0}".
+ 0 is the xmlns prefix
+
+
+ x:Static : impossible de localiser un champ statique public (ou interne et accessible), une propriété statique, une valeur const ou une valeur enum portant le nom "{0}" dans "{1}".
+ 0 is membername, 1 is type name
+
+
+ La syntaxe de x:Static est "[Member=][prefix:]typeName.staticMemberName".
+
+
+ x:Key attend un littéral de chaîne.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.it.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.it.resx
new file mode 100644
index 000000000000..8648543cc726
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.it.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Non è stato definito alcun metodo Add() in "{0}{1}".
+ 0 is type name, 1 is property name
+
+
+ Associazione: l'indicizzatore non contiene argomenti.
+
+
+ Associazione: l'indicizzatore non contiene la parentesi quadra di chiusura.
+
+
+ Associazione: non è possibile analizzare "{0}" come indice di una proprietà "{1}".
+ 0 is indexer value, 1 is property name
+
+
+ Associazione: il tipo di indice "{0}" dell'indicizzatore non è supportato.
+ 0 is indexer type name
+
+
+ Associazione: la proprietà "{0}" non è stata trovata in "{1}".
+ 0 is property name, 1 is type name
+
+
+ Manca un metodo "public static Get{0}" o un getter di proprietà di istanza pubblica per la proprietà associata "{1}.{0}Property".
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ Il nome dell'elemento BindableProperty {0} non termina con "Property".
+ 0 is BindableProperty name
+
+
+ Manca il costruttore predefinito per "{0}".
+ 0 is type name
+
+
+ Manca il costruttore per "{0}" con attributo x:Arguments corrispondente.
+ 0 is type name
+
+
+ Non è possibile impostare il contenuto di "{0}" perché non include un attributo [ContentProperty].
+ 0 is type name
+
+
+ Non è possibile convertire il valore "{0}" in "{1}".
+ 0 is a value, 1 is a type
+
+
+ Valore di enumerazione non trovato per "{0}".
+ 0 is enum value
+
+
+ XAML "{0}" non valido.
+ 0 is the invalid xaml snippet
+
+
+ Espressione di markup non chiusa.
+
+
+ Si è verificato un errore durante l'analisi dell'espressione di markup.
+
+
+ Non sono stati trovati eventi, proprietà o elementi BindableProperty per "{0}" oppure il tipo di valore e proprietà non corrispondono.
+ 0 is member name
+
+
+ Non è stato trovato alcun metodo statico per "{0}::{1} ({2})".
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ Nel tipo "{1}" non è stato trovato alcun elemento EventHandler "{0}" con la firma corretta.
+ 0 is the handler name, 1 is the declaring type
+
+
+ In questo elemento NameScope esiste già un elemento denominato "{0}".
+ 0 is the duplicated key
+
+
+ In "{1}" manca la proprietà obbligatoria "{0}".
+ 0 is a property name, 1 is a type
+
+
+ Non è possibile risolvere la proprietà "{0}" nel tipo "{1} (funzioni di accesso o proprietà mancanti)".
+ 0 is a property name, 1 is a type name
+
+
+ "Una risorsa con chiave "{0}" è già presente in ResourceDictionary.
+ 0 is key name
+
+
+ Per le risorse in ResourceDictionary è richiesto un attributo x:Key.
+
+
+ La risorsa "{0}" non è stata trovata.
+ 0 is a resourceId
+
+
+ Le enumerazioni con valori multipli non sono valide nei tipi enumerazione sbyte.
+
+
+ Con l'elemento StyleSheet è richiesto un elemento Source o contenuto.
+
+
+ La proprietà di origine non è un valore letterale stringa.
+
+
+ Un elemento StyleSheet non può includere sia un elemento Source che contenuto.
+
+
+ La proprietà Style o l'elemento Content non è un valore letterale stringa.
+
+
+ Non è possibile risolvere il tipo "{0}".
+ 0 is a type name
+
+
+ Con x:DataType è previsto un valore letterale stringa, un markup {{x:Type}} oppure {{x:Nul}l}.
+
+
+ Il prefisso xmlns "{0}" non è dichiarato.
+ 0 is the xmlns prefix
+
+
+ x:Static: non è possibile trovare un valore di campo statico pubblico o interno accessibile, di proprietà statica, di costante o di enumerazione denominato "{0}" in "{1}".
+ 0 is membername, 1 is type name
+
+
+ La sintassi di x:Static è "[Membro=][prefisso:]nomeTipo.nomeMembroStatico".
+
+
+ x:Key prevede un valore letterale stringa.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ja.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ja.resx
new file mode 100644
index 000000000000..ec5c7e2fcb48
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ja.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Add() メソッドが "{0}{1}" に定義されていません。
+ 0 is type name, 1 is property name
+
+
+ バインド: インデクサーに引数が含まれていませんでした。
+
+
+ バインド: インデクサーに右角かっこが含まれていませんでした。
+
+
+ バインド: "{0}" は、"{1}" のインデックスとして解析できません。
+ 0 is indexer value, 1 is property name
+
+
+ バインド: サポートされていない種類のインデクサーのインデックスです: "{0}"。
+ 0 is indexer type name
+
+
+ バインド: プロパティ "{0}" が "{1}" に見つかりません。
+ 0 is property name, 1 is type name
+
+
+ 添付プロパティ "{1}. {0}Property" の "public static Get{0}" メソッドまたはパブリック インスタンス プロパティ ゲッターがありません。
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ BindableProperty {0} の名前の末尾が "Property" ではありません。
+ 0 is BindableProperty name
+
+
+ "{0}" の既定のコンストラクターがありません。
+ 0 is type name
+
+
+ 一致する x:Arguments を持つ "{0}" のコンストラクターがありません。
+ 0 is type name
+
+
+ [ContentProperty] 属性がないため、"{0}" の内容を設定できません。
+ 0 is type name
+
+
+ 値 "{0}" を "{1}" に変換できません。
+ 0 is a value, 1 is a type
+
+
+ "{0}" の列挙値が見つかりません。
+ 0 is enum value
+
+
+ Xaml "{0}" が無効です。
+ 0 is the invalid xaml snippet
+
+
+ マークアップ式が閉じられていません。
+
+
+ マークアップ式の解析中にエラーが発生しました。
+
+
+ "{0}" のプロパティ、BindableProperty、またはイベントが見つからないか、値とプロパティの型が一致しません。
+ 0 is member name
+
+
+ "{0}::{1} ({2})" の静的メソッドが見つかりません。
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ 正しいシグネチャを持つ EventHandler "{0}" が型 "{1}" に見つかりません。
+ 0 is the handler name, 1 is the declaring type
+
+
+ この NameScope には、"{0}" という名前の要素が既に存在します。
+ 0 is the duplicated key
+
+
+ "{1}" の必須プロパティ "{0}" がありません。
+ 0 is a property name, 1 is a type
+
+
+ 型 "{1}" のプロパティ"{0}"を解決できません (プロパティが見つからないか、アクセサーがありません)。
+ 0 is a property name, 1 is a type name
+
+
+ キーが "{0}"のリソースは、ResourceDictionary 内に既に存在します。
+ 0 is key name
+
+
+ ResourceDictionary 内のリソースには x:Key 属性が必要です。
+
+
+ リソース "{0}" が見つかりません。
+ 0 is a resourceId
+
+
+ 複数の値を持つ列挙型は、sbyte 列挙型では無効です。
+
+
+ スタイルシートには、ソースまたはコンテンツのどちらかが必要です。
+
+
+ ソース プロパティは文字列リテラルではありません。
+
+
+ スタイルシートにソースとコンテンツの両方を含めることはできません。
+
+
+ スタイル プロパティまたはコンテンツが文字列リテラルではありません。
+
+
+ 型 "{0}" を解決できません。
+ 0 is a type name
+
+
+ x:DataType には、文字列リテラル、{{x:Type}} マークアップ、または {{x:Nul}l} を指定する必要があります。
+
+
+ 宣言されていない xmlns プレフィックス "{0}" です。
+ 0 is the xmlns prefix
+
+
+ x:Static: "{1}" に、"{0}" という名前のパブリックな (またはアクセス可能な内部の) 静的フィールド、静的プロパティ、const、または列挙値が見つかりません。
+ 0 is membername, 1 is type name
+
+
+ X:Static の構文が、"[Member=][prefix:]typeName.staticMemberName" です。
+
+
+ x:Key には文字列リテラルが期待されています。
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ko.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ko.resx
new file mode 100644
index 000000000000..7dfd7de990ca
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ko.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ "{0}{1}"에 대한 Add() 메서드가 정의되지 않았습니다.
+ 0 is type name, 1 is property name
+
+
+ 바인딩: 인덱서에 인수가 없습니다.
+
+
+ 바인딩: 인덱서에 닫는 대괄호가 없습니다.
+
+
+ 바인딩: "{0}"을(를) "{1}"의 인덱스로 구문 분석할 수 없습니다.
+ 0 is indexer value, 1 is property name
+
+
+ 바인딩: 지원되지 않는 인덱서 인덱스 형식: "{0}"
+ 0 is indexer type name
+
+
+ 바인딩: "{1}"에서 "{0}" 속성을 찾을 수 없습니다.
+ 0 is property name, 1 is type name
+
+
+ 연결된 속성 "{1}.{0}Property"에 대한 "public static Get{0}" 메서드나 public 인스턴스 속성 getter가 없습니다.
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ BindableProperty {0}의 이름은 "Property"로 끝나지 않습니다.
+ 0 is BindableProperty name
+
+
+ "{0}"에 대한 기본 생성자가 없습니다.
+ 0 is type name
+
+
+ 일치하는 x:Arguments가 있는 "{0}"에 대한 생성자가 없습니다.
+ 0 is type name
+
+
+ "{0}"에 [ContentProperty] 특성이 없기 때문에 내용을 설정할 수 없습니다.
+ 0 is type name
+
+
+ 값 "{0}"을 "{1}"(으)로 변환할 수 없습니다.
+ 0 is a value, 1 is a type
+
+
+ "{0}"에 대한 열거형 값을 찾을 수 없습니다.
+ 0 is enum value
+
+
+ 유효하지 않은 Xaml "{0}"입니다.
+ 0 is the invalid xaml snippet
+
+
+ 태그 식을 닫지 않았습니다.
+
+
+ 태그 식을 구문 분석하는 동안 오류가 발생했습니다.
+
+
+ "{0}"에 대해 속성, BindableProperty 또는 이벤트를 찾을 수 없거나 값과 속성 간에 형식이 일치하는 않습니다.
+ 0 is member name
+
+
+ "{0}::{1}({2})"에 대한 정적 메서드를 찾을 수 없습니다.
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ "{1}" 형식에서 올바른 서명이 포함된 EventHandler "{0}"을(를) 찾을 수 없습니다.
+ 0 is the handler name, 1 is the declaring type
+
+
+ 이름이 "{0}"인 요소가 이 NameScope에 이미 있습니다.
+ 0 is the duplicated key
+
+
+ "{1}"에 필수 속성 "{0}"이(가) 없습니다.
+ 0 is a property name, 1 is a type
+
+
+ "{1}" 형식에서 속성 "{0}"을(를) 확인할 수 없습니다(속성이 누락되었거나 접근자가 누락됨).
+ 0 is a property name, 1 is a type name
+
+
+ 키가 "{0}"인 리소스가 ResourceDictionary에 이미 있습니다.
+ 0 is key name
+
+
+ ResourceDictionary의 리소스에는 x:Key 특성이 필요합니다.
+
+
+ 리소스 "{0}"을(를) 찾을 수 없습니다.
+ 0 is a resourceId
+
+
+ 다중 값 열거형은 sbyte 열거형 형식에서 사용할 수 없습니다.
+
+
+ 스타일 시트에는 원본 또는 콘텐츠가 필요합니다.
+
+
+ 원본 속성이 문자열 리터럴이 아닙니다.
+
+
+ 스타일 시트는 소스와 콘텐츠 중 하나만 포함할 수 있습니다.
+
+
+ 스타일 속성 또는 콘텐츠가 문자열 리터럴이 아닙니다.
+
+
+ 형식 "{0}"을(를) 확인할 수 없습니다.
+ 0 is a type name
+
+
+ x:DataType에는 {{x:Type}} 태그 또는 {{x:Nul}l} 문자열 리터럴이 필요합니다.
+
+
+ 선언되지 않은 xmlns 접두사 "{0}"입니다.
+ 0 is the xmlns prefix
+
+
+ x:Static: "{1}"에서 이름이 "{0}"인 public 또는 액세스 가능한 내부 정적 필드, 정적 속성, 상수 또는 열거형 값을 찾을 수 없습니다.
+ 0 is membername, 1 is type name
+
+
+ X:Static에 대한 구문은 "[Member=][prefix:]typeName.staticMemberName"입니다.
+
+
+ x:Key는 문자열 리터럴을 기대합니다.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.pl.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.pl.resx
new file mode 100644
index 000000000000..e4a2cd6851bd
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.pl.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Nie zdefiniowano metody Add() dla elementu „{0}{1}”.
+ 0 is type name, 1 is property name
+
+
+ Powiązanie: indeksator nie zawierał argumentów.
+
+
+ Powiązanie: indeksator nie zawierał nawiasu zamykającego.
+
+
+ Powiązanie: nie można przeanalizować wartości „{0}” jako indeksu dla właściwości „{1}”.
+ 0 is indexer value, 1 is property name
+
+
+ Powiązanie: nieobsługiwany typ indeksu indeksatora: „{0}”.
+ 0 is indexer type name
+
+
+ Powiązanie: nie znaleziono właściwości „{0}” w typie „{1}”.
+ 0 is property name, 1 is type name
+
+
+ Brak metody „public static get{0}” lub metody pobierającej właściwość wystąpienia publicznego dla dołączonej właściwości „{1}.{0}Property”.
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ Nazwa właściwości BindableProperty {0} nie kończy się ciągiem „Property”.
+ 0 is BindableProperty name
+
+
+ Brak domyślnego konstruktora dla typu „{0}”.
+ 0 is type name
+
+
+ Brak konstruktora dla typu „{0}” z pasującym atrybutem x:Arguments.
+ 0 is type name
+
+
+ Nie można ustawić zawartości typu „{0}”, ponieważ nie ma on atrybutu [ContentProperty].
+ 0 is type name
+
+
+ Nie można przekonwertować wartości „{0}” na typ „{1}”.
+ 0 is a value, 1 is a type
+
+
+ Nie znaleziono wartości wyliczenia dla wartości „{0}”.
+ 0 is enum value
+
+
+ Nieprawidłowy kod XAML „{0}”
+ 0 is the invalid xaml snippet
+
+
+ Wyrażenie znaczników nie zostało zamknięte.
+
+
+ Błąd podczas analizowania wyrażenia znaczników.
+
+
+ Nie znaleziono właściwości BindableProperty lub zdarzenia dla elementu członkowskiego „{0}” lub wartość i właściwość nie są zgodne.
+ 0 is member name
+
+
+ Nie znaleziono żadnej metody statycznej dla elementu „{0}::{1} ({2})”.
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ W typie „{1}” nie znaleziono programu obsługi zdarzeń „{0}” z poprawnym podpisem.
+ 0 is the handler name, 1 is the declaring type
+
+
+ Element o nazwie „{0}” już istnieje w tym zakresie NameScope.
+ 0 is the duplicated key
+
+
+ Brak obowiązkowej właściwości „{0}” w typie „{1}”.
+ 0 is a property name, 1 is a type
+
+
+ Nie można rozpoznać właściwości „{0}” w typie „{1} (brak właściwości lub brak metod dostępu)”.
+ 0 is a property name, 1 is a type name
+
+
+ „Zasób z kluczem „{0}” już znajduje się w elemencie ResourceDictionary.
+ 0 is key name
+
+
+ Zasoby w elemencie ResourceDictionary wymagają atrybutu x:Key.
+
+
+ Nie znaleziono zasobu „{0}”.
+ 0 is a resourceId
+
+
+ Wyliczenia z wieloma wartościami nie są prawidłowe dla typów wyliczeń sbyte.
+
+
+ Arkusz stylów wymaga źródła albo zawartości.
+
+
+ Właściwość źródłowa nie jest literałem ciągu.
+
+
+ Arkusz stylów nie może mieć zarówno źródła, jak i zawartości.
+
+
+ Zawartość lub właściwość stylu nie jest literałem ciągu.
+
+
+ Nie można rozpoznać typu „{0}”.
+ 0 is a type name
+
+
+ Argument x:DataType oczekuje literału ciągu, znacznika {{x:Type}} lub {{x:Nul}l}.
+
+
+ Niezadeklarowany prefiks xmlns „{0}”.
+ 0 is the xmlns prefix
+
+
+ x:Static: nie można odnaleźć publicznego — lub dostępnego wewnętrznie — pola statycznego, właściwości statycznej, stałej lub wartości wyliczenia o nazwie „{0}” w typie „{1}”.
+ 0 is membername, 1 is type name
+
+
+ Składnia elementu x:Static to „[elementCzłonkowski=][prefiks:]nazwaTypu.nazwaStatycznegoElementuCzłonkowskiego”.
+
+
+ x: Klawisz oczekuje dosłownego ciągu.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.pt-BR.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.pt-BR.resx
new file mode 100644
index 000000000000..c27097e3c9f9
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.pt-BR.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Não foi definido nenhum método Add() em "{0}{1}".
+ 0 is type name, 1 is property name
+
+
+ Associação: o indexador não continha nenhum argumento.
+
+
+ Associação: o indexador não continha nenhum colchete de fechamento.
+
+
+ Associação: não é possível analisar "{0}" como um índice de uma "{1}".
+ 0 is indexer value, 1 is property name
+
+
+ Associação: tipo de índice do indexador sem suporte: "{0}".
+ 0 is indexer type name
+
+
+ Associação: a propriedade "{0}" não foi encontrada em "{1}".
+ 0 is property name, 1 is type name
+
+
+ Um método "public static Get{0}" ou um getter de propriedade de instância pública está ausente da propriedade anexada "{1}.{0}Property".
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ O nome da BindableProperty {0} não termina com "Property".
+ 0 is BindableProperty name
+
+
+ Construtor padrão ausente de "{0}".
+ 0 is type name
+
+
+ Construtor ausente de "{0}" com x:Arguments correspondentes.
+ 0 is type name
+
+
+ Não é possível definir o conteúdo de "{0}" porque ele não tem um atributo [ContentProperty].
+ 0 is type name
+
+
+ Não é possível converter o valor "{0}" em "{1}".
+ 0 is a value, 1 is a type
+
+
+ Valor de enumeração não encontrado para "{0}".
+ 0 is enum value
+
+
+ XAML inválido "{0}".
+ 0 is the invalid xaml snippet
+
+
+ Expressão de marcação não fechada.
+
+
+ Erro ao analisar a expressão de marcação.
+
+
+ Não foi encontrada nenhuma propriedade, nenhuma BindableProperty nem nenhum evento para "{0}". Ou o valor e a propriedade apresentam tipos incompatíveis.
+ 0 is member name
+
+
+ Não foi encontrado nenhum método estático para "{0}::{1} ({2})".
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ O EventHandler "{0}" com a assinatura correta não foi encontrado no tipo "{1}".
+ 0 is the handler name, 1 is the declaring type
+
+
+ Já existe um elemento com o nome "{0}" neste NameScope.
+ 0 is the duplicated key
+
+
+ Propriedade obrigatória "{0}" ausente de "{1}".
+ 0 is a property name, 1 is a type
+
+
+ Não é possível resolver a propriedade "{0}" no tipo "{1} (propriedade ou acessadores ausentes)".
+ 0 is a property name, 1 is a type name
+
+
+ "Um recurso com a chave "{0}" já está presente no ResourceDictionary.
+ 0 is key name
+
+
+ Os recursos no ResourceDictionary exigem um atributo x:Key.
+
+
+ O recurso "{0}" não foi encontrado.
+ 0 is a resourceId
+
+
+ Enumerações com valores múltiplos não são válidas em tipos enumerados sbyte.
+
+
+ A StyleSheet exige uma Origem ou um conteúdo.
+
+
+ A propriedade de origem não é um literal de cadeia de caracteres.
+
+
+ A StyleSheet não pode ter uma Origem e também um conteúdo.
+
+
+ A propriedade ou o Conteúdo de Estilo não é um literal de cadeia de caracteres.
+
+
+ Não é possível resolver o tipo "{0}".
+ 0 is a type name
+
+
+ O x:DataType espera um literal de cadeia de caracteres, uma marcação {{x:Type}} ou um {{x:Nul}l}.
+
+
+ Prefixo xmlns não declarado "{0}".
+ 0 is the xmlns prefix
+
+
+ O x:Static: não pôde encontrar um campo estático, uma propriedade estática, um valor const ou enumerado público (ou interno acessível) denominado "{0}" em "{1}".
+ 0 is membername, 1 is type name
+
+
+ A sintaxe de x:Static é "[Member=][prefix:]typeName.staticMemberName".
+
+
+ x:Key espera uma cadeia de caracteres literal.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ru.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ru.resx
new file mode 100644
index 000000000000..5f57347ec0ab
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.ru.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Для "{0}{1}" не определен метод Add ().
+ 0 is type name, 1 is property name
+
+
+ Привязка: индексатор не содержит аргументов.
+
+
+ Привязка: индексатор не содержит закрывающей скобки.
+
+
+ Привязка: не удается проанализировать значение индексатора "{0}" как индекс для свойства "{1}".
+ 0 is indexer value, 1 is property name
+
+
+ Привязка: неподдерживаемый тип индекса индексатора: "{0}".
+ 0 is indexer type name
+
+
+ Привязка: свойство "{0}" не найдено в "{1}".
+ 0 is property name, 1 is type name
+
+
+ Отсутствует метод "public static Get{0}" или метод получения открытого свойства экземпляра для вложенного свойства "{1}.{0}Property".
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ Имя привязываемого свойства (BindableProperty) {0} не заканчивается на "Property".
+ 0 is BindableProperty name
+
+
+ Отсутствует конструктор по умолчанию для "{0}".
+ 0 is type name
+
+
+ Отсутствует конструктор для "{0}" с соответствующим x:Arguments.
+ 0 is type name
+
+
+ Не удается задать содержимое "{0}", так как у него нет атрибута [ContentProperty].
+ 0 is type name
+
+
+ Не удается преобразовать значение "{0}" в "{1}".
+ 0 is a value, 1 is a type
+
+
+ Значение перечисления для "{0}" не найдено.
+ 0 is enum value
+
+
+ Недопустимый код XAML "{0}".
+ 0 is the invalid xaml snippet
+
+
+ Выражение разметки не закрыто.
+
+
+ Ошибка при анализе выражения разметки.
+
+
+ Не найдено свойство, привязываемое свойство (BindableProperty) или событие для "{0}" либо типы значения и свойства не совпадают.
+ 0 is member name
+
+
+ Не найден статический метод для "{0}::{1} ({2})".
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ В типе "{1}" не найден обработчик событий (EventHandler) "{0}" с правильной подписью.
+ 0 is the handler name, 1 is the declaring type
+
+
+ Элемент с именем "{0}" уже существует в этой области видимости имен.
+ 0 is the duplicated key
+
+
+ Отсутствует обязательное свойство "{0}" для "{1}".
+ 0 is a property name, 1 is a type
+
+
+ Не удается разрешить свойство "{0}" для типа "{1} (свойство отсутствует или не содержит методов доступа)".
+ 0 is a property name, 1 is a type name
+
+
+ "Ресурс с ключом "{0}" уже присутствует в ResourceDictionary.
+ 0 is key name
+
+
+ Для ресурсов в ResourceDictionary требуется атрибут x:Key.
+
+
+ Ресурс "{0}" не найден.
+ 0 is a resourceId
+
+
+ Перечисления с несколькими значениями не могут использоваться в типах перечисления sbyte.
+
+
+ Для таблицы стилей (StyleSheet) необходимо указать источник (Source) или содержимое.
+
+
+ Свойство Source не является строковым литералом.
+
+
+ Таблица стилей (StyleSheet) не может одновременно содержать источник (Source) и содержимое.
+
+
+ Свойство Style или содержимое (Content) не является строковым литералом.
+
+
+ Не удается разрешить тип "{0}".
+ 0 is a type name
+
+
+ x:DataType ожидает строковый литерал, разметку {{x:Type}} или {{x:Nul}l}.
+
+
+ Необъявленный префикс xmlns "{0}".
+ 0 is the xmlns prefix
+
+
+ x:Static: не удается найти статическое поле, статическое свойство, константу или значение перечисления с именем "{0}" в "{1}", которые являлись бы открытыми или были бы доступны внутренне.
+ 0 is membername, 1 is type name
+
+
+ Синтаксис для x:Static — "[Member=][prefix:]typeName.staticMemberName".
+
+
+ x:Key ожидает строковый литерал.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.tr.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.tr.resx
new file mode 100644
index 000000000000..0847f628082c
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.tr.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ "{0}{1}" üzerinde Add() metodu tanımlanmadı.
+ 0 is type name, 1 is property name
+
+
+ Bağlama: Dizin oluşturucu bağımsız değişken içermiyordu.
+
+
+ Bağlama: Dizin oluşturucu kapatma köşeli ayracı içermiyordu.
+
+
+ Bağlama: "{0}", "{1}" için dizin olarak ayrıştırılamıyor.
+ 0 is indexer value, 1 is property name
+
+
+ Bağlama: "{0}" dizin oluşturucu dizin türü desteklenmiyor.
+ 0 is indexer type name
+
+
+ Bağlama: "{1}" üzerinde "{0}" özelliği bulunamadı.
+ 0 is property name, 1 is type name
+
+
+ "{1}.{0}Property" iliştirilmiş özelliği için "public static Get{0}" metodu veya genel örnek özellik alıcısı eksik.
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ {0} BindableProperty adı "Property" ile bitmiyor.
+ 0 is BindableProperty name
+
+
+ "{0}" için varsayılan oluşturucu eksik.
+ 0 is type name
+
+
+ "{0}" için x:Arguments ile eşleşen oluşturucu eksik.
+ 0 is type name
+
+
+ "{0}" içeriği, [ContentProperty] özniteliğine sahip olmadığından ayarlanamıyor.
+ 0 is type name
+
+
+ "{0}" değeri "{1}" türüne dönüştürülemiyor.
+ 0 is a value, 1 is a type
+
+
+ "{0}" için sabit listesi değeri bulunamadı.
+ 0 is enum value
+
+
+ Geçersiz Xaml "{0}".
+ 0 is the invalid xaml snippet
+
+
+ İşaretleme ifadesi kapatılamadı.
+
+
+ İşaretleme ifadesi ayrıştırılırken hata oluştu.
+
+
+ "{0}" için özellik, BindableProperty veya olay bulunamadı ya da değer ile özellik arasındaki tür eşleşmiyor.
+ 0 is member name
+
+
+ "{0}::{1} ({2})" için statik metot bulunamadı.
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ "{1}" türünde doğru imzaya sahip "{0}" EventHandler bulunamadı.
+ 0 is the handler name, 1 is the declaring type
+
+
+ Bu NameScope içinde "{0}" adlı bir öğe zaten var.
+ 0 is the duplicated key
+
+
+ "{1}" türünde zorunlu "{0}" özelliği eksik.
+ 0 is a property name, 1 is a type
+
+
+ "{1} türündeki "{0}" özelliği çözümlenemiyor (özellik veya erişimciler eksik)".
+ 0 is a property name, 1 is a type name
+
+
+ "ResourceDictionary içinde "{0}" anahtarına sahip bir kaynak zaten var.
+ 0 is key name
+
+
+ ResourceDictionary içindeki kaynaklar için x:Key özniteliği gerekir.
+
+
+ "{0}" kaynağı bulunamadı.
+ 0 is a resourceId
+
+
+ Birden çok değere sahip sabit listeleri, sbyte sabit listesi türlerinde geçerli değil.
+
+
+ StyleSheet için Source veya içerik gerekir.
+
+
+ Kaynak özelliği bir dize sabit değeri değil.
+
+
+ StyleSheet, hem Source hem de içerik bulunduramaz.
+
+
+ Style özelliği veya Content bir dize sabit değeri değil.
+
+
+ "{0}" türü çözümlenemiyor.
+ 0 is a type name
+
+
+ x:DataType için bir dize sabit değeri, {{x:Type}} işaretlemesi veya {{x:Nul}l} bekleniyor.
+
+
+ "{0}" xmlns ön eki bildirilmedi.
+ 0 is the xmlns prefix
+
+
+ x:Static: "{1}" içinde "{0}" adlı genel -- veya erişilebilir, dahili -- statik alan, statik özellik, sabit veya sabit listesi değeri bulunamıyor.
+ 0 is membername, 1 is type name
+
+
+ x:Static için söz dizimi "[Member=][önek:]türAdı.statikÜyeAdı" şeklindedir.
+
+
+ x:Key bir sabit değerli dize bekliyor.
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.zh-Hans.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.zh-Hans.resx
new file mode 100644
index 000000000000..b4cf88160d17
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.zh-Hans.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 未在“{0}{1}”上定义 Add() 方法。
+ 0 is type name, 1 is property name
+
+
+ 绑定: 索引器未包含参数。
+
+
+ 绑定: 索引器未包含右方括号。
+
+
+ 绑定: 无法将“{0}”作为“{1}”的索引进行分析。
+ 0 is indexer value, 1 is property name
+
+
+ 绑定: 不受支持的索引器索引类型:“{0}”。
+ 0 is indexer type name
+
+
+ 绑定: 在“{1}”上找不到属性“{0}”。
+ 0 is property name, 1 is type name
+
+
+ 对于附加属性 "{1}.{0}Property",缺少 "public static Get{0}" 方法或公共实例属性 getter。
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ BindableProperty {0} 的名称不是以 "Property" 结尾的。
+ 0 is BindableProperty name
+
+
+ 缺少“{0}”的默认构造函数。
+ 0 is type name
+
+
+ “{0}”中缺少具有匹配的 x:Arguments 的构造函数。
+ 0 is type name
+
+
+ 无法设置“{0}”的内容,因为它没有 [ContentProperty] 属性。
+ 0 is type name
+
+
+ 无法将值“{0}”转换为“{1}”。
+ 0 is a value, 1 is a type
+
+
+ 找不到“{0}”的枚举值。
+ 0 is enum value
+
+
+ Xaml“{0}”无效。
+ 0 is the invalid xaml snippet
+
+
+ 标记表达式未关闭。
+
+
+ 分析标记表达式时出错。
+
+
+ 未找到“{0}”的属性、BindableProperty 或事件,或者值与属性之间的类型不匹配。
+ 0 is member name
+
+
+ 找不到“{0}::{1} ({2})”的静态方法。
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ 在类型“{1}”中找不到具有正确签名的 EventHandler“{0}”。
+ 0 is the handler name, 1 is the declaring type
+
+
+ 此 NameScope 中已存在名为“{0}”的元素。
+ 0 is the duplicated key
+
+
+ “{1}”上缺少强制属性“{0}”。
+ 0 is a property name, 1 is a type
+
+
+ 无法解析类型“{1}”上的属性“{0}”(缺少属性或访问器)”。
+ 0 is a property name, 1 is a type name
+
+
+ ResourceDictionary 中已存在具有键“{0}”的资源。
+ 0 is key name
+
+
+ ResourceDictionary 中的资源需具有 x:Key 属性。
+
+
+ 找不到资源“{0}”。
+ 0 is a resourceId
+
+
+ 多值枚举在 sbyte 枚举类型上无效。
+
+
+ 样式表需要源或内容。
+
+
+ 源属性不是字符串文本。
+
+
+ 样式表不能同时具有源和内容。
+
+
+ 样式属性或内容不是字符串文本。
+
+
+ 无法解析类型“{0}”。
+ 0 is a type name
+
+
+ x:DataType 需要字符串文本、{{x:Type}} 标记或 {{x:Nul}l}。
+
+
+ xmlns 前缀“{0}”未经过声明。
+ 0 is the xmlns prefix
+
+
+ x:Static: 在“{1}”中找不到公共(或可访问的内部)静态字段、静态属性、常量或枚举值“{0}”。
+ 0 is membername, 1 is type name
+
+
+ x:Static 的语法为 "[Member=][prefix:]typeName.staticMemberName"。
+
+
+ x:Key 需要字符串字面量。
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Build.Tasks/xlf/ErrorMessages.zh-Hant.resx b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.zh-Hant.resx
new file mode 100644
index 000000000000..5eb7d3939e92
--- /dev/null
+++ b/src/Controls/src/Build.Tasks/xlf/ErrorMessages.zh-Hant.resx
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 在 "{0}{1}" 上未定義任何 Add() 方法。
+ 0 is type name, 1 is property name
+
+
+ 繫結: 索引子未包含引數。
+
+
+ 繫結: 索引子未包含右中括弧。
+
+
+ 繫結: "{0}" 無法剖析為 "{1}" 的索引。
+ 0 is indexer value, 1 is property name
+
+
+ 繫結: 不支援的索引子索引類型: "{0}"。
+ 0 is indexer type name
+
+
+ 繫結: 在 "{1}" 上找不到屬性 "{0}"。
+ 0 is property name, 1 is type name
+
+
+ 缺少附加屬性 "{1}.{0}Property" 的 "public static Get{0}" 方法或公用執行個體屬性 getter。
+ 0 is BindableProperty name, 1 is the declaring type
+
+
+ BindableProperty {0} 的名稱不是以 "Property" 結尾。
+ 0 is BindableProperty name
+
+
+ 缺少 "{0}" 的預設建構函式。
+ 0 is type name
+
+
+ 缺少符合 x:Arguments 的 "{0}" 建構函式。
+ 0 is type name
+
+
+ 因為 "{0}" 沒有 [ContentProperty] 屬性,所以無法設定其內容。
+ 0 is type name
+
+
+ 無法將值 "{0}" 轉換成 "{1}"。
+ 0 is a value, 1 is a type
+
+
+ 找不到 "{0}" 的列舉值。
+ 0 is enum value
+
+
+ XAML "{0}" 無效。
+ 0 is the invalid xaml snippet
+
+
+ 標記運算式未結束。
+
+
+ 剖析標記運算式時發生錯誤。
+
+
+ 找不到 "{0}" 的屬性、BindableProperty 或事件,或值與屬性之間的類型不相符。
+ 0 is member name
+
+
+ 找不到 "{0}::{1} ({2})" 的任何靜態方法。
+ 0 is type name, 1 is methodname, 2 is type arg list
+
+
+ 在型別 "{1}" 中找不到具有正確特徵標記的 EventHandler "{0}"。
+ 0 is the handler name, 1 is the declaring type
+
+
+ 名稱為 "{0}" 的元素已存在於此 NameScope 中。
+ 0 is the duplicated key
+
+
+ 在 "{1}" 上缺少強制屬性 "{0}"。
+ 0 is a property name, 1 is a type
+
+
+ 無法解析型別 "{1}" 上的屬性 "{0}" (缺少屬性或缺少存取子)。
+ 0 is a property name, 1 is a type name
+
+
+ 在 ResourceDictionary 中已有金鑰為 "{0}" 的資源。
+ 0 is key name
+
+
+ ResourceDictionary 中的資源需要 x:Key 屬性。
+
+
+ 找不到資源 "{0}"。
+ 0 is a resourceId
+
+
+ sbyte 列舉類型上,多重值列舉無效。
+
+
+ 樣式表需要來源或內容。
+
+
+ 來源屬性不是字串常值。
+
+
+ 樣式表不能同時有來源和內容。
+
+
+ 樣式屬性或內容不是字串常值。
+
+
+ 無法解析型別 "{0}"。
+ 0 is a type name
+
+
+ x:DataType 需要字串常值、{{x:Type}} 標記或 {{x:Nul}l}。
+
+
+ 未宣告的 xmlns 前置詞 "{0}"。
+ 0 is the xmlns prefix
+
+
+ x:Static: 在 "{1}" 中找不到名為 "{0}" 的公用 (或可存取內部) 靜態欄位、靜態屬性、常數或列舉值。
+ 0 is membername, 1 is type name
+
+
+ x:Static 的語法為 "[Member=][prefix:]typeName.staticMemberName"。
+
+
+ x:金鑰需要字串常值。
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Core.Design/AttributeTableBuilder.cs b/src/Controls/src/Core.Design/AttributeTableBuilder.cs
index 18530e028b9b..4f1e9a092d4b 100644
--- a/src/Controls/src/Core.Design/AttributeTableBuilder.cs
+++ b/src/Controls/src/Core.Design/AttributeTableBuilder.cs
@@ -1,9 +1,16 @@
using System;
using System.ComponentModel;
+using System.Globalization;
using System.Linq;
+using System.Reflection;
using System.Windows.Markup;
using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Layout2;
+using Microsoft.Maui.Controls.Shapes;
+using Microsoft.Maui.Graphics;
using Microsoft.Windows.Design;
+using Microsoft.Windows.Design.Metadata;
+using Rectangle = Microsoft.Maui.Graphics.Rectangle;
namespace Microsoft.Maui.Controls.Core.Design
{
@@ -70,6 +77,231 @@ public AttributeTableBuilder()
//new System.Windows.Markup.MarkupExtensionReturnTypeAttribute (),
}));
}
+
+ private void AddAttributesForTypes()
+ {
+ Type typeFromHandle = typeof(AbsoluteLayout);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(ActivityIndicator);
+ typeFromHandle = typeof(BoxView);
+ typeFromHandle = typeof(Button);
+ typeFromHandle = typeof(CarouselPage);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(CarouselView);
+ typeFromHandle = typeof(CheckBox);
+ typeFromHandle = typeof(CollectionView);
+ typeFromHandle = typeof(Color);
+ AddTypeAttributes(typeFromHandle, new TypeConverterAttribute(typeof(NamedColorsConverter)));
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Content"));
+ typeFromHandle = typeof(ConstraintExpression);
+ AddTypeAttributes(typeFromHandle, new MarkupExtensionReturnTypeAttribute());
+ typeFromHandle = typeof(ContentPage);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Content"));
+ typeFromHandle = typeof(ContentPresenter);
+ typeFromHandle = typeof(ContentView);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Content"));
+ typeFromHandle = typeof(DatePicker);
+ typeFromHandle = typeof(Easing);
+ AddTypeAttributes(typeFromHandle, new TypeConverterAttribute(typeof(StructOptionsConverter)));
+ typeFromHandle = typeof(Editor);
+ typeFromHandle = typeof(Ellipse);
+ typeFromHandle = typeof(Entry);
+ typeFromHandle = typeof(FlexLayout);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(FlyoutPage);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Detail"));
+ typeFromHandle = typeof(Frame);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Content"));
+ typeFromHandle = typeof(Grid);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+
+ typeFromHandle = typeof(GridLayout);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(Layout2.Layout);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(HorizontalStackLayout);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(VerticalStackLayout);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+
+ typeFromHandle = typeof(GroupableItemsView);
+ typeFromHandle = typeof(Image);
+ typeFromHandle = typeof(ImageButton);
+ typeFromHandle = typeof(IndicatorView);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("IndicatorLayout"));
+ typeFromHandle = typeof(InputView);
+ AddTypeAttributes(typeFromHandle, new TypeConverterAttribute(typeof(StringConverter)));
+ typeFromHandle = typeof(Label);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Text"));
+ typeFromHandle = typeof(LayoutOptions);
+ AddTypeAttributes(typeFromHandle, new TypeConverterAttribute(typeof(StructOptionsConverter)));
+ typeFromHandle = typeof(Line);
+ typeFromHandle = typeof(LinearItemsLayout);
+ AddTypeAttributes(typeFromHandle, new TypeConverterAttribute(typeof(StructOptionsConverter)));
+ typeFromHandle = typeof(ListView);
+ typeFromHandle = typeof(FlyoutPage);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Detail"));
+#pragma warning disable CS0618 // Type or member is obsolete
+ typeFromHandle = typeof(MasterDetailPage);
+#pragma warning restore CS0618 // Type or member is obsolete
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Detail"));
+ typeFromHandle = typeof(NavigationPage);
+ typeFromHandle = typeof(OpenGLView);
+ typeFromHandle = typeof(Page);
+ typeFromHandle = typeof(Path);
+ typeFromHandle = typeof(Picker);
+ typeFromHandle = typeof(Polygon);
+ typeFromHandle = typeof(Polyline);
+ typeFromHandle = typeof(ProgressBar);
+ typeFromHandle = typeof(RadioButton);
+ typeFromHandle = typeof(Rectangle);
+ typeFromHandle = typeof(RefreshView);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Content"));
+ typeFromHandle = typeof(RelativeLayout);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(ResourcesChangedEventArgs);
+ AddTypeAttributes(typeFromHandle, new TypeConverterAttribute(typeof(StructOptionsConverter)));
+ typeFromHandle = typeof(ScrollView);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Content"));
+ typeFromHandle = typeof(SearchBar);
+ typeFromHandle = typeof(SelectableItemsView);
+ typeFromHandle = typeof(Shell);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Items"));
+ typeFromHandle = typeof(Size);
+ AddTypeAttributes(typeFromHandle, new TypeConverterAttribute(typeof(StructOptionsConverter)));
+ typeFromHandle = typeof(Slider);
+ typeFromHandle = typeof(StackLayout);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(Stepper);
+ typeFromHandle = typeof(StructuredItemsView);
+ typeFromHandle = typeof(SwipeItemView);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Content"));
+ typeFromHandle = typeof(SwipeView);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Content"));
+ typeFromHandle = typeof(Switch);
+ typeFromHandle = typeof(TabbedPage);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Children"));
+ typeFromHandle = typeof(TableView);
+ AddTypeAttributes(typeFromHandle, new ContentPropertyAttribute("Root"));
+ typeFromHandle = typeof(TemplatedPage);
+ typeFromHandle = typeof(TemplatedView);
+ typeFromHandle = typeof(TimePicker);
+ typeFromHandle = typeof(View);
+ AddTypeAttributes(typeFromHandle, new TypeConverterAttribute(typeof(StringConverter)));
+ typeFromHandle = typeof(WebView);
+
+ AddCustomAttributes(typeof(AbsoluteLayout).Assembly, new XmlnsSupportsValidationAttribute("http://schemas.microsoft.com/dotnet/2021/maui", supportsValidation: false));
+ AddCallback(typeof(Style), delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes(new EditorBrowsableAttribute(EditorBrowsableState.Always), new ContentPropertyAttribute("Setters"), new TypeConverterAttribute(typeof(StringConverter)));
+ });
+ AddCallback(typeof(Setter), delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes(new EditorBrowsableAttribute(EditorBrowsableState.Always), new ContentPropertyAttribute("Value"));
+ });
+ foreach (Type item in from t in typeof(View).Assembly.ExportedTypes
+ where typeof(IFontElement).IsAssignableFrom(t)
+ select t)
+ {
+ AddCallback(item, delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes("FontSize", new TypeConverterAttribute(typeof(NonExclusiveEnumConverter)));
+ });
+ }
+ AddCallback(typeof(VisualElement), delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes("Visual", new TypeConverterAttribute(typeof(VisualDesignTypeConverter)));
+ });
+ AddCallback(typeof(ItemsView), delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes("ItemsLayout", new TypeConverterAttribute(typeof(ItemsLayoutDesignTypeConverter)));
+ });
+ AddCallback(typeof(InputView), delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes("Keyboard", new TypeConverterAttribute(typeof(KeyboardDesignTypeConverter)));
+ });
+ AddCallback(typeof(EntryCell), delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes("Keyboard", new TypeConverterAttribute(typeof(KeyboardDesignTypeConverter)));
+ });
+ AddCallback(typeof(OnPlatform<>), delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes(new EditorBrowsableAttribute(EditorBrowsableState.Always));
+ });
+ AddCallback(typeof(OnIdiom<>), delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes(new EditorBrowsableAttribute(EditorBrowsableState.Always));
+ });
+ }
+
+ private void AddTypeAttributes(Type type, params Attribute[] attribs)
+ {
+ AddCallback(type, delegate (AttributeCallbackBuilder builder)
+ {
+ builder.AddCustomAttributes(attribs);
+ });
+ }
+ }
+
+ internal class StructOptionsConverter : System.ComponentModel.TypeConverter
+ {
+ private static Lazy StandardValues = new Lazy(() => (from fi in typeof(T).GetFields().Where(delegate (FieldInfo fi)
+ {
+ if (fi.IsStatic && fi.IsPublic)
+ {
+ return !fi.CustomAttributes.Any((CustomAttributeData a) => a.AttributeType == typeof(ObsoleteAttribute));
+ }
+ return false;
+ }) select fi.Name).Union(from pi in typeof(T).GetProperties().Where(delegate (PropertyInfo pi)
+ {
+ if (pi.GetAccessors(nonPublic: true)[0].IsStatic && pi.GetAccessors(nonPublic: true)[0].IsPublic)
+ {
+ return !pi.CustomAttributes.Any((CustomAttributeData a) => a.AttributeType == typeof(ObsoleteAttribute));
+ }
+ return false;
+ }) select pi.Name).ToArray());
+
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ return sourceType == typeof(string);
+ }
+
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ if (value != null && StandardValues.Value.Contains(value.ToString()))
+ {
+ return null;
+ }
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ public override bool IsValid(ITypeDescriptorContext context, object value)
+ {
+ if (value == null)
+ {
+ return false;
+ }
+ if (!StandardValues.Value.Contains(value.ToString()))
+ {
+ return value.GetType().FullName.StartsWith("Microsoft.Maui.Controls.OnPlatform");
+ }
+ return true;
+ }
+
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ return new System.ComponentModel.TypeConverter.StandardValuesCollection(StandardValues.Value);
+ }
}
internal class AnythingConverter : System.ComponentModel.TypeConverter
diff --git a/src/Controls/src/Core.Design/Controls.Core.Design-net6.csproj b/src/Controls/src/Core.Design/Controls.Core.Design-net6.csproj
index 5c5986b0611c..9d6e7437ba73 100644
--- a/src/Controls/src/Core.Design/Controls.Core.Design-net6.csproj
+++ b/src/Controls/src/Core.Design/Controls.Core.Design-net6.csproj
@@ -1,30 +1,34 @@
-
+
- net6.0
- Microsoft.Maui.Controls.Core.Design
+ net472
+ Microsoft.Maui.Controls.Design
False
+ False
+ <_MauiDesignDllBuild Condition=" '$(OS)' != 'Unix' And '$(MSBuildRuntimeType)' == 'Full'">True
-
- Microsoft.Maui.Controls.Core.Design
-
-
+
True
+ $(MSBuildToolsPath)\..\..\..\Common7\IDE\PublicAssemblies\Microsoft.Windows.Design.Extensibility.dll
+
+
-
-
-
-
+
+
+
+
+
true
False
+
@@ -32,11 +36,6 @@
Microsoft.Maui.toolbox.xml
-
-
-
-
-
diff --git a/src/Controls/src/Core.Design/NamedColorsConverter.cs b/src/Controls/src/Core.Design/NamedColorsConverter.cs
new file mode 100644
index 000000000000..91d0fb4247bf
--- /dev/null
+++ b/src/Controls/src/Core.Design/NamedColorsConverter.cs
@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Globalization;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Microsoft.Maui.Controls.Core.Design
+{
+ public class NamedColorsConverter : System.ComponentModel.TypeConverter
+ {
+ class NameColorMapping
+ {
+ public NameColorMapping(string name, Graphics.Color color)
+ {
+ Name = name;
+ Color = color;
+ }
+
+ public string Name { get; set; }
+ public Graphics.Color Color { get; set; }
+ }
+
+ public NamedColorsConverter()
+ : base()
+ {
+ NamedColors = new List();
+
+ var fields = typeof(Graphics.Colors)
+ .GetFields(BindingFlags.Static | BindingFlags.Public);
+
+ foreach (var f in fields)
+ {
+ if (f.GetValue(null) is Graphics.Color c)
+ NamedColors.Add(new NameColorMapping(f.Name, c));
+ }
+ }
+
+ List NamedColors { get; }
+
+ // String -> Color
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if (sourceType == typeof(string))
+ return true;
+
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ // Color -> String
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
+ => true;
+
+ // String -> Color
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ var strVal = value?.ToString();
+
+ if (string.IsNullOrEmpty(strVal))
+ return Graphics.Colors.Black;
+
+ var namedColor = NamedColors.FirstOrDefault(n => n.Name.Equals(strVal))?.Color;
+
+ if (namedColor != null)
+ return namedColor;
+
+ try
+ {
+ return Graphics.Color.FromHex(strVal.TrimStart('#'));
+ }
+ catch { }
+
+ return Graphics.Colors.Black;
+ }
+
+ // Color -> String
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (value is Graphics.Color c)
+ {
+ var f = NamedColors.FirstOrDefault(n => n.Color.Equals(c));
+ if (f != null)
+ return f.Name;
+
+ return $"#{c.ToHex()}";
+ }
+
+ return null;
+ }
+
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ => true;
+
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ => false;
+
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ => new(NamedColors.Select(c => c.Name).ToArray());
+ }
+}
diff --git a/src/Controls/src/Core.Design/Properties/AssemblyInfo.cs b/src/Controls/src/Core.Design/Properties/AssemblyInfo.cs
index dcc6c5419572..b218e0bb35eb 100644
--- a/src/Controls/src/Core.Design/Properties/AssemblyInfo.cs
+++ b/src/Controls/src/Core.Design/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
using System.Reflection;
using Microsoft.Windows.Design.Metadata;
-[assembly: ProvideMetadata(typeof(Microsoft.Maui.Controls.Core.Design.RegisterMetadata))]
\ No newline at end of file
+[assembly: ProvideMetadata(typeof(Microsoft.Maui.Controls.Core.Design.RegisterMetadata))]
diff --git a/src/Controls/src/Core/AppHostBuilderExtensions.cs b/src/Controls/src/Core/AppHostBuilderExtensions.cs
new file mode 100644
index 000000000000..89265b7c40d9
--- /dev/null
+++ b/src/Controls/src/Core/AppHostBuilderExtensions.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Maui.Controls.Handlers;
+using Microsoft.Maui.Hosting;
+
+namespace Microsoft.Maui.Controls.Hosting
+{
+ public static class AppHostBuilderExtensions
+ {
+ static readonly Dictionary DefaultMauiControlHandlers = new Dictionary
+ {
+ { typeof(NavigationPage), typeof(NavigationPageHandler) },
+ };
+
+ public static IAppHostBuilder UseMauiControlsHandlers(this IAppHostBuilder builder)
+ {
+ return builder
+ .ConfigureMauiHandlers((_, handlersCollection) => handlersCollection.AddHandlers(DefaultMauiControlHandlers))
+ .ConfigureServices(ConfigureNativeServices);
+ }
+
+ private static void ConfigureNativeServices(HostBuilderContext arg1, IServiceCollection arg2)
+ {
+#if WINDOWS
+ if (!UI.Xaml.Application.Current.Resources.ContainsKey("MauiControlsPageControlStyle"))
+ {
+ var myResourceDictionary = new Microsoft.UI.Xaml.ResourceDictionary();
+ myResourceDictionary.Source = new Uri("ms-appx:///Microsoft.Maui.Controls/Platform/Windows/Styles/Resources.xbf");
+ Microsoft.UI.Xaml.Application.Current.Resources.MergedDictionaries.Add(myResourceDictionary);
+ }
+#endif
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Application.cs b/src/Controls/src/Core/Application.cs
index 576a435c3918..e4b362d9f1f5 100644
--- a/src/Controls/src/Core/Application.cs
+++ b/src/Controls/src/Core/Application.cs
@@ -19,7 +19,6 @@ public partial class Application : Element, IResourcesProvider, IApplicationCont
IAppIndexingProvider _appIndexProvider;
ReadOnlyCollection _logicalChildren;
- Page _mainPage;
static readonly SemaphoreSlim SaveSemaphore = new SemaphoreSlim(1, 1);
@@ -56,37 +55,82 @@ public IAppLinks AppLinks
public static Application Current { get; set; }
+ // TODO MAUI. What should this be?
public Page MainPage
{
- get { return _mainPage; }
+ get
+ {
+ if (Windows.Count == 0)
+ return null;
+
+ return Windows[0].View as Page;
+ }
set
{
if (value == null)
throw new ArgumentNullException("value");
- if (_mainPage == value)
+ if (MainPage == value)
return;
- OnPropertyChanging();
- if (_mainPage != null)
+ if (Windows.Count == 0)
{
- InternalChildren.Remove(_mainPage);
-
- _mainPage.Parent = null;
+ OnPropertyChanging();
+ AddWindow(new Window(value));
+ OnPropertyChanged();
}
+ else
+ {
+ var mainPage = MainPage;
- _mainPage = value;
+ if (mainPage == value)
+ return;
- if (_mainPage != null)
- {
- _mainPage.Parent = this;
- _mainPage.NavigationProxy.Inner = NavigationProxy;
- InternalChildren.Add(_mainPage);
+ OnPropertyChanging();
+ if (mainPage != null)
+ mainPage.Parent = null;
+
+ Windows[0].View = (IView)value;
+
+ if (mainPage != null)
+ mainPage.NavigationProxy.Inner = NavigationProxy;
+
+ OnPropertyChanged();
}
- OnPropertyChanged();
}
}
+ //public Page MainPage
+ //{
+ // get { return _mainPage; }
+ // set
+ // {
+ // if (value == null)
+ // throw new ArgumentNullException("value");
+
+ // if (_mainPage == value)
+ // return;
+
+ // OnPropertyChanging();
+ // if (_mainPage != null)
+ // {
+ // InternalChildren.Remove(_mainPage);
+ // _mainPage.Parent = null;
+ // }
+
+ // _mainPage = value;
+
+ // if (_mainPage != null)
+ // {
+ // _mainPage.Parent = this;
+ // _mainPage.NavigationProxy.Inner = NavigationProxy;
+ // InternalChildren.Add(_mainPage);
+ // }
+
+ // OnPropertyChanged();
+ // }
+ //}
+
public IDictionary Properties
{
get
@@ -277,14 +321,10 @@ protected virtual void OnStart()
{
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static void ClearCurrent() => Current = null;
+ internal static void ClearCurrent() => Current = null;
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static bool IsApplicationOrNull(Element element)
- {
- return element == null || element is Application;
- }
+ internal static bool IsApplicationOrNull(object element) =>
+ element == null || element is IApplication || element is IWindow;
internal override void OnParentResourcesChanged(IEnumerable> values)
{
@@ -401,12 +441,13 @@ protected internal virtual void CleanUp()
// Unhook everything that's referencing the main page so it can be collected
// This only comes up if we're disposing of an embedded Forms app, and will
// eventually go away when we fully support multiple windows
- if (_mainPage != null)
- {
- InternalChildren.Remove(_mainPage);
- _mainPage.Parent = null;
- _mainPage = null;
- }
+ // TODO MAUI
+ //if (_mainPage != null)
+ //{
+ // InternalChildren.Remove(_mainPage);
+ // _mainPage.Parent = null;
+ // _mainPage = null;
+ //}
NavigationProxy = null;
}
diff --git a/src/Controls/src/Core/ArrayExtensions.cs b/src/Controls/src/Core/ArrayExtensions.cs
new file mode 100644
index 000000000000..c3433082f1a7
--- /dev/null
+++ b/src/Controls/src/Core/ArrayExtensions.cs
@@ -0,0 +1,39 @@
+using System;
+using Microsoft.Maui.Controls.Internals;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal static class ArrayExtensions
+ {
+ public static T[] Insert(this T[] self, int index, T item)
+ {
+ var result = new T[self.Length + 1];
+ if (index > 0)
+ Array.Copy(self, result, index);
+
+ result[index] = item;
+
+ if (index < self.Length)
+ Array.Copy(self, index, result, index + 1, result.Length - index - 1);
+
+ return result;
+ }
+
+ public static T[] Remove(this T[] self, T item)
+ {
+ return self.RemoveAt(self.IndexOf(item));
+ }
+
+ public static T[] RemoveAt(this T[] self, int index)
+ {
+ var result = new T[self.Length - 1];
+ if (index > 0)
+ Array.Copy(self, result, index);
+
+ if (index < self.Length - 1)
+ Array.Copy(self, index + 1, result, index, self.Length - index - 1);
+
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Brush.cs b/src/Controls/src/Core/Brush.cs
index 7836991eb184..1314ab5fae74 100644
--- a/src/Controls/src/Core/Brush.cs
+++ b/src/Controls/src/Core/Brush.cs
@@ -3,7 +3,7 @@
namespace Microsoft.Maui.Controls
{
[TypeConverter(typeof(BrushTypeConverter))]
- public abstract class Brush : Element
+ public abstract partial class Brush : Element
{
public static Brush Default
{
diff --git a/src/Controls/src/Core/ColorExtensions.Windows.cs b/src/Controls/src/Core/ColorExtensions.Windows.cs
new file mode 100644
index 000000000000..236067522af8
--- /dev/null
+++ b/src/Controls/src/Core/ColorExtensions.Windows.cs
@@ -0,0 +1,28 @@
+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.Platform
+{
+ public static partial class ColorExtensions
+ {
+ [Obsolete("ToBrush is obsolete. Please use ToNative instead")]
+ public static WBrush ToBrush(this Graphics.Color color) => color.ToNative();
+
+
+ [Obsolete("ToFormsColor is obsolete. Please use ToColor instead")]
+ public static Graphics.Color ToFormsColor(this Windows.UI.Color color)
+ {
+ return color.ToColor();
+ }
+
+ [Obsolete("ToFormsColor is obsolete. Please use ToColor instead")]
+ public static Graphics.Color ToFormsColor(this WSolidColorBrush solidColorBrush)
+ {
+ return solidColorBrush.Color.ToColor();
+ }
+ }
+}
diff --git a/src/Controls/src/Core/ColorExtensions.cs b/src/Controls/src/Core/ColorExtensions.cs
index dc37ac04143c..3cca6fc50372 100644
--- a/src/Controls/src/Core/ColorExtensions.cs
+++ b/src/Controls/src/Core/ColorExtensions.cs
@@ -2,7 +2,7 @@
namespace Microsoft.Maui.Controls
{
- public static class ColorExtensions
+ public static partial class ColorExtensions
{
public static bool IsDefault(this Graphics.Color color)
{
@@ -14,16 +14,5 @@ public static bool IsNotDefault(this Graphics.Color color)
return !IsDefault(color);
}
}
-
- public static class KnownColor
- {
- public static Color Default => null;
-
- public static Color Transparent { get; } = new(255, 255, 255, 0);
-
- public static void SetAccent(Color value) => Accent = value;
-
- public static Color Accent { get; internal set; }
- }
}
diff --git a/src/Controls/src/Core/CompatServiceProvider.cs b/src/Controls/src/Core/CompatServiceProvider.cs
new file mode 100644
index 000000000000..f6a0df20ea01
--- /dev/null
+++ b/src/Controls/src/Core/CompatServiceProvider.cs
@@ -0,0 +1,55 @@
+#nullable enable
+using System;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using Microsoft.Maui.Hosting.Internal;
+
+namespace Microsoft.Maui.Controls
+{
+ // TODO: Remove this and use the real service provider.
+ static class CompatServiceProvider
+ {
+ static IServiceProvider? _serviceProvider;
+ static IEmbeddedFontLoader? _embeddedFontLoader;
+
+ public static IServiceProvider ServiceProvider => _serviceProvider ??= CreateCompatServiceProvider();
+
+ public static IFontRegistrar FontRegistrar => ServiceProvider.GetRequiredService();
+
+ public static IFontManager FontManager => ServiceProvider.GetRequiredService();
+
+ public static ILoggerFactory LoggerFactory => ServiceProvider.GetRequiredService();
+
+ public static void SetFontLoader(Type loaderType)
+ {
+ if (_embeddedFontLoader != null)
+ return;
+
+ _embeddedFontLoader = (IEmbeddedFontLoader)Activator.CreateInstance(loaderType)!;
+ if (FontRegistrar is FontRegistrar fr)
+ fr.SetFontLoader(_embeddedFontLoader);
+ }
+
+ public static void SetServiceProvider(IServiceProvider services)
+ {
+ if (_serviceProvider != null)
+ throw new InvalidOperationException("The service provider can only be set once.");
+
+ _serviceProvider = services;
+ _embeddedFontLoader = _serviceProvider.GetService();
+ }
+
+ static IServiceProvider CreateCompatServiceProvider()
+ {
+ var collection = new MauiServiceCollection();
+
+ collection.AddSingleton();
+ collection.AddSingleton(svc => new FontRegistrar(_embeddedFontLoader, svc.CreateLogger()));
+ collection.AddSingleton(svc => new FontManager(svc.GetRequiredService(), svc.CreateLogger()));
+
+ var provider = new MauiServiceProvider(collection, false);
+
+ return provider;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/ConstraintExpression.cs b/src/Controls/src/Core/ConstraintExpression.cs
index 7ca41217ec1c..c017645e7cc9 100644
--- a/src/Controls/src/Core/ConstraintExpression.cs
+++ b/src/Controls/src/Core/ConstraintExpression.cs
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Reflection;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Xaml;
diff --git a/src/Controls/src/Core/Controls.Core-net6.csproj b/src/Controls/src/Core/Controls.Core-net6.csproj
index ec5841e72792..b1197ebdcd00 100644
--- a/src/Controls/src/Core/Controls.Core-net6.csproj
+++ b/src/Controls/src/Core/Controls.Core-net6.csproj
@@ -1,25 +1,24 @@
-
+
netstandard2.0;$(MauiPlatforms)
Microsoft.Maui.Controls
Microsoft.Maui.Controls
disable
+ $(NoWarn);NU5128
Microsoft.Maui.Controls
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
high
@@ -27,4 +26,17 @@
UAP
+
+
+
+ $(TargetsForTfmSpecificBuildOutput);_MauiPackXamlDesignAssemblies
+
+
+
+
+
+ Design
+
+
+
diff --git a/src/Controls/src/Core/Controls.Core.csproj b/src/Controls/src/Core/Controls.Core.csproj
index 00b146aafa64..4fa3f7d06a74 100644
--- a/src/Controls/src/Core/Controls.Core.csproj
+++ b/src/Controls/src/Core/Controls.Core.csproj
@@ -1,19 +1,17 @@
-
+
- netstandard2.1;netstandard2.0
+ netstandard2.1;netstandard2.0;$(NonNet6Platforms)
Microsoft.Maui.Controls
Microsoft.Maui.Controls
+
-
-
-
diff --git a/src/Controls/src/Core/DragAndDrop/DragGestureRecognizer.cs b/src/Controls/src/Core/DragAndDrop/DragGestureRecognizer.cs
index cf96e22d0fb2..11ac65ddaff0 100644
--- a/src/Controls/src/Core/DragAndDrop/DragGestureRecognizer.cs
+++ b/src/Controls/src/Core/DragAndDrop/DragGestureRecognizer.cs
@@ -79,7 +79,7 @@ public void SendDropCompleted(DropCompletedEventArgs args)
}
[EditorBrowsable(EditorBrowsableState.Never)]
- public DragStartingEventArgs SendDragStarting(VisualElement element)
+ public DragStartingEventArgs SendDragStarting(IView element)
{
var args = new DragStartingEventArgs();
diff --git a/src/Controls/src/Core/DragAndDrop/DropGestureRecognizer.cs b/src/Controls/src/Core/DragAndDrop/DropGestureRecognizer.cs
index 9b03fd2abc05..121f60fcf35a 100644
--- a/src/Controls/src/Core/DragAndDrop/DropGestureRecognizer.cs
+++ b/src/Controls/src/Core/DragAndDrop/DropGestureRecognizer.cs
@@ -99,13 +99,13 @@ public async Task SendDrop(DropEventArgs args)
{
var dataView = args.Data;
var internalProperties = dataView.PropertiesInternal;
- VisualElement dragSource = null;
+ IView dragSource = null;
ImageSource sourceTarget = await dataView.GetImageAsync();
string text = await dataView.GetTextAsync();
if (internalProperties.ContainsKey("DragSource"))
{
- dragSource = (VisualElement)internalProperties["DragSource"];
+ dragSource = (IView)internalProperties["DragSource"];
if (sourceTarget == null && dragSource is IImageElement imageElement)
sourceTarget = imageElement.Source;
diff --git a/src/Controls/src/Core/EnumerableExtensions.cs b/src/Controls/src/Core/EnumerableExtensions.cs
index e179716407f9..72e1c92375e5 100644
--- a/src/Controls/src/Core/EnumerableExtensions.cs
+++ b/src/Controls/src/Core/EnumerableExtensions.cs
@@ -43,14 +43,6 @@ public static IEnumerable GetGesturesFor(this IEnumerable Append(this IEnumerable enumerable, T item)
- {
- foreach (T x in enumerable)
- yield return x;
-
- yield return item;
- }
-
public static void ForEach(this IEnumerable enumeration, Action action)
{
foreach (T item in enumeration)
@@ -103,13 +95,5 @@ public static int IndexOf(this IEnumerable enumerable, Func predi
return -1;
}
-
- public static IEnumerable Prepend(this IEnumerable enumerable, T item)
- {
- yield return item;
-
- foreach (T x in enumerable)
- yield return x;
- }
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/FileImageSource.cs b/src/Controls/src/Core/FileImageSource.cs
index 61be50df4c2a..e313483676b3 100644
--- a/src/Controls/src/Core/FileImageSource.cs
+++ b/src/Controls/src/Core/FileImageSource.cs
@@ -3,7 +3,7 @@
namespace Microsoft.Maui.Controls
{
[TypeConverter(typeof(FileImageSourceConverter))]
- public sealed class FileImageSource : ImageSource
+ public sealed partial class FileImageSource : ImageSource
{
public static readonly BindableProperty FileProperty = BindableProperty.Create("File", typeof(string), typeof(FileImageSource), default(string));
diff --git a/src/Controls/src/Core/FontAttributes.cs b/src/Controls/src/Core/FontAttributes.cs
index a4096c665216..6a71c04e8cd4 100644
--- a/src/Controls/src/Core/FontAttributes.cs
+++ b/src/Controls/src/Core/FontAttributes.cs
@@ -3,6 +3,14 @@
namespace Microsoft.Maui.Controls
{
+ [Flags]
+ public enum FontAttributes
+ {
+ None = 0,
+ Bold = 1 << 0,
+ Italic = 1 << 1
+ }
+
[Xaml.TypeConversion(typeof(FontAttributes))]
public sealed class FontAttributesConverter : TypeConverter
{
diff --git a/src/Controls/src/Core/FontElement.cs b/src/Controls/src/Core/FontElement.cs
index df11ac226c47..278f2dc23261 100644
--- a/src/Controls/src/Core/FontElement.cs
+++ b/src/Controls/src/Core/FontElement.cs
@@ -47,11 +47,8 @@ static void OnFontPropertyChanged(BindableObject bindable, object oldValue, obje
else
{
bindable.SetValue(FontFamilyProperty, font.FontFamily);
- if (font.UseNamedSize)
- bindable.SetValue(FontSizeProperty, Device.GetNamedSize(font.NamedSize, bindable.GetType(), true));
- else
- bindable.SetValue(FontSizeProperty, font.FontSize);
- bindable.SetValue(FontAttributesProperty, font.FontAttributes);
+ bindable.SetValue(FontSizeProperty, font.FontSize);
+ bindable.SetValue(FontAttributesProperty, font.GetFontAttributes());
}
SetCancelEvents(bindable, false);
}
@@ -70,7 +67,7 @@ static void OnFontFamilyChanged(BindableObject bindable, object oldValue, object
if (fontFamily != null)
bindable.SetValue(FontProperty, Font.OfSize(fontFamily, fontSize).WithAttributes(fontAttributes));
else
- bindable.SetValue(FontProperty, Font.SystemFontOfSize(fontSize, fontAttributes));
+ bindable.SetValue(FontProperty, Font.SystemFontOfSize(fontSize).WithAttributes(fontAttributes));
SetCancelEvents(bindable, false);
((IFontElement)bindable).OnFontFamilyChanged((string)oldValue, (string)newValue);
@@ -90,7 +87,7 @@ static void OnFontSizeChanged(BindableObject bindable, object oldValue, object n
if (fontFamily != null)
bindable.SetValue(FontProperty, Font.OfSize(fontFamily, fontSize).WithAttributes(fontAttributes));
else
- bindable.SetValue(FontProperty, Font.SystemFontOfSize(fontSize, fontAttributes));
+ bindable.SetValue(FontProperty, Font.SystemFontOfSize(fontSize).WithAttributes(fontAttributes));
SetCancelEvents(bindable, false);
((IFontElement)bindable).OnFontSizeChanged((double)oldValue, (double)newValue);
@@ -115,7 +112,7 @@ static void OnFontAttributesChanged(BindableObject bindable, object oldValue, ob
if (fontFamily != null)
bindable.SetValue(FontProperty, Font.OfSize(fontFamily, fontSize).WithAttributes(fontAttributes));
else
- bindable.SetValue(FontProperty, Font.SystemFontOfSize(fontSize, fontAttributes));
+ bindable.SetValue(FontProperty, Font.SystemFontOfSize(fontSize).WithAttributes(fontAttributes));
SetCancelEvents(bindable, false);
((IFontElement)bindable).OnFontAttributesChanged((FontAttributes)oldValue, (FontAttributes)newValue);
diff --git a/src/Controls/src/Core/FontExtensions.cs b/src/Controls/src/Core/FontExtensions.cs
new file mode 100644
index 000000000000..8b966fec9092
--- /dev/null
+++ b/src/Controls/src/Core/FontExtensions.cs
@@ -0,0 +1,27 @@
+#nullable enable
+using System;
+using Microsoft.Maui;
+namespace Microsoft.Maui.Controls
+{
+ public static class FontExtensions
+ {
+ public static Font WithAttributes(this Font font, FontAttributes attributes)
+ {
+ var bold = (attributes & FontAttributes.Bold) != 0;
+ var italic = (attributes & FontAttributes.Italic) != 0;
+ return font.WithWeight(bold ? FontWeight.Bold : FontWeight.Regular, italic ? FontSlant.Italic : FontSlant.Default);
+ }
+ public static FontAttributes GetFontAttributes(this Font font)
+ {
+ FontAttributes attributes = font.Weight == FontWeight.Bold ? FontAttributes.Bold : FontAttributes.None;
+ if (font.FontSlant != FontSlant.Default)
+ {
+ if (attributes == FontAttributes.None)
+ attributes = FontAttributes.Italic;
+ else
+ attributes = attributes | FontAttributes.Italic;
+ }
+ return attributes;
+ }
+ }
+}
diff --git a/src/Controls/src/Core/FontImageSource.cs b/src/Controls/src/Core/FontImageSource.cs
index 6038c2dfdc14..711fbacceda9 100644
--- a/src/Controls/src/Core/FontImageSource.cs
+++ b/src/Controls/src/Core/FontImageSource.cs
@@ -2,7 +2,7 @@
namespace Microsoft.Maui.Controls
{
- public class FontImageSource : ImageSource
+ public partial class FontImageSource : ImageSource
{
public override bool IsEmpty => string.IsNullOrEmpty(Glyph);
diff --git a/src/Controls/src/Core/FontTypeConverter.cs b/src/Controls/src/Core/FontTypeConverter.cs
index 58df2ac9eab7..2b21bfc1bccc 100644
--- a/src/Controls/src/Core/FontTypeConverter.cs
+++ b/src/Controls/src/Core/FontTypeConverter.cs
@@ -69,12 +69,12 @@ public override object ConvertFromInvariantString(string value)
if (name != null)
{
if (size == -1)
- return Font.OfSize(name, namedSize).WithAttributes(attributes);
+ size = Device.GetNamedSize(namedSize, null, false);
return Font.OfSize(name, size).WithAttributes(attributes);
}
if (size == -1)
- return Font.SystemFontOfSize(namedSize, attributes);
- return Font.SystemFontOfSize(size, attributes);
+ return Font.SystemFontOfSize(Device.GetNamedSize(namedSize, null, false)).WithAttributes(attributes);
+ return Font.SystemFontOfSize(size).WithAttributes(attributes);
}
throw new InvalidOperationException(string.Format("Cannot convert \"{0}\" into {1}", value, typeof(Font)));
@@ -87,9 +87,9 @@ public override string ConvertToInvariantString(object value)
var parts = new List();
if (!string.IsNullOrEmpty(font.FontFamily))
parts.Add(font.FontFamily);
- if ((font.FontAttributes & FontAttributes.Bold) == FontAttributes.Bold)
+ if (font.Weight == FontWeight.Bold)
parts.Add("Bold");
- if ((font.FontAttributes & FontAttributes.Italic) == FontAttributes.Italic)
+ if (font.FontSlant != FontSlant.Default)
parts.Add("Italic");
parts.Add($"{font.FontSize}");
return string.Join(", ", parts);
diff --git a/src/Controls/src/Core/HandlerImpl/Application.Impl.cs b/src/Controls/src/Core/HandlerImpl/Application.Impl.cs
index 73b2efffbd3a..a78d5c6eebfc 100644
--- a/src/Controls/src/Core/HandlerImpl/Application.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Application.Impl.cs
@@ -1,10 +1,38 @@
using System;
+using System.Collections.Generic;
namespace Microsoft.Maui.Controls
{
public partial class Application : IApplication
{
- public virtual IWindow CreateWindow(IActivationState activationState)
+ List _windows = new List();
+ public IReadOnlyList Windows => _windows.AsReadOnly();
+
+ IWindow IApplication.CreateWindow(IActivationState activationState)
+ {
+ IWindow window = CreateWindow(activationState);
+
+ AddWindow(window);
+
+ return window;
+ }
+
+ void AddWindow(IWindow window)
+ {
+ _windows.Add(window);
+
+ if (window is Element windowElement)
+ {
+ windowElement.Parent = this;
+ InternalChildren.Add(windowElement);
+ OnChildAdded(windowElement);
+ }
+
+ if (window is NavigableElement ne)
+ ne.NavigationProxy.Inner = NavigationProxy;
+ }
+
+ protected virtual IWindow CreateWindow(IActivationState activationState)
{
throw new NotImplementedException();
}
diff --git a/src/Controls/src/Core/HandlerImpl/Brush.Impl.cs b/src/Controls/src/Core/HandlerImpl/Brush.Impl.cs
new file mode 100644
index 000000000000..cf0ceb9f4af3
--- /dev/null
+++ b/src/Controls/src/Core/HandlerImpl/Brush.Impl.cs
@@ -0,0 +1,82 @@
+using Microsoft.Maui.Graphics;
+using GraphicsGradientStop = Microsoft.Maui.Graphics.GradientStop;
+
+namespace Microsoft.Maui.Controls
+{
+ public partial class Brush
+ {
+ public static implicit operator Brush(Paint paint)
+ {
+ if (paint is SolidPaint solidPaint)
+ return new SolidColorBrush { Color = solidPaint.Color };
+
+ if (paint is GradientPaint gradientPaint)
+ {
+ var gradientStopCollection = gradientPaint.GradientStops;
+
+ GradientStopCollection gradientStops = new GradientStopCollection();
+
+ for (int i = 0; i < gradientStopCollection.Length; i++)
+ {
+ var gs = gradientStopCollection[i];
+ gradientStops[i] = new GradientStop(gs.Color, gs.Offset);
+ }
+
+ if (gradientPaint is LinearGradientPaint linearGradientPaint)
+ {
+ var startPoint = linearGradientPaint.StartPoint;
+ var endPoint = linearGradientPaint.EndPoint;
+
+ return new LinearGradientBrush { GradientStops = gradientStops, StartPoint = startPoint, EndPoint = endPoint };
+ }
+
+ if (gradientPaint is RadialGradientPaint radialGradientPaint)
+ {
+ var center = radialGradientPaint.Center;
+ var radius = radialGradientPaint.Radius;
+
+ return new RadialGradientBrush { GradientStops = gradientStops, Center = center, Radius = radius };
+ }
+ }
+
+ return null;
+ }
+
+ public static implicit operator Paint(Brush brush)
+ {
+ if (brush is SolidColorBrush solidColorBrush)
+ return new SolidPaint { Color = solidColorBrush.Color };
+
+ if (brush is GradientBrush gradientBrush)
+ {
+ var gradientStopCollection = gradientBrush.GradientStops;
+
+ GraphicsGradientStop[] gradientStops = new GraphicsGradientStop[gradientStopCollection.Count];
+
+ for (int i = 0; i < gradientStopCollection.Count; i++)
+ {
+ var gs = gradientStopCollection[i];
+ gradientStops[i] = new GraphicsGradientStop(gs.Offset, gs.Color);
+ }
+
+ if (gradientBrush is LinearGradientBrush linearGradientBrush)
+ {
+ var startPoint = linearGradientBrush.StartPoint;
+ var endPoint = linearGradientBrush.EndPoint;
+
+ return new LinearGradientPaint { GradientStops = gradientStops, StartPoint = startPoint, EndPoint = endPoint };
+ }
+
+ if (gradientBrush is RadialGradientBrush radialGradientBrush)
+ {
+ var center = radialGradientBrush.Center;
+ var radius = radialGradientBrush.Radius;
+
+ return new RadialGradientPaint { GradientStops = gradientStops, Center = center, Radius = radius };
+ }
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/src/Controls/src/Core/HandlerImpl/ContentPage.Impl.cs b/src/Controls/src/Core/HandlerImpl/ContentPage.Impl.cs
index 411f533b17e3..316f07b3d9a9 100644
--- a/src/Controls/src/Core/HandlerImpl/ContentPage.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/ContentPage.Impl.cs
@@ -10,12 +10,9 @@ public partial class ContentPage : IPage, HotReload.IHotReloadableView
// TODO ezhart That there's a layout alignment here tells us this hierarchy needs work :)
public Primitives.LayoutAlignment HorizontalLayoutAlignment => Primitives.LayoutAlignment.Fill;
- // TODO ezhart super sus
- public Thickness Margin => Thickness.Zero;
-
IView IPage.Content => Content;
-
+
protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
{
@@ -35,7 +32,7 @@ protected override Size ArrangeOverride(Rectangle bounds)
if (Content is IFrameworkElement element)
{
element.Arrange(bounds);
- element.Handler?.SetFrame(element.Frame);
+ element.Handler?.NativeArrange(element.Frame);
}
return Frame.Size;
diff --git a/src/Controls/src/Core/HandlerImpl/Editor.Impl.cs b/src/Controls/src/Core/HandlerImpl/Editor.Impl.cs
index d06b0ae9180d..d9739b65a84a 100644
--- a/src/Controls/src/Core/HandlerImpl/Editor.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Editor.Impl.cs
@@ -5,5 +5,10 @@ public partial class Editor : IEditor
Font? _font;
Font ITextStyle.Font => _font ??= Font.OfSize(FontFamily, FontSize).WithAttributes(FontAttributes);
+
+ void IEditor.Completed()
+ {
+ (this as IEditorController).SendCompleted();
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/Entry.Impl.cs b/src/Controls/src/Core/HandlerImpl/Entry.Impl.cs
index 23124142a31d..68d11698d879 100644
--- a/src/Controls/src/Core/HandlerImpl/Entry.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Entry.Impl.cs
@@ -5,5 +5,10 @@ public partial class Entry : IEntry
Font? _font;
Font ITextStyle.Font => _font ??= Font.OfSize(FontFamily, FontSize).WithAttributes(FontAttributes);
+
+ void IEntry.Completed()
+ {
+ (this as IEntryController).SendCompleted();
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/Image.Impl.cs b/src/Controls/src/Core/HandlerImpl/Image.Impl.cs
new file mode 100644
index 000000000000..3efaadad212a
--- /dev/null
+++ b/src/Controls/src/Core/HandlerImpl/Image.Impl.cs
@@ -0,0 +1,31 @@
+namespace Microsoft.Maui.Controls
+{
+ public partial class Image : IImage
+ {
+ IImageSource IImageSourcePart.Source => Source;
+
+ void IImageSourcePart.UpdateIsLoading(bool isLoading) =>
+ IsLoading = isLoading;
+ }
+
+ public partial class ImageSource : IImageSource
+ {
+ }
+
+ public partial class FileImageSource : IFileImageSource
+ {
+ }
+
+ public partial class StreamImageSource : IStreamImageSource
+ {
+ }
+
+ public partial class UriImageSource : IUriImageSource, IStreamImageSource
+ {
+ }
+
+ public partial class FontImageSource : IFontImageSource
+ {
+ Font IFontImageSource.Font => Font.OfSize(FontFamily, Size);
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/NavigationPage.Impl.cs b/src/Controls/src/Core/HandlerImpl/NavigationPage.Impl.cs
new file mode 100644
index 000000000000..2c172d6cfdd6
--- /dev/null
+++ b/src/Controls/src/Core/HandlerImpl/NavigationPage.Impl.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Graphics;
+
+namespace Microsoft.Maui.Controls
+{
+ public partial class NavigationPage : IView
+ {
+ Thickness IView.Margin => Thickness.Zero;
+
+ protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
+ {
+ if (Content is IFrameworkElement frameworkElement)
+ {
+ frameworkElement.Measure(widthConstraint, heightConstraint);
+ }
+
+ return new Size(widthConstraint, heightConstraint);
+ }
+
+ protected override Size ArrangeOverride(Rectangle bounds)
+ {
+ // Update the Bounds (Frame) for this page
+ Layout(bounds);
+
+ if (Content is IFrameworkElement element)
+ {
+ element.Arrange(bounds);
+ element.Handler?.NativeArrange(element.Frame);
+ }
+
+ return Frame.Size;
+ }
+
+ IFrameworkElement Content =>
+ this.CurrentPage;
+ }
+
+}
diff --git a/src/Controls/src/Core/HandlerImpl/Page.Impl.cs b/src/Controls/src/Core/HandlerImpl/Page.Impl.cs
new file mode 100644
index 000000000000..0f1483000e6c
--- /dev/null
+++ b/src/Controls/src/Core/HandlerImpl/Page.Impl.cs
@@ -0,0 +1,13 @@
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Graphics;
+
+namespace Microsoft.Maui.Controls
+{
+ public partial class Page : IPage
+ {
+ IView IPage.Content => null;
+
+ // TODO ezhart super sus
+ public Thickness Margin => Thickness.Zero;
+ }
+}
diff --git a/src/Controls/src/Core/HandlerImpl/Picker.Impl.cs b/src/Controls/src/Core/HandlerImpl/Picker.Impl.cs
index ebaacb0cd48a..9d45fde0f53c 100644
--- a/src/Controls/src/Core/HandlerImpl/Picker.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Picker.Impl.cs
@@ -5,5 +5,19 @@ public partial class Picker : IPicker
Font? _font;
Font ITextStyle.Font => _font ??= Font.OfSize(FontFamily, FontSize).WithAttributes(FontAttributes);
+
+ int IItemDelegate.GetCount() => Items?.Count ?? ItemsSource?.Count ?? 0;
+
+ string IItemDelegate.GetItem(int index)
+ {
+ if (index < 0)
+ return "";
+ if (index < Items?.Count)
+ return Items[index];
+ if (index < ItemsSource?.Count)
+ return GetDisplayMember(ItemsSource[index]);
+ return "";
+ }
+
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/RadioButton.Impl.cs b/src/Controls/src/Core/HandlerImpl/RadioButton.Impl.cs
new file mode 100644
index 000000000000..b894ec203bb0
--- /dev/null
+++ b/src/Controls/src/Core/HandlerImpl/RadioButton.Impl.cs
@@ -0,0 +1,6 @@
+namespace Microsoft.Maui.Controls
+{
+ public partial class RadioButton : IRadioButton
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/SearchBar.Impl.cs b/src/Controls/src/Core/HandlerImpl/SearchBar.Impl.cs
index bd383aebde42..104bbb69c4ee 100644
--- a/src/Controls/src/Core/HandlerImpl/SearchBar.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/SearchBar.Impl.cs
@@ -7,5 +7,10 @@ public partial class SearchBar : ISearchBar
Font ITextStyle.Font => _font ??= Font.OfSize(FontFamily, FontSize).WithAttributes(FontAttributes);
bool ITextInput.IsTextPredictionEnabled => true;
+
+ void ISearchBar.SearchButtonPressed()
+ {
+ (this as ISearchBarController).OnSearchButtonPressed();
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/VisualElement.Impl.cs b/src/Controls/src/Core/HandlerImpl/VisualElement.Impl.cs
index 294ca8dbd24a..07d411e3974d 100644
--- a/src/Controls/src/Core/HandlerImpl/VisualElement.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/VisualElement.Impl.cs
@@ -1,8 +1,5 @@
using System;
-using System.Collections.Generic;
-using System.Diagnostics;
using System.Runtime.CompilerServices;
-using System.Text;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Layouts;
@@ -10,7 +7,8 @@ namespace Microsoft.Maui.Controls
{
public partial class VisualElement : IFrameworkElement
{
- private IViewHandler _handler;
+ Semantics _semantics;
+ IViewHandler _handler;
public Rectangle Frame => Bounds;
@@ -24,6 +22,18 @@ public IViewHandler Handler
}
}
+ Paint IFrameworkElement.Background
+ {
+ get
+ {
+ if (!Brush.IsNullOrEmpty(Background))
+ return Background;
+ if (BackgroundColor.IsNotDefault())
+ return new SolidColorBrush(BackgroundColor);
+ return null;
+ }
+ }
+
protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanged(propertyName);
@@ -44,12 +54,53 @@ Size IFrameworkElement.Arrange(Rectangle bounds)
return ArrangeOverride(bounds);
}
+ // The CloseEnough methods will likely go away once we get rid of the cause (see comments below); if not, we'll
+ // add a proper extension method or add a compare method to MG with a tolerance parameter
+ bool CloseEnough(double a, double b)
+ {
+ const double tolerance = 0.0001;
+
+ return (Math.Abs(a - b) < tolerance);
+ }
+
+ bool CloseEnough(Rectangle currentBounds, Rectangle newBounds)
+ {
+ if (!CloseEnough(currentBounds.X, newBounds.X))
+ {
+ return false;
+ }
+
+ if (!CloseEnough(currentBounds.Y, newBounds.Y))
+ {
+ return false;
+ }
+
+ if (!CloseEnough(currentBounds.Width, newBounds.Width))
+ {
+ return false;
+ }
+
+ if (!CloseEnough(currentBounds.Height, newBounds.Height))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
// ArrangeOverride provides a way to allow subclasses (e.g., Layout) to override Arrange even though
// the interface has to be explicitly implemented to avoid conflict with the old Arrange method
protected virtual Size ArrangeOverride(Rectangle bounds)
{
- // Setting Bounds here is equivalent to setting the Frame
- Bounds = this.ComputeFrame(bounds);
+ // We check the previous bounds here to avoid getting into a loop caused by the OnSizeAllocated override
+ // in View.cs; the arrange it forces ends up back here and if we have a margin, ComputeFrame will
+ // keep applying it in a loop until the element disappears. Hopefully we can remove the OnSizeAllocated
+ // hack at some point and avoid this extra check.
+ if (!CloseEnough(Bounds, bounds))
+ {
+ // Setting Bounds here is equivalent to setting the Frame
+ Bounds = this.ComputeFrame(bounds);
+ }
return Frame.Size;
}
@@ -66,9 +117,7 @@ void IFrameworkElement.InvalidateMeasure()
// InvalidateMeasureOverride provides a way to allow subclasses (e.g., Layout) to override InvalidateMeasure even though
// the interface has to be explicitly implemented to avoid conflict with the VisualElement.InvalidateMeasure method
- protected virtual void InvalidateMeasureOverride()
- {
- }
+ protected virtual void InvalidateMeasureOverride() => Handler?.UpdateValue(nameof(IFrameworkElement.InvalidateMeasure));
void IFrameworkElement.InvalidateArrange()
{
@@ -91,8 +140,9 @@ protected virtual Size MeasureOverride(double widthConstraint, double heightCons
Primitives.LayoutAlignment IFrameworkElement.HorizontalLayoutAlignment => default;
Primitives.LayoutAlignment IFrameworkElement.VerticalLayoutAlignment => default;
- Maui.Semantics _semantics;
- Maui.Semantics IFrameworkElement.Semantics
+ Visibility IFrameworkElement.Visibility => IsVisible.ToVisibility();
+
+ Semantics IFrameworkElement.Semantics
{
get => _semantics;
}
@@ -100,9 +150,9 @@ Maui.Semantics IFrameworkElement.Semantics
// We don't want to initialize Semantics until someone explicitly
// wants to modify some aspect of the semantics class
internal Semantics SetupSemantics() =>
- _semantics ??= new Maui.Semantics();
+ _semantics ??= new Semantics();
double IFrameworkElement.Width => WidthRequest;
- double IFrameworkElement.Height => HeightRequest;
+ double IFrameworkElement.Height => HeightRequest;
}
}
diff --git a/src/Controls/src/Core/HandlerImpl/Window.Impl.cs b/src/Controls/src/Core/HandlerImpl/Window.Impl.cs
new file mode 100644
index 000000000000..614012f85628
--- /dev/null
+++ b/src/Controls/src/Core/HandlerImpl/Window.Impl.cs
@@ -0,0 +1,86 @@
+#nullable enable
+
+using System;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+
+namespace Microsoft.Maui.Controls
+{
+ public class Window : VisualElement, IWindow
+ {
+ ReadOnlyCollection? _logicalChildren;
+ Page? _page;
+
+ ObservableCollection InternalChildren { get; } = new ObservableCollection();
+
+ internal override ReadOnlyCollection LogicalChildrenInternal =>
+ _logicalChildren ??= new ReadOnlyCollection(InternalChildren);
+
+ public Window()
+ {
+ InternalChildren.CollectionChanged += OnCollectionChanged;
+ }
+
+ public Window(Page page)
+ : this()
+ {
+ Page = page;
+ }
+
+
+ void SendWindowAppearing()
+ {
+ Page?.SendAppearing();
+ }
+
+ void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
+ {
+ if (e.OldItems != null)
+ {
+ for (var i = 0; i < e.OldItems.Count; i++)
+ {
+ var item = (Element?)e.OldItems[i];
+ OnChildRemoved(item, e.OldStartingIndex + i);
+ }
+ }
+
+ if (e.NewItems != null)
+ {
+ foreach (Element item in e.NewItems)
+ {
+ OnChildAdded(item);
+
+ // TODO once we have better life cycle events on pages
+ if (item is Page)
+ {
+ SendWindowAppearing();
+ }
+ }
+ }
+ }
+
+ public Page? Page
+ {
+ get => _page;
+ set
+ {
+ if (_page != null)
+ InternalChildren.Remove(_page);
+
+ _page = value;
+
+ if (_page != null)
+ InternalChildren.Add(_page);
+
+ if (value is NavigableElement ne)
+ ne.NavigationProxy.Inner = NavigationProxy;
+ }
+ }
+
+ IView IWindow.View
+ {
+ get => Page ?? throw new InvalidOperationException("No page was set on the window.");
+ set => Page = (Page)value;
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Android.cs b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Android.cs
new file mode 100644
index 000000000000..acfe3637c03c
--- /dev/null
+++ b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Android.cs
@@ -0,0 +1,277 @@
+#nullable enable
+
+using System;
+using System.Collections.Generic;
+using Android.Runtime;
+using Android.Views;
+using AndroidX.AppCompat.Widget;
+using AndroidX.Navigation;
+using AndroidX.Navigation.Fragment;
+using AndroidX.Navigation.UI;
+using Google.Android.Material.AppBar;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Handlers;
+using AView = Android.Views.View;
+
+namespace Microsoft.Maui.Controls.Handlers
+{
+ public partial class NavigationPageHandler :
+ ViewHandler
+ //, IManageFragments, IOnClickListener, ILifeCycleState
+ {
+ private NavHostFragment? _navHost;
+ private FragmentNavigator? _fragmentNavigator;
+ private Toolbar? _toolbar;
+ private AppBarLayout? _appBar;
+
+ NavHostFragment NavHost
+ {
+ get => _navHost ?? throw new InvalidOperationException($"NavHost cannot be null");
+ set => _navHost = value;
+ }
+
+ FragmentNavigator FragmentNavigator
+ {
+ get => _fragmentNavigator ?? throw new InvalidOperationException($"FragmentNavigator cannot be null");
+ set => _fragmentNavigator = value;
+ }
+
+ int NativeNavigationStackCount => NavHost?.NavController.BackStack.Size() - 1 ?? 0;
+ int NavigationStackCount => VirtualView?.Navigation.NavigationStack.Count ?? 0;
+
+ internal Toolbar Toolbar
+ {
+ get => _toolbar ?? throw new InvalidOperationException($"ToolBar cannot be null");
+ set => _toolbar = value;
+ }
+
+ internal AppBarLayout AppBar
+ {
+ get => _appBar ?? throw new InvalidOperationException($"AppBar cannot be null");
+ set => _appBar = value;
+ }
+
+ protected override AView CreateNativeView()
+ {
+ LayoutInflater? li = LayoutInflater.From(ContextWithValidation());
+ _ = li ?? throw new InvalidOperationException($"LayoutInflater cannot be null");
+
+ var view = li.Inflate(Resource.Layout.navigationlayout, null).JavaCast();
+ _ = view ?? throw new InvalidOperationException($"Resource.Layout.navigationlayout view not found");
+
+ _toolbar = view.FindViewById(Resource.Id.maui_toolbar);
+ _appBar = view.FindViewById(Resource.Id.appbar);
+ return view;
+ }
+
+ protected override void ConnectHandler(AView nativeView)
+ {
+ var fragmentManager = ContextWithValidation().GetFragmentManager();
+ _ = fragmentManager ?? throw new InvalidOperationException($"GetFragmentManager returned null");
+ _ = VirtualView ?? throw new InvalidOperationException($"VirtualView cannot be null");
+
+ NavHost = (NavHostFragment)
+ fragmentManager.FindFragmentById(Resource.Id.nav_host);
+
+ FragmentNavigator =
+ (FragmentNavigator)NavHost
+ .NavController
+ .NavigatorProvider
+ .GetNavigator(Java.Lang.Class.FromType(typeof(FragmentNavigator)));
+
+
+ var navGraphNavigator =
+ (NavGraphNavigator)NavHost
+ .NavController
+ .NavigatorProvider
+ .GetNavigator(Java.Lang.Class.FromType(typeof(NavGraphNavigator)));
+
+ base.ConnectHandler(nativeView);
+
+ INavigationPageController navController = VirtualViewWithValidation();
+ navController.PushRequested += OnPushed;
+ navController.PopRequested += OnPopped;
+ var inflater = NavHost.NavController.NavInflater;
+ NavGraph graph = new NavGraph(navGraphNavigator);
+
+ NavDestination navDestination;
+ List destinations = new List();
+ foreach (var page in VirtualView.Navigation.NavigationStack)
+ {
+ navDestination =
+ MauiFragmentNavDestination.
+ AddDestination(
+ page,
+ this,
+ graph,
+ FragmentNavigator);
+
+ destinations.Add(navDestination.Id);
+ }
+
+ graph.StartDestination = destinations[0];
+
+ NavHost.NavController.SetGraph(graph, null);
+
+ for (var i = NativeNavigationStackCount; i < NavigationStackCount; i++)
+ {
+ var dest = destinations[i];
+ NavHost.NavController.Navigate(dest);
+ }
+ }
+
+ protected override void DisconnectHandler(AView nativeView)
+ {
+ base.DisconnectHandler(nativeView);
+ var navController = (INavigationPageController)VirtualViewWithValidation();
+ navController.PushRequested -= OnPushed;
+ navController.PopRequested -= OnPopped;
+ }
+
+ void OnPushed(object? sender, NavigationRequestedEventArgs e)
+ {
+ var destination =
+ MauiFragmentNavDestination.AddDestination(e.Page, this, NavHost.NavController.Graph, FragmentNavigator);
+
+ NavHost.NavController.Navigate(destination.Id, null);
+ }
+
+ internal void OnPop()
+ {
+ VirtualViewWithValidation()
+ .Navigation
+ .PopAsync()
+ .FireAndForget((e) =>
+ {
+ Log.Warning(nameof(NavigationPageHandler), $"{e}");
+ });
+ }
+
+ void OnPopped(object? sender, NavigationRequestedEventArgs e)
+ {
+ NavHost.NavController.NavigateUp();
+ }
+
+ void UpdatePadding()
+ {
+ }
+
+ void UpdateBarTextColor()
+ {
+ UpdateBarBackground();
+ }
+
+ void UpdateBarBackground()
+ {
+ var context = Context;
+ var bar = Toolbar;
+ //ActionBarDrawerToggle toggle = _drawerToggle;
+
+ if (bar == null)
+ return;
+
+ //bool isNavigated = NavigationPageController.StackDepth > 1;
+ //bar.NavigationIcon = null;
+ var navPage = VirtualViewWithValidation();
+
+ //if (isNavigated)
+ //{
+ // if (NavigationPage.GetHasBackButton(currentPage) && !Context.IsDesignerContext())
+ // {
+ // if (toggle != null)
+ // {
+ // toggle.DrawerIndicatorEnabled = false;
+ // toggle.SyncState();
+ // }
+
+ // var activity = (AppCompatActivity)context.GetActivity();
+ // var icon = new DrawerArrowDrawable(activity.SupportActionBar.ThemedContext);
+ // icon.Progress = 1;
+ // bar.NavigationIcon = icon;
+
+ // var prevPage = Element.Peek(1);
+ // var backButtonTitle = NavigationPage.GetBackButtonTitle(prevPage);
+ // _defaultNavigationContentDescription = backButtonTitle != null
+ // ? bar.SetNavigationContentDescription(prevPage, backButtonTitle)
+ // : bar.SetNavigationContentDescription(prevPage, _defaultNavigationContentDescription);
+ // }
+ // else if (toggle != null && _flyoutPage != null)
+ // {
+ // toggle.DrawerIndicatorEnabled = _flyoutPage.ShouldShowToolbarButton();
+ // toggle.SyncState();
+ // }
+ //}
+ //else
+ //{
+ // if (toggle != null && _flyoutPage != null)
+ // {
+ // toggle.DrawerIndicatorEnabled = _flyoutPage.ShouldShowToolbarButton();
+ // toggle.SyncState();
+ // }
+ //}
+
+ var tintColor = navPage.BarBackgroundColor;
+ Brush barBackground = navPage.BarBackground;
+
+ if (barBackground == null && tintColor != null)
+ barBackground = new SolidColorBrush(tintColor);
+
+ if (barBackground != null)
+ bar.UpdateBackground(barBackground);
+ //else if (tintColor == null)
+ // bar.BackgroundTintMode = null;
+ //else
+ //{
+ // bar.Background = null;
+ // bar.BackgroundTintMode = PorterDuff.Mode.Src;
+ // bar.BackgroundTintList = ColorStateList.ValueOf(tintColor.ToNative());
+ //}
+
+ var textColor = navPage.BarTextColor;
+ if (textColor != null)
+ bar.SetTitleTextColor(textColor.ToNative().ToArgb());
+
+ //var navIconColor = NavigationPage.GetIconColor(currentPage);
+ //if (navIconColor != null && bar.NavigationIcon != null)
+ // DrawableExtensions.SetColorFilter(bar.NavigationIcon, navIconColor, FilterMode.SrcAtop);
+
+ bar.Title = navPage.CurrentPage?.Title ?? string.Empty;
+
+ //if (_toolbar.NavigationIcon != null && textColor != null)
+ //{
+ // var icon = _toolbar.NavigationIcon as DrawerArrowDrawable;
+ // if (icon != null)
+ // icon.Color = textColor.ToAndroid().ToArgb();
+ //}
+
+ //UpdateTitleIcon();
+
+ //UpdateTitleView();
+ }
+
+ void UpdateTitleIcon()
+ {
+ }
+ void UpdateTitleView()
+ {
+ }
+
+
+ public static void MapPadding(NavigationPageHandler handler, NavigationPage view)
+ => handler.UpdatePadding();
+
+ public static void MapBarTextColor(NavigationPageHandler handler, NavigationPage view)
+ => handler.UpdateBarTextColor();
+
+ public static void MapBarBackground(NavigationPageHandler handler, NavigationPage view)
+ => handler.UpdateBarBackground();
+
+ // TODO MAUI: Task Based Mappers?
+ public static void MapTitleIcon(NavigationPageHandler handler, NavigationPage view)
+ => handler.UpdateTitleIcon();
+
+ public static void MapTitleView(NavigationPageHandler handler, NavigationPage view)
+ => handler.UpdateTitleView();
+ }
+}
diff --git a/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Standard.cs b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Standard.cs
new file mode 100644
index 000000000000..c8aff483fe58
--- /dev/null
+++ b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Standard.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Maui.Handlers;
+
+namespace Microsoft.Maui.Controls.Handlers
+{
+ public partial class NavigationPageHandler :
+ ViewHandler
+ {
+ protected override object CreateNativeView()
+ {
+ throw new NotImplementedException();
+ }
+
+ public static void MapPadding(NavigationPageHandler handler, NavigationPage view) { }
+
+ public static void MapBarTextColor(NavigationPageHandler handler, NavigationPage view) { }
+
+ public static void MapBarBackground(NavigationPageHandler handler, NavigationPage view) { }
+
+ public static void MapTitleIcon(NavigationPageHandler handler, NavigationPage view) { }
+
+ public static void MapTitleView(NavigationPageHandler handler, NavigationPage view) { }
+ }
+}
diff --git a/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Windows.cs b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Windows.cs
new file mode 100644
index 000000000000..0c8e75c4711f
--- /dev/null
+++ b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.Windows.cs
@@ -0,0 +1,703 @@
+#nullable enable
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Threading.Tasks;
+using Windows.Devices.Input;
+using Windows.UI.Input;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media.Animation;
+using Windows.UI.Core;
+using Microsoft.UI.Xaml.Data;
+using Microsoft.Maui.Controls.Internals;
+using static Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Page;
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
+using WImageSource = Microsoft.UI.Xaml.Media.ImageSource;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Controls.Platform;
+
+namespace Microsoft.Maui.Controls.Handlers
+{
+ public partial class NavigationPageHandler :
+ ViewHandler, ITitleProvider, ITitleIconProvider,
+ ITitleViewProvider, IToolbarProvider, IToolBarForegroundBinder, IViewHandler
+ {
+ Page? _currentPage;
+ Page? _previousPage;
+
+ FlyoutPage? _parentFlyoutPage;
+ TabbedPage? _parentTabbedPage;
+ bool _showTitle = true;
+ VisualElementTracker _tracker;
+ EntranceThemeTransition _transition;
+ bool _parentsLookedUp = false;
+
+ public void BindForegroundColor(AppBar appBar)
+ {
+ SetAppBarForegroundBinding(appBar);
+ }
+
+ public void BindForegroundColor(AppBarButton button)
+ {
+ SetAppBarForegroundBinding(button);
+ }
+
+ protected VisualElementTracker Tracker
+ {
+ get { return _tracker; }
+ set
+ {
+ if (_tracker == value)
+ return;
+
+ if (_tracker != null)
+ _tracker.Dispose();
+
+ _tracker = value;
+ }
+ }
+
+ //public void Dispose()
+ //{
+ // Dispose(true);
+ //}
+
+ void SetAppBarForegroundBinding(FrameworkElement element)
+ {
+ element.SetBinding(Control.ForegroundProperty,
+ new Microsoft.UI.Xaml.Data.Binding { Path = new PropertyPath("TitleBrush"), Source = NativeView, RelativeSource = new RelativeSource { Mode = RelativeSourceMode.TemplatedParent } });
+ }
+
+ WBrush ITitleProvider.BarBackgroundBrush
+ {
+ set
+ {
+ NativeViewValidation().ToolbarBackground = value;
+ UpdateTitleOnParents();
+ }
+ }
+
+ WBrush ITitleProvider.BarForegroundBrush
+ {
+ set
+ {
+ NativeViewValidation().TitleBrush = value;
+ UpdateTitleOnParents();
+ }
+ }
+
+ bool ITitleProvider.ShowTitle
+ {
+ get { return _showTitle; }
+ set
+ {
+ if (_showTitle == value)
+ return;
+
+ _showTitle = value;
+ UpdateTitleVisible();
+ UpdateTitleOnParents();
+ }
+ }
+
+ public string Title
+ {
+ get { return _currentPage?.Title ?? String.Empty; }
+
+ set { /*Not implemented but required by interface*/ }
+ }
+
+ public WImageSource TitleIcon { get; set; }
+
+ public View? TitleView
+ {
+ get
+ {
+ if (_currentPage == null)
+ return null;
+
+ return NavigationPage.GetTitleView(_currentPage) as View;
+ }
+ set { /*Not implemented but required by interface*/ }
+ }
+
+ Task IToolbarProvider.GetCommandBarAsync()
+ {
+ return ((IToolbarProvider)NativeViewValidation())?.GetCommandBarAsync() ??
+ Task.FromResult((CommandBar?)null);
+ }
+
+ public event EventHandler ElementChanged;
+
+ public override Size GetDesiredSize(double widthConstraint, double heightConstraint)
+ {
+ if (VirtualView == null)
+ return Size.Zero;
+
+ var constraint = new Windows.Foundation.Size(widthConstraint, heightConstraint);
+ IViewHandler childRenderer = VirtualView.CurrentPage.Handler;
+ FrameworkElement? child = childRenderer.NativeView as FrameworkElement;
+ if (child == null)
+ return Size.Zero;
+
+ double oldWidth = child.Width;
+ double oldHeight = child.Height;
+
+ child.Height = double.NaN;
+ child.Width = double.NaN;
+
+ child.Measure(constraint);
+ var result = new Size(Math.Ceiling(child.DesiredSize.Width), Math.Ceiling(child.DesiredSize.Height));
+
+ child.Width = oldWidth;
+ child.Height = oldHeight;
+
+ return result;
+ }
+
+ protected override PageControl CreateNativeView()
+ {
+ return new PageControl();
+ }
+
+ public override void SetVirtualView(IView view)
+ {
+ base.SetVirtualView(view);
+
+ if (view != null && !(view is NavigationPage))
+ throw new ArgumentException("VirtualView must be a Page", nameof(view));
+
+ if (view is NavigationPage np && np != null && np.CurrentPage is 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.");
+
+ }
+
+ protected override void ConnectHandler(PageControl nativeView)
+ {
+ base.ConnectHandler(nativeView);
+
+ var virtualView = VirtualViewWithValidation();
+
+ nativeView.PointerPressed += OnPointerPressed;
+ nativeView.SizeChanged += OnNativeSizeChanged;
+ Tracker = new BackgroundTracker(Control.BackgroundProperty)
+ {
+ Element = virtualView,
+ Container = NativeView
+ };
+
+ SetPage(virtualView.CurrentPage, false, false);
+
+ nativeView.Loaded += OnLoaded;
+ nativeView.Unloaded += OnUnloaded;
+
+ nativeView.DataContext = virtualView.CurrentPage;
+
+ // Move this somewhere else
+ LookupRelevantParents();
+
+ // Enforce consistency rules on toolbar (show toolbar if top-level page is Navigation Page)
+ nativeView.ShouldShowToolbar = _parentFlyoutPage == null && _parentTabbedPage == null;
+ if (_parentTabbedPage != null)
+ virtualView.Appearing += OnElementAppearing;
+
+ virtualView.PushRequested += OnPushRequested;
+ virtualView.PopRequested += OnPopRequested;
+ virtualView.PopToRootRequested += OnPopToRootRequested;
+ virtualView.InternalChildren.CollectionChanged += OnChildrenChanged;
+
+ if (!string.IsNullOrEmpty(virtualView.AutomationId))
+ nativeView.SetValue(Microsoft.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, virtualView.AutomationId);
+
+ PushExistingNavigationStack();
+ }
+
+ protected override void DisconnectHandler(PageControl nativeView)
+ {
+ base.DisconnectHandler(nativeView);
+
+ if (VirtualView == null)
+ return;
+
+ VirtualView.PushRequested -= OnPushRequested;
+ VirtualView.PopRequested -= OnPopRequested;
+ VirtualView.PopToRootRequested -= OnPopToRootRequested;
+ VirtualView.InternalChildren.CollectionChanged -= OnChildrenChanged;
+ nativeView.PointerPressed -= OnPointerPressed;
+ nativeView.SizeChanged -= OnNativeSizeChanged;
+ nativeView.Loaded -= OnLoaded;
+ nativeView.Unloaded -= OnUnloaded;
+
+ VirtualView.SendDisappearing();
+
+ nativeView.PointerPressed -= OnPointerPressed;
+ nativeView.SizeChanged -= OnNativeSizeChanged;
+ nativeView.Loaded -= OnLoaded;
+ nativeView.Unloaded -= OnUnloaded;
+
+ if (_parentTabbedPage != null)
+ VirtualView.Appearing -= OnElementAppearing;
+
+ SetPage(null, false, true);
+ _previousPage = null;
+
+ if (_parentTabbedPage != null)
+ _parentTabbedPage.PropertyChanged -= MultiPagePropertyChanged;
+
+ if (_parentFlyoutPage != null)
+ _parentFlyoutPage.PropertyChanged -= MultiPagePropertyChanged;
+ }
+
+ protected virtual void OnElementChanged(VisualElementChangedEventArgs e)
+ {
+ EventHandler changed = ElementChanged;
+ if (changed != null)
+ changed(this, e);
+ }
+
+ WBrush GetBarBackgroundColorBrush()
+ {
+ object defaultColor = GetDefaultColor();
+
+ if (VirtualViewWithValidation().BarBackgroundColor.IsDefault() && defaultColor != null)
+ return (WBrush)defaultColor;
+
+ return Maui.ColorExtensions.ToNative(VirtualViewWithValidation().BarBackgroundColor);
+ }
+
+ static WBrush? GetBarBackgroundBrush(NavigationPage navigationPage)
+ {
+ var barBackground = navigationPage.BarBackground;
+ object defaultColor = GetDefaultColor();
+
+ if (!Brush.IsNullOrEmpty(barBackground))
+ return barBackground.ToBrush();
+
+ if (navigationPage.BarBackgroundColor != null)
+ return navigationPage.BarBackgroundColor.ToNative();
+
+ if (defaultColor != null)
+ return (WBrush)defaultColor;
+
+ return null;
+ }
+
+ static WBrush GetBarForegroundBrush(NavigationPage navigationPage)
+ {
+ object defaultColor = Microsoft.UI.Xaml.Application.Current.Resources["ApplicationForegroundThemeBrush"];
+ if (navigationPage.BarTextColor.IsDefault())
+ return (WBrush)defaultColor;
+ return Maui.ColorExtensions.ToNative(navigationPage.BarTextColor);
+ }
+
+ bool GetIsNavBarPossible()
+ {
+ return _showTitle;
+ }
+
+ void LookupRelevantParents()
+ {
+ IEnumerable parentPages = VirtualViewWithValidation().GetParentPages();
+
+ if (_parentTabbedPage != null)
+ _parentTabbedPage.PropertyChanged -= MultiPagePropertyChanged;
+
+ if (_parentFlyoutPage != null)
+ _parentFlyoutPage.PropertyChanged -= MultiPagePropertyChanged;
+
+ foreach (Page parentPage in parentPages)
+ {
+ _parentTabbedPage = parentPage as TabbedPage;
+ _parentFlyoutPage = parentPage as FlyoutPage;
+ }
+
+ if (_parentTabbedPage != null)
+ _parentTabbedPage.PropertyChanged += MultiPagePropertyChanged;
+ if (_parentFlyoutPage != null)
+ _parentFlyoutPage.PropertyChanged += MultiPagePropertyChanged;
+
+ UpdateShowTitle();
+ UpdateTitleOnParents();
+ _parentsLookedUp = true;
+ }
+
+ void MultiPagePropertyChanged(object? sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == "CurrentPage" || e.PropertyName == "Detail")
+ {
+ UpdateTitleOnParents();
+ UpdateTitleIcon();
+ UpdateTitleView();
+ }
+ }
+
+ void OnBackClicked(object sender, RoutedEventArgs e)
+ {
+ VirtualView?.SendBackButtonPressed();
+ }
+
+ void OnChildrenChanged(object? sender, NotifyCollectionChangedEventArgs e)
+ {
+ UpdateBackButton();
+ }
+
+ // TODO MAUI: hmmmmmm can we make this not be property changed based?
+ void OnCurrentPagePropertyChanged(object? sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == NavigationPage.HasBackButtonProperty.PropertyName)
+ UpdateBackButton();
+ else if (e.PropertyName == NavigationPage.BackButtonTitleProperty.PropertyName)
+ UpdateBackButtonTitle();
+ else if (e.PropertyName == NavigationPage.HasNavigationBarProperty.PropertyName)
+ UpdateTitleVisible();
+ else if (e.PropertyName == Page.TitleProperty.PropertyName)
+ UpdateTitleOnParents();
+ else if (e.PropertyName == NavigationPage.TitleIconImageSourceProperty.PropertyName)
+ UpdateTitleIcon();
+ else if (e.PropertyName == NavigationPage.TitleViewProperty.PropertyName)
+ UpdateTitleView();
+ }
+
+ void OnElementAppearing(object? sender, EventArgs e)
+ {
+ UpdateTitleVisible();
+ UpdateBackButton();
+ }
+
+ void OnLoaded(object? sender, RoutedEventArgs args)
+ {
+ if (VirtualView == null)
+ return;
+
+ VirtualView.SendAppearing();
+ UpdateBackButton();
+ UpdateTitleOnParents();
+
+ if (_parentFlyoutPage != null)
+ {
+ UpdateTitleView();
+ UpdateTitleIcon();
+ }
+ }
+
+ void OnNativeSizeChanged(object? sender, SizeChangedEventArgs e)
+ {
+ UpdateContainerArea();
+ }
+
+ void OnPointerPressed(object? sender, PointerRoutedEventArgs e)
+ {
+ if (e.Handled)
+ return;
+
+ var point = e.GetCurrentPoint(NativeView);
+ if (point == null)
+ return;
+
+ if (point.PointerDeviceType != PointerDeviceType.Mouse)
+ return;
+
+ if (point.Properties.IsXButton1Pressed)
+ {
+ e.Handled = true;
+ OnBackClicked(NativeViewValidation(), e);
+ }
+ }
+
+ protected virtual void OnPopRequested(object? sender, NavigationRequestedEventArgs e)
+ {
+ var newCurrent = VirtualViewWithValidation().Peek(1);
+ SetPage(newCurrent, e.Animated, true);
+ }
+
+ protected virtual void OnPopToRootRequested(object? sender, NavigationRequestedEventArgs e)
+ {
+ SetPage(e.Page, e.Animated, true);
+ }
+
+ protected virtual void OnPushRequested(object? sender, NavigationRequestedEventArgs e)
+ {
+ SetPage(e.Page, e.Animated, false);
+ }
+
+ void OnUnloaded(object? sender, RoutedEventArgs args)
+ {
+ VirtualView?.SendDisappearing();
+ }
+
+ void PushExistingNavigationStack()
+ {
+ foreach (var page in VirtualViewWithValidation().Pages)
+ {
+ SetPage(page, false, false);
+ }
+ }
+
+ void SetPage(Page? page, bool isAnimated, bool isPopping)
+ {
+ if (_currentPage != null)
+ {
+ if (isPopping)
+ {
+ _currentPage.Cleanup();
+ NativeViewValidation().TitleView?.Cleanup();
+ }
+
+ NativeViewValidation().Content = null;
+ _currentPage.PropertyChanged -= OnCurrentPagePropertyChanged;
+ }
+
+ if (!isPopping)
+ _previousPage = _currentPage;
+
+ _currentPage = page;
+
+ if (page == null)
+ return;
+
+ UpdateBackButton();
+ UpdateBackButtonTitle();
+
+ page.PropertyChanged += OnCurrentPagePropertyChanged;
+
+ IViewHandler renderer = page.GetOrCreateHandler(this.MauiContext);
+
+ UpdateTitleVisible();
+ UpdateTitleOnParents();
+ UpdateTitleView();
+
+ SetupPageTransition(_transition, isAnimated, isPopping);
+
+ NativeViewValidation().Content = renderer.NativeView;
+ NativeViewValidation().DataContext = page;
+ }
+
+ protected virtual void SetupPageTransition(Transition transition, bool isAnimated, bool isPopping)
+ {
+ PageControl nativeView = NativeViewValidation();
+ if (isAnimated && transition == null)
+ {
+ transition = new EntranceThemeTransition();
+ _transition = (EntranceThemeTransition)transition;
+ nativeView.ContentTransitions = new TransitionCollection();
+ }
+
+ if (!isAnimated && nativeView.ContentTransitions?.Count > 0)
+ {
+ nativeView.ContentTransitions.Clear();
+ }
+ else if (isAnimated &&
+ nativeView.ContentTransitions != null &&
+ nativeView.ContentTransitions.Contains(transition) == false)
+ {
+ nativeView.ContentTransitions.Clear();
+ nativeView.ContentTransitions.Add(transition);
+ }
+ }
+
+ void UpdateBackButtonTitle()
+ {
+ string title;
+ if (_previousPage != null)
+ title = NavigationPage.GetBackButtonTitle(_previousPage);
+ else
+ title = String.Empty;
+
+ NativeViewValidation().BackButtonTitle = title;
+ }
+
+ void UpdateContainerArea()
+ {
+ VirtualViewWithValidation().ContainerArea = new Rectangle(0, 0, NativeViewValidation().ContentWidth, NativeViewValidation().ContentHeight);
+ }
+
+ void UpdateTitleVisible()
+ {
+ UpdateTitleOnParents();
+
+ bool showing = NativeViewValidation().TitleVisibility == Visibility.Visible;
+ bool newValue = GetIsNavBarPossible() && NavigationPage.GetHasNavigationBar(_currentPage);
+ if (showing == newValue)
+ return;
+
+ NativeViewValidation().TitleVisibility = newValue ? Visibility.Visible : Visibility.Collapsed;
+
+ // Force ContentHeight/Width to update, doesn't work from inside PageControl for some reason
+ NativeViewValidation().UpdateLayout();
+ UpdateContainerArea();
+ }
+
+ void UpdateShowTitle()
+ {
+ ((ITitleProvider)this).ShowTitle = _parentTabbedPage == null && _parentFlyoutPage == null;
+ }
+
+ static object GetDefaultColor()
+ {
+ return Microsoft.UI.Xaml.Application.Current.Resources["SystemControlBackgroundChromeMediumLowBrush"];
+ }
+
+ void UpdateBackButton()
+ {
+ if (_currentPage == null)
+ {
+ return;
+ }
+
+ bool showBackButton = VirtualViewWithValidation().InternalChildren.Count > 1 && NavigationPage.GetHasBackButton(_currentPage);
+ if (NativeVersion.IsDesktop)
+ {
+ //TODO MAUI: this means it's running as a desktop app
+ }
+ else
+ {
+ var navManager = SystemNavigationManager.GetForCurrentView();
+ if(navManager != null)
+ navManager.AppViewBackButtonVisibility = showBackButton ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
+ }
+
+ NativeView.SetBackButtonTitle(VirtualViewWithValidation());
+ }
+
+ void UpdateTitleOnParents()
+ {
+ if (VirtualView == null || _currentPage == null)
+ return;
+
+ ITitleProvider? render = null;
+ if (_parentTabbedPage != null)
+ {
+ render = _parentTabbedPage.Handler as ITitleProvider;
+ if (render != null)
+ render.ShowTitle = (_parentTabbedPage.CurrentPage == VirtualView) && NavigationPage.GetHasNavigationBar(_currentPage);
+ }
+
+ if (_parentFlyoutPage != null)
+ {
+ render = _parentFlyoutPage.Handler as ITitleProvider;
+ if (render != null)
+ render.ShowTitle = (_parentFlyoutPage.Detail == VirtualView) && NavigationPage.GetHasNavigationBar(_currentPage);
+ }
+
+ if (render != null && render.ShowTitle)
+ {
+ render.Title = _currentPage.Title;
+
+ if (!Brush.IsNullOrEmpty(VirtualView.BarBackground))
+ render.BarBackgroundBrush = GetBarBackgroundBrush(VirtualView);
+ else
+ render.BarBackgroundBrush = GetBarBackgroundColorBrush();
+
+ render.BarForegroundBrush = GetBarForegroundBrush(VirtualView);
+ }
+
+ if (_showTitle || (render != null && render.ShowTitle))
+ {
+ ToolbarManager.UpdateToolbarItems(VirtualView)
+ .FireAndForget((e)=> Log.Warning(nameof(NavigationPage), $"{e}"));
+ }
+ }
+
+ void UpdatePadding()
+ {
+ NativeViewValidation().TitleInset = VirtualViewWithValidation().Padding.Left;
+ }
+
+ void UpdateTitleColor()
+ {
+ (this as ITitleProvider).BarForegroundBrush = GetBarForegroundBrush(VirtualViewWithValidation());
+ }
+
+ void UpdateNavigationBarBackground()
+ {
+ (this as ITitleProvider).BarBackgroundBrush = GetBarBackgroundBrush(VirtualViewWithValidation());
+ }
+
+ void UpdateTitleIcon() =>
+ UpdateTitleIconAsync()
+ .FireAndForget(errorCallback: (e) => Log.Warning(nameof(TitleIcon), $"{e}"));
+
+ async Task UpdateTitleIconAsync()
+ {
+ var page = _currentPage;
+ if (page == null)
+ return;
+
+ ImageSource source = NavigationPage.GetTitleIconImageSource(page);
+
+ TitleIcon = await source.ToWindowsImageSourceAsync();
+
+ if (NativeView == null || _currentPage != page)
+ return;
+
+ NativeView.TitleIcon = TitleIcon;
+
+ if (_parentFlyoutPage != null && this is ITitleIconProvider parent)
+ parent.TitleIcon = TitleIcon;
+
+ NativeView.UpdateLayout();
+ UpdateContainerArea();
+ }
+
+ void UpdateTitleView()
+ {
+ // if the life cycle hasn't reached the point where _parentFlyoutPage gets wired up then
+ // don't update the title view
+ if (_currentPage == null || !_parentsLookedUp)
+ return;
+
+ // If the container TitleView gets initialized before the FP TitleView it causes the
+ // FP TitleView to not render correctly
+ if (_parentFlyoutPage != null)
+ {
+ if (this is ITitleViewProvider parent)
+ parent.TitleView = TitleView;
+ }
+ else if (_parentFlyoutPage == null)
+ NativeViewValidation().TitleView = TitleView;
+
+ }
+
+ void UpdateToolbarPlacement()
+ {
+ if (NativeView == null)
+ {
+ return;
+ }
+
+ NativeView.ToolbarPlacement = VirtualView.OnThisPlatform().GetToolbarPlacement();
+ }
+
+ void UpdateToolbarDynamicOverflowEnabled()
+ {
+ if (NativeView == null)
+ {
+ return;
+ }
+
+ NativeView.ToolbarDynamicOverflowEnabled = VirtualView.OnThisPlatform().GetToolbarDynamicOverflowEnabled();
+ }
+
+ public static void MapPadding(NavigationPageHandler handler, NavigationPage view) =>
+ handler.UpdatePadding();
+
+ public static void MapBarTextColor(NavigationPageHandler handler, NavigationPage view) => handler.UpdateTitleColor();
+
+ public static void MapBarBackground(NavigationPageHandler handler, NavigationPage view) => handler.UpdateNavigationBarBackground();
+
+ // TODO MAUI: Task Based Mappers?
+ public static void MapTitleIcon(NavigationPageHandler handler, NavigationPage view) => handler.UpdateTitleIcon();
+
+ public static void MapTitleView(NavigationPageHandler handler, NavigationPage view) => handler.UpdateTitleView();
+
+ public static void MapToolbarPlacement(NavigationPageHandler handler, NavigationPage view) => handler.UpdateToolbarPlacement();
+
+ public static void MapToolbarDynamicOverflowEnabled(NavigationPageHandler handler, NavigationPage view) => handler.UpdateToolbarDynamicOverflowEnabled();
+ }
+}
diff --git a/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.cs b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.cs
new file mode 100644
index 000000000000..952591e22c8e
--- /dev/null
+++ b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Maui.Handlers;
+
+#if WINDOWS
+using static Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Page;
+#endif
+
+namespace Microsoft.Maui.Controls.Handlers
+{
+ public partial class NavigationPageHandler
+ {
+ public static PropertyMapper NavigationPageMapper
+ = new PropertyMapper(ViewHandler.ViewMapper)
+ {
+ [NavigationPage.BarTextColorProperty.PropertyName] = MapBarTextColor,
+ [NavigationPage.BarBackgroundColorProperty.PropertyName] = MapBarBackground,
+ [NavigationPage.BarBackgroundProperty.PropertyName] = MapBarBackground,
+ [nameof(IPadding.Padding)] = MapPadding,
+ [nameof(NavigationPage.TitleIconImageSourceProperty.PropertyName)] = MapTitleIcon,
+ [nameof(NavigationPage.TitleViewProperty.PropertyName)] = MapTitleView,
+
+#if WINDOWS
+ [nameof(ToolbarPlacementProperty.PropertyName)] = MapToolbarPlacement,
+ [nameof(ToolbarDynamicOverflowEnabledProperty.PropertyName)] = MapToolbarDynamicOverflowEnabled,
+#endif
+ };
+
+ public NavigationPageHandler() : base(NavigationPageMapper)
+ {
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.iOS.cs b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.iOS.cs
new file mode 100644
index 000000000000..7bb18867b660
--- /dev/null
+++ b/src/Controls/src/Core/Handlers/NavigationPage/NavigationPageHandler.iOS.cs
@@ -0,0 +1,202 @@
+#nullable enable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Handlers;
+using UIKit;
+
+namespace Microsoft.Maui.Controls.Handlers
+{
+ public partial class NavigationPageHandler :
+ ViewHandler, INativeViewHandler
+ {
+ ControlsNavigationController _controlsNavigationController;
+ UIViewController? INativeViewHandler.ViewController => _controlsNavigationController;
+
+ protected override UIView CreateNativeView()
+ {
+ _controlsNavigationController = new ControlsNavigationController(this);
+
+ if (_controlsNavigationController.View == null)
+ throw new NullReferenceException("ControlsNavigationController.View is null");
+
+ return _controlsNavigationController.View;
+ }
+
+ public static void MapPadding(NavigationPageHandler handler, NavigationPage view) { }
+
+ public static void MapTitleIcon(NavigationPageHandler handler, NavigationPage view) { }
+
+ public static void MapTitleView(NavigationPageHandler handler, NavigationPage view) { }
+
+ public static void MapBarBackground(NavigationPageHandler handler, NavigationPage view)
+ {
+ var NavPage = handler.VirtualViewWithValidation();
+ var barBackgroundBrush = NavPage.BarBackground;
+
+ if (Brush.IsNullOrEmpty(barBackgroundBrush) &&
+ NavPage.BarBackgroundColor != null)
+ barBackgroundBrush = new SolidColorBrush(NavPage.BarBackgroundColor);
+
+ if (barBackgroundBrush == null)
+ return;
+
+ var navController = handler._controlsNavigationController;
+ var NavigationBar = navController.NavigationBar;
+
+ if (NativeVersion.IsAtLeast(13))
+ {
+ var navigationBarAppearance = NavigationBar.StandardAppearance;
+
+ navigationBarAppearance.ConfigureWithOpaqueBackground();
+
+ //if (barBackgroundColor == null)
+ //{
+ // navigationBarAppearance.BackgroundColor = ColorExtensions.BackgroundColor;
+
+ // var parentingViewController = GetParentingViewController();
+ // parentingViewController?.SetupDefaultNavigationBarAppearance();
+ //}
+ //else
+ // navigationBarAppearance.BackgroundColor = barBackgroundColor.ToUIColor();
+
+ var backgroundImage = NavigationBar.GetBackgroundImage(barBackgroundBrush);
+ navigationBarAppearance.BackgroundImage = backgroundImage;
+
+ NavigationBar.CompactAppearance = navigationBarAppearance;
+ NavigationBar.StandardAppearance = navigationBarAppearance;
+ NavigationBar.ScrollEdgeAppearance = navigationBarAppearance;
+ }
+ else
+ {
+ var backgroundImage = NavigationBar.GetBackgroundImage(barBackgroundBrush);
+ NavigationBar.SetBackgroundImage(backgroundImage, UIBarMetrics.Default);
+ }
+ }
+
+ public static void MapBarTextColor(NavigationPageHandler handler, NavigationPage view)
+ {
+ var NavPage = handler.VirtualViewWithValidation();
+
+ var navController = handler._controlsNavigationController;
+ var NavigationBar = navController.NavigationBar;
+
+ var barTextColor = NavPage.BarTextColor;
+ if (NavigationBar == null)
+ return;
+
+ // Determine new title text attributes via global static data
+ var globalTitleTextAttributes = UINavigationBar.Appearance.TitleTextAttributes;
+ var titleTextAttributes = new UIStringAttributes
+ {
+ ForegroundColor = barTextColor == null ? globalTitleTextAttributes?.ForegroundColor : barTextColor.ToNative(),
+ Font = globalTitleTextAttributes?.Font
+ };
+
+ // Determine new large title text attributes via global static data
+ var largeTitleTextAttributes = titleTextAttributes;
+ if (NativeVersion.IsAtLeast(11))
+ {
+ var globalLargeTitleTextAttributes = UINavigationBar.Appearance.LargeTitleTextAttributes;
+
+ largeTitleTextAttributes = new UIStringAttributes
+ {
+ ForegroundColor = barTextColor == null ? globalLargeTitleTextAttributes?.ForegroundColor : barTextColor.ToNative(),
+ Font = globalLargeTitleTextAttributes?.Font
+ };
+ }
+
+ if (NativeVersion.IsAtLeast(13))
+ {
+ if (NavigationBar.CompactAppearance != null)
+ {
+ NavigationBar.CompactAppearance.TitleTextAttributes = titleTextAttributes;
+ NavigationBar.CompactAppearance.LargeTitleTextAttributes = largeTitleTextAttributes;
+ }
+
+ NavigationBar.StandardAppearance.TitleTextAttributes = titleTextAttributes;
+ NavigationBar.StandardAppearance.LargeTitleTextAttributes = largeTitleTextAttributes;
+
+ if (NavigationBar.ScrollEdgeAppearance != null)
+ {
+ NavigationBar.ScrollEdgeAppearance.TitleTextAttributes = titleTextAttributes;
+ NavigationBar.ScrollEdgeAppearance.LargeTitleTextAttributes = largeTitleTextAttributes;
+ }
+ }
+ else
+ {
+ NavigationBar.TitleTextAttributes = titleTextAttributes;
+
+ if (NativeVersion.IsAtLeast(11))
+ NavigationBar.LargeTitleTextAttributes = largeTitleTextAttributes;
+ }
+
+ //// set Tint color (i. e. Back Button arrow and Text)
+ //var iconColor = Current != null ? NavigationPage.GetIconColor(Current) : null;
+ //if (iconColor == null)
+ // iconColor = barTextColor;
+
+ //NavigationBar.TintColor = iconColor == null || NavPage.OnThisPlatform().GetStatusBarTextColorMode() == StatusBarTextColorMode.DoNotAdjust
+ // ? UINavigationBar.Appearance.TintColor
+ // : iconColor.ToUIColor();
+ }
+
+
+ protected override void ConnectHandler(UIView nativeView)
+ {
+ base.ConnectHandler(nativeView);
+
+ if (VirtualView == null)
+ return;
+
+ VirtualView.PushRequested += OnPushRequested;
+ VirtualView.PopRequested += OnPopRequested;
+ _controlsNavigationController.LoadPages(this.MauiContext);
+
+ //VirtualView.PopToRootRequested += OnPopToRootRequested;
+ //VirtualView.RemovePageRequested += OnRemovedPageRequested;
+ //VirtualView.InsertPageBeforeRequested += OnInsertPageBeforeRequested;
+ }
+
+ protected override void DisconnectHandler(UIView nativeView)
+ {
+ base.DisconnectHandler(nativeView);
+
+ if (VirtualView == null)
+ return;
+
+ VirtualView.PushRequested -= OnPushRequested;
+ VirtualView.PopRequested -= OnPopRequested;
+ //VirtualView.PopToRootRequested -= OnPopToRootRequested;
+ //VirtualView.RemovePageRequested -= OnRemovedPageRequested;
+ //VirtualView.InsertPageBeforeRequested -= OnInsertPageBeforeRequested;
+ }
+
+ void OnPushRequested(object? sender, NavigationRequestedEventArgs e)
+ {
+ _controlsNavigationController?
+ .OnPushRequested(e, this.MauiContext);
+ }
+
+ void OnPopRequested(object? sender, NavigationRequestedEventArgs e)
+ {
+ _controlsNavigationController?
+ .OnPopRequestedAsync(e)
+ .FireAndForget((exc) => Log.Warning(nameof(NavigationPage), $"{exc}"));
+ }
+
+ internal void SendPopping(Task popTask)
+ {
+ if (VirtualView == null)
+ return;
+
+ VirtualView.PopAsyncInner(false, true, true)
+ .FireAndForget((exc) => Log.Warning(nameof(NavigationPage), $"{exc}"));
+ }
+ }
+}
diff --git a/src/Controls/src/Core/IServiceProviderExtensions.cs b/src/Controls/src/Core/IServiceProviderExtensions.cs
deleted file mode 100644
index 106f04b9a19b..000000000000
--- a/src/Controls/src/Core/IServiceProviderExtensions.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-namespace Microsoft.Maui.Controls.Xaml
-{
- public static class IServiceProviderExtensions
- {
- public static T GetService(this IServiceProvider provider)
- {
- var service = provider.GetService(typeof(T));
- if (service is T tservice)
- return tservice;
- return default(T);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Controls/src/Core/IStreamImageSource.cs b/src/Controls/src/Core/IStreamImageSource.cs
deleted file mode 100644
index ae3e2a6072fc..000000000000
--- a/src/Controls/src/Core/IStreamImageSource.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Microsoft.Maui.Controls
-{
- public interface IStreamImageSource
- {
- Task GetStreamAsync(CancellationToken userToken = default(CancellationToken));
- }
-}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Image.cs b/src/Controls/src/Core/Image.cs
index 9eb36a1999a4..efeae59ea5ce 100644
--- a/src/Controls/src/Core/Image.cs
+++ b/src/Controls/src/Core/Image.cs
@@ -1,12 +1,9 @@
using System;
-using System.Collections.Generic;
using System.ComponentModel;
-using System.Reflection;
-using Microsoft.Maui.Controls.Internals;
namespace Microsoft.Maui.Controls
{
- public class Image : View, IImageController, IElementConfiguration, IViewController, IImageElement
+ public partial class Image : View, IImageController, IElementConfiguration, IViewController, IImageElement
{
public static readonly BindableProperty SourceProperty = ImageElement.SourceProperty;
@@ -35,7 +32,8 @@ public Aspect Aspect
public bool IsLoading
{
- get { return (bool)GetValue(IsLoadingProperty); }
+ get => (bool)GetValue(IsLoadingProperty);
+ private set => SetValue(IsLoadingPropertyKey, value);
}
public bool IsOpaque
@@ -57,8 +55,6 @@ public ImageSource Source
set { SetValue(SourceProperty, value); }
}
- bool IImageController.GetLoadAsAnimation() => ImageElement.GetLoadAsAnimation(this);
-
protected override void OnBindingContextChanged()
{
ImageElement.OnBindingContextChanged(this, this);
@@ -73,20 +69,21 @@ protected override SizeRequest OnSizeRequest(double widthConstraint, double heig
return ImageElement.Measure(this, desiredSize, widthConstraint, heightConstraint);
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SetIsLoading(bool isLoading)
- {
- SetValue(IsLoadingPropertyKey, isLoading);
- }
-
public IPlatformElementConfiguration On() where T : IConfigPlatform
{
return _platformConfigurationRegistry.Value.On();
}
+ bool IImageController.GetLoadAsAnimation() =>
+ ImageElement.GetLoadAsAnimation(this);
+
+ void IImageController.SetIsLoading(bool isLoading) =>
+ IsLoading = isLoading;
+
void IImageElement.OnImageSourceSourceChanged(object sender, EventArgs e) =>
ImageElement.ImageSourceSourceChanged(this, e);
- void IImageElement.RaiseImageSourcePropertyChanged() => OnPropertyChanged(nameof(Source));
+ void IImageElement.RaiseImageSourcePropertyChanged() =>
+ OnPropertyChanged(nameof(Source));
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/ImageSource.cs b/src/Controls/src/Core/ImageSource.cs
index dee2c55d1c8c..62ce33abd5f6 100644
--- a/src/Controls/src/Core/ImageSource.cs
+++ b/src/Controls/src/Core/ImageSource.cs
@@ -7,7 +7,7 @@
namespace Microsoft.Maui.Controls
{
[TypeConverter(typeof(ImageSourceConverter))]
- public abstract class ImageSource : Element
+ public abstract partial class ImageSource : Element
{
readonly object _synchandle = new object();
CancellationTokenSource _cancellationTokenSource;
@@ -22,7 +22,7 @@ protected ImageSource()
public virtual bool IsEmpty => false;
- protected CancellationTokenSource CancellationTokenSource
+ private protected CancellationTokenSource CancellationTokenSource
{
get { return _cancellationTokenSource; }
private set
@@ -122,7 +122,7 @@ public static implicit operator ImageSource(Uri uri)
return FromUri(uri);
}
- protected void OnLoadingCompleted(bool cancelled)
+ private protected void OnLoadingCompleted(bool cancelled)
{
if (!IsLoading || _completionSource == null)
return;
@@ -137,7 +137,7 @@ protected void OnLoadingCompleted(bool cancelled)
}
}
- protected void OnLoadingStarted()
+ private protected void OnLoadingStarted()
{
lock (_synchandle)
{
diff --git a/src/Controls/src/Core/KnownColor.cs b/src/Controls/src/Core/KnownColor.cs
new file mode 100644
index 000000000000..de6d8826581f
--- /dev/null
+++ b/src/Controls/src/Core/KnownColor.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Maui.Graphics;
+
+namespace Microsoft.Maui.Controls
+{
+ public static class KnownColor
+ {
+ public static Color Default => null;
+
+ public static Color Transparent { get; } = new(255, 255, 255, 0);
+
+ public static void SetAccent(Color value) => Accent = value;
+
+ public static Color Accent { get; internal set; }
+ }
+}
diff --git a/src/Controls/src/Core/Layout.cs b/src/Controls/src/Core/Layout.cs
index 2f4991c3d544..f8b1bf97a7f3 100644
--- a/src/Controls/src/Core/Layout.cs
+++ b/src/Controls/src/Core/Layout.cs
@@ -219,9 +219,7 @@ protected virtual void OnChildMeasureInvalidated()
Size IFrameworkElement.Measure(double widthConstraint, double heightConstraint)
{
-#pragma warning disable CS0618 // Type or member is obsolete
- DesiredSize = OnSizeRequest(widthConstraint, heightConstraint).Request;
-#pragma warning restore CS0618 // Type or member is obsolete
+ DesiredSize = OnMeasure(widthConstraint, heightConstraint).Request;
return DesiredSize;
}
diff --git a/src/Controls/src/Core/Layout/GridLayout.cs b/src/Controls/src/Core/Layout/GridLayout.cs
index a5c15d71a811..bb2ec6428e6a 100644
--- a/src/Controls/src/Core/Layout/GridLayout.cs
+++ b/src/Controls/src/Core/Layout/GridLayout.cs
@@ -6,8 +6,8 @@ namespace Microsoft.Maui.Controls.Layout2
{
public class GridLayout : Layout, IGridLayout
{
- List _rowDefinitions = new List();
- List _columnDefinitions = new List();
+ readonly List _rowDefinitions = new();
+ readonly List _columnDefinitions = new();
public IReadOnlyList RowDefinitions => _rowDefinitions;
public IReadOnlyList ColumnDefinitions => _columnDefinitions;
@@ -15,48 +15,38 @@ public class GridLayout : Layout, IGridLayout
public double RowSpacing { get; set; }
public double ColumnSpacing { get; set; }
- Dictionary _viewInfo = new Dictionary();
+ readonly Dictionary _viewInfo = new();
- // TODO ezhart This needs to override Remove and clean up any row/column/span info for the removed child
+ public override void Add(IView child)
+ {
+ base.Add(child);
+ _viewInfo[child] = new GridInfo();
+ }
- public int GetColumn(IView view)
+ public override void Remove(IView child)
{
- if (_viewInfo.TryGetValue(view, out GridInfo gridInfo))
- {
- return gridInfo.Col;
- }
+ _viewInfo.Remove(child);
+ base.Remove(child);
+ }
- return 0;
+ public int GetColumn(IView view)
+ {
+ return _viewInfo[view].Col;
}
public int GetColumnSpan(IView view)
{
- if (_viewInfo.TryGetValue(view, out GridInfo gridInfo))
- {
- return gridInfo.ColSpan;
- }
-
- return 1;
+ return _viewInfo[view].ColSpan;
}
public int GetRow(IView view)
{
- if (_viewInfo.TryGetValue(view, out GridInfo gridInfo))
- {
- return gridInfo.Row;
- }
-
- return 0;
+ return _viewInfo[view].Row;
}
public int GetRowSpan(IView view)
{
- if (_viewInfo.TryGetValue(view, out GridInfo gridInfo))
- {
- return gridInfo.RowSpan;
- }
-
- return 1;
+ return _viewInfo[view].RowSpan;
}
protected override ILayoutManager CreateLayoutManager() => new GridLayoutManager(this);
diff --git a/src/Controls/src/Core/Layout/Layout.cs b/src/Controls/src/Core/Layout/Layout.cs
index dbc29a93c29e..8c4ba373c604 100644
--- a/src/Controls/src/Core/Layout/Layout.cs
+++ b/src/Controls/src/Core/Layout/Layout.cs
@@ -49,7 +49,7 @@ protected override Size ArrangeOverride(Rectangle bounds)
foreach (var child in Children)
{
- child.Handler?.SetFrame(child.Frame);
+ child.Handler?.NativeArrange(child.Frame);
}
return Frame.Size;
@@ -65,7 +65,7 @@ protected override void InvalidateMeasureOverride()
}
}
- public void Add(IView child)
+ public virtual void Add(IView child)
{
if (child == null)
return;
@@ -80,7 +80,7 @@ public void Add(IView child)
LayoutHandler?.Add(child);
}
- public void Remove(IView child)
+ public virtual void Remove(IView child)
{
if (child == null)
return;
diff --git a/src/Core/src/Primitives/NamedSize.cs b/src/Controls/src/Core/NamedSize.cs
similarity index 83%
rename from src/Core/src/Primitives/NamedSize.cs
rename to src/Controls/src/Core/NamedSize.cs
index f7f4eafa10a1..5f37c1e34af2 100644
--- a/src/Core/src/Primitives/NamedSize.cs
+++ b/src/Controls/src/Core/NamedSize.cs
@@ -1,4 +1,4 @@
-namespace Microsoft.Maui
+namespace Microsoft.Maui.Controls
{
public enum NamedSize
{
diff --git a/src/Controls/src/Core/NavigationPage.cs b/src/Controls/src/Core/NavigationPage.cs
index 6d6d8eda2e9b..8eaf24b59b03 100644
--- a/src/Controls/src/Core/NavigationPage.cs
+++ b/src/Controls/src/Core/NavigationPage.cs
@@ -8,7 +8,7 @@
namespace Microsoft.Maui.Controls
{
- public class NavigationPage : Page, IPageContainer, IBarElement, INavigationPageController, IElementConfiguration
+ public partial class NavigationPage : Page, IPageContainer, IBarElement, INavigationPageController, IElementConfiguration
{
public static readonly BindableProperty BackButtonTitleProperty = BindableProperty.CreateAttached("BackButtonTitle", typeof(string), typeof(Page), null);
@@ -35,6 +35,8 @@ public class NavigationPage : Page, IPageContainer, IBarElement, INavigati
static readonly BindablePropertyKey RootPagePropertyKey = BindableProperty.CreateReadOnly(nameof(RootPage), typeof(Page), typeof(NavigationPage), null);
public static readonly BindableProperty RootPageProperty = RootPagePropertyKey.BindableProperty;
+ INavigationPageController NavigationPageController => this;
+
public NavigationPage()
{
_platformConfigurationRegistry = new Lazy>(() => new PlatformConfigurationRegistry(this));
@@ -86,8 +88,7 @@ public Page Peek(int depth)
[EditorBrowsable(EditorBrowsableState.Never)]
public IEnumerable Pages => InternalChildren.Cast();
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int StackDepth
+ int INavigationPageController.StackDepth
{
get { return InternalChildren.Count; }
}
@@ -176,7 +177,7 @@ public async Task PopAsync(bool animated)
else
CurrentNavigationTask = tcs.Task;
- var result = await PopAsyncInner(animated, false);
+ var result = await (this as INavigationPageController).PopAsyncInner(animated, false);
tcs.SetResult(true);
return result;
}
@@ -279,7 +280,7 @@ protected override bool OnBackButtonPressed()
if (CurrentPage.SendBackButtonPressed())
return true;
- if (StackDepth > 1)
+ if (NavigationPageController.StackDepth > 1)
{
SafePop();
return true;
@@ -288,35 +289,50 @@ protected override bool OnBackButtonPressed()
return base.OnBackButtonPressed();
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler InsertPageBeforeRequested;
+ EventHandler _insertPageBeforeRequested;
+ event EventHandler INavigationPageController.InsertPageBeforeRequested
+ {
+ add => _insertPageBeforeRequested += value;
+ remove => _insertPageBeforeRequested -= value;
+ }
- [EditorBrowsable(EditorBrowsableState.Never)]
- public async Task PopAsyncInner(bool animated, bool fast)
+
+ internal async Task PopAsyncInner(
+ bool animated,
+ bool fast,
+ bool requestedFromHandler)
{
- if (StackDepth == 1)
+ if (NavigationPageController.StackDepth == 1)
{
return null;
}
var page = (Page)InternalChildren.Last();
-
- return await (this as INavigationPageController).RemoveAsyncInner(page, animated, fast);
+ return await RemoveAsyncInner(page, animated, fast, requestedFromHandler);
}
- async Task INavigationPageController.RemoveAsyncInner(Page page, bool animated, bool fast)
+ internal async Task RemoveAsyncInner(
+ Page page,
+ bool animated,
+ bool fast,
+ bool requestedFromHandler)
{
- if (StackDepth == 1)
+ if (NavigationPageController.StackDepth == 1)
{
return null;
}
+ FireDisappearing(page);
+
+ if (InternalChildren.Last() == page)
+ FireAppearing((Page)InternalChildren[NavigationPageController.StackDepth - 2]);
+
var args = new NavigationRequestedEventArgs(page, animated);
var removed = true;
EventHandler requestPop = PopRequested;
- if (requestPop != null)
+ if (requestPop != null && !requestedFromHandler)
{
requestPop(this, args);
@@ -337,6 +353,16 @@ async Task INavigationPageController.RemoveAsyncInner(Page page, bool anim
return page;
}
+ Task INavigationPageController.PopAsyncInner(bool animated, bool fast)
+ {
+ return PopAsyncInner(animated, fast, false);
+ }
+
+ Task INavigationPageController.RemoveAsyncInner(Page page, bool animated, bool fast)
+ {
+ return RemoveAsyncInner(page, animated, fast, false);
+ }
+
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler PopRequested;
@@ -363,8 +389,7 @@ void InsertPageBefore(Page page, Page before)
if (InternalChildren.Contains(page))
throw new ArgumentException("Cannot insert page which is already in the navigation stack");
- EventHandler handler = InsertPageBeforeRequested;
- handler?.Invoke(this, new NavigationRequestedEventArgs(page, before, false));
+ _insertPageBeforeRequested?.Invoke(this, new NavigationRequestedEventArgs(page, before, false));
int index = InternalChildren.IndexOf(before);
InternalChildren.Insert(index, page);
@@ -379,9 +404,12 @@ void InsertPageBefore(Page page, Page before)
async Task PopToRootAsyncInner(bool animated)
{
- if (StackDepth == 1)
+ if (NavigationPageController.StackDepth == 1)
return;
+ FireDisappearing(CurrentPage);
+ FireAppearing((Page)InternalChildren[0]);
+
Element[] childrenToRemove = InternalChildren.Skip(1).ToArray();
foreach (Element child in childrenToRemove)
InternalChildren.Remove(child);
@@ -402,11 +430,26 @@ async Task PopToRootAsyncInner(bool animated)
PoppedToRoot?.Invoke(this, new PoppedToRootEventArgs(RootPage, childrenToRemove.OfType().ToList()));
}
+ void FireDisappearing(Page page)
+ {
+ if (HasAppeared)
+ page?.SendDisappearing();
+ }
+
+ void FireAppearing(Page page)
+ {
+ if (HasAppeared)
+ page?.SendAppearing();
+ }
+
async Task PushAsyncInner(Page page, bool animated)
{
if (InternalChildren.Contains(page))
return;
+ FireDisappearing(CurrentPage);
+ FireAppearing(page);
+
PushPage(page);
var args = new NavigationRequestedEventArgs(page, animated);
diff --git a/src/Controls/src/Core/Page.cs b/src/Controls/src/Core/Page.cs
index 28ed357da7dc..1ad1c96de046 100644
--- a/src/Controls/src/Core/Page.cs
+++ b/src/Controls/src/Core/Page.cs
@@ -11,7 +11,7 @@
namespace Microsoft.Maui.Controls
{
- public class Page : VisualElement, ILayout, IPageController, IElementConfiguration, IPaddingElement
+ public partial class Page : VisualElement, ILayout, IPageController, IElementConfiguration, IPaddingElement
{
public const string BusySetSignalName = "Microsoft.Maui.Controls.BusySet";
@@ -41,6 +41,7 @@ public class Page : VisualElement, ILayout, IPageController, IElementConfigurati
bool _containerAreaSet;
bool _hasAppeared;
+ private protected bool HasAppeared => _hasAppeared;
ReadOnlyCollection _logicalChildren;
@@ -311,7 +312,7 @@ protected virtual void OnDisappearing()
protected override void OnParentSet()
{
- if (!Application.IsApplicationOrNull(RealParent) && !(RealParent is Page) && !(RealParent is BaseShellItem))
+ if (!Application.IsApplicationOrNull(RealParent) && !(RealParent is Page) && !(RealParent is BaseShellItem) && !(RealParent is IWindow))
throw new InvalidOperationException("Parent of a Page must also be a Page");
base.OnParentSet();
}
diff --git a/src/Controls/src/Core/Picker.cs b/src/Controls/src/Core/Picker.cs
index 4c12daff53a1..f6a712ffd3e4 100644
--- a/src/Controls/src/Core/Picker.cs
+++ b/src/Controls/src/Core/Picker.cs
@@ -212,6 +212,8 @@ void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
// If the index has not changed, still need to change the selected item
if (newIndex == oldIndex)
UpdateSelectedItem(newIndex);
+ //This sends the notification to the Maui Handler to reload
+ OnPropertyChanged("Reload");
}
static void OnItemsSourceChanged(BindableObject bindable, object oldValue, object newValue)
diff --git a/src/Compatibility/Core/src/Android/Extensions/BrushExtensions.cs b/src/Controls/src/Core/Platform/Android/Extensions/BrushExtensions.cs
similarity index 93%
rename from src/Compatibility/Core/src/Android/Extensions/BrushExtensions.cs
rename to src/Controls/src/Core/Platform/Android/Extensions/BrushExtensions.cs
index ff1f060a835c..1af795e92a19 100644
--- a/src/Compatibility/Core/src/Android/Extensions/BrushExtensions.cs
+++ b/src/Controls/src/Core/Platform/Android/Extensions/BrushExtensions.cs
@@ -8,7 +8,7 @@
using Color = Microsoft.Maui.Graphics.Color;
using Paint = Android.Graphics.Paint;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.Android
+namespace Microsoft.Maui.Controls.Platform
{
public static class BrushExtensions
{
@@ -53,7 +53,7 @@ public static void UpdateBackground(this Paint paint, Brush brush, int height, i
if (brush is SolidColorBrush solidColorBrush)
{
var backgroundColor = solidColorBrush.Color;
- paint.Color = backgroundColor.ToAndroid();
+ paint.Color = backgroundColor.ToNative();
}
if (brush is LinearGradientBrush linearGradientBrush)
@@ -119,7 +119,7 @@ public static void UpdateBackground(this GradientDrawable gradientDrawable, Brus
if (brush is SolidColorBrush solidColorBrush)
{
Color bgColor = solidColorBrush.Color;
- gradientDrawable.SetColor(bgColor?.ToAndroid() ?? Colors.Transparent.ToAndroid());
+ gradientDrawable.SetColor(bgColor?.ToNative() ?? Colors.Transparent.ToNative());
}
if (brush is LinearGradientBrush linearGradientBrush)
@@ -175,7 +175,7 @@ public static void UpdateBackground(this GradientDrawable gradientDrawable, Brus
public static bool UseGradients(this GradientDrawable gradientDrawable)
{
- if (!Forms.IsNougatOrNewer)
+ if (!NativeVersion.IsAtLeast(24))
return false;
var colors = gradientDrawable.GetColors();
@@ -197,11 +197,11 @@ internal static void SetPaintGradient(this AView view, Brush brush)
Shape = new RectShape()
};
- gradientStrokeDrawable.SetStroke(0, Colors.Transparent.ToAndroid());
+ gradientStrokeDrawable.SetStroke(0, Colors.Transparent.ToNative());
if (brush is SolidColorBrush solidColorBrush)
{
- var color = solidColorBrush.Color?.ToAndroid() ?? Colors.Transparent.ToAndroid();
+ var color = solidColorBrush.Color?.ToNative() ?? Colors.Transparent.ToNative();
gradientStrokeDrawable.SetColor(color);
}
else
@@ -256,7 +256,7 @@ internal static Tuple GetGradientBrushData(this GradientBrush gr
int count = 0;
foreach (var orderStop in orderStops)
{
- colors[count] = orderStop.Color.ToAndroid().ToArgb();
+ colors[count] = orderStop.Color.ToNative().ToArgb();
offsets[count] = orderStop.Offset;
count++;
}
diff --git a/src/Compatibility/Core/src/Android/GradientStrokeDrawable.cs b/src/Controls/src/Core/Platform/Android/GradientStrokeDrawable.cs
similarity index 98%
rename from src/Compatibility/Core/src/Android/GradientStrokeDrawable.cs
rename to src/Controls/src/Core/Platform/Android/GradientStrokeDrawable.cs
index c5de19939ca2..a1ab79472496 100644
--- a/src/Compatibility/Core/src/Android/GradientStrokeDrawable.cs
+++ b/src/Controls/src/Core/Platform/Android/GradientStrokeDrawable.cs
@@ -4,7 +4,7 @@
using Android.Graphics.Drawables.Shapes;
using AColor = Android.Graphics.Color;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.Android
+namespace Microsoft.Maui.Controls.Platform
{
public class GradientStrokeDrawable : PaintDrawable
{
diff --git a/src/Controls/src/Core/Platform/Android/ILifeCycleState.cs b/src/Controls/src/Core/Platform/Android/ILifeCycleState.cs
new file mode 100644
index 000000000000..9a846d421b34
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Android/ILifeCycleState.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using Android.App;
+using Android.Content;
+using Android.OS;
+using Android.Runtime;
+using Android.Views;
+using Android.Widget;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal interface ILifeCycleState
+ {
+ bool MarkedForDispose { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Android/MauiFragmentNavDestination.cs b/src/Controls/src/Core/Platform/Android/MauiFragmentNavDestination.cs
new file mode 100644
index 000000000000..a8bde1bc8182
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Android/MauiFragmentNavDestination.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using AndroidX.Navigation;
+using AndroidX.Navigation.Fragment;
+using Microsoft.Maui.Controls.Handlers;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ class MauiFragmentNavDestination : FragmentNavigator.Destination
+ {
+ public IPage Page { get; }
+ public IMauiContext MauiContext => NavigationPageHandler.MauiContext;
+ public NavigationPageHandler NavigationPageHandler { get; }
+
+ // Todo we want to generate the same ids for each page so if the app is recreated
+ // we want these to match up
+ static Dictionary Pages = new Dictionary();
+
+ public MauiFragmentNavDestination(Navigator fragmentNavigator, IPage page, NavigationPageHandler navigationPageHandler) : base(fragmentNavigator)
+ {
+ _ = page ?? throw new ArgumentNullException(nameof(page));
+ _ = navigationPageHandler ?? throw new ArgumentNullException(nameof(navigationPageHandler));
+ SetClassName(Java.Lang.Class.FromType(typeof(NavHostPageFragment)).CanonicalName);
+
+ if (!Pages.ContainsKey(page))
+ {
+ Id = global::Android.Views.View.GenerateViewId();
+ Pages.Add(page, Id);
+ }
+
+ Id = Pages[page];
+ this.Page = page;
+ this.NavigationPageHandler = navigationPageHandler;
+ }
+
+ public static MauiFragmentNavDestination AddDestination(
+ IPage page,
+ NavigationPageHandler navigationPageHandler,
+ NavGraph navGraph,
+ FragmentNavigator navigator)
+ {
+ var destination = new MauiFragmentNavDestination(navigator, page, navigationPageHandler);
+
+ navGraph.AddDestination(destination);
+ return destination;
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Android/NavHostPageFragment.cs b/src/Controls/src/Core/Platform/Android/NavHostPageFragment.cs
new file mode 100644
index 000000000000..c2e066f9de8c
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Android/NavHostPageFragment.cs
@@ -0,0 +1,170 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Android.Content.Res;
+using Android.Graphics;
+using Android.OS;
+using Android.Runtime;
+using Android.Views;
+using AndroidX.AppCompat.App;
+using AndroidX.AppCompat.Widget;
+using AndroidX.CoordinatorLayout.Widget;
+using AndroidX.Fragment.App;
+using AndroidX.Navigation.Fragment;
+using AndroidX.Navigation.UI;
+using Microsoft.Maui.Controls.Handlers;
+using AView = Android.Views.View;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ class NavHostPageFragment : Fragment
+ {
+ ProcessBackClick BackClick { get; }
+
+ NavHostFragment NavHost =>
+ (NavHostFragment)
+ Context
+ .GetFragmentManager()
+ .FindFragmentById(Resource.Id.nav_host);
+
+ MauiFragmentNavDestination NavDestination { get; set; }
+
+ protected NavHostPageFragment(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
+ {
+ BackClick = new ProcessBackClick(this);
+ }
+
+ public NavHostPageFragment()
+ {
+ BackClick = new ProcessBackClick(this);
+ }
+
+ public override AView OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ if (NavDestination == null)
+ {
+ NavDestination =
+ (MauiFragmentNavDestination)
+ NavHost.NavController.CurrentDestination;
+ }
+
+ _ = NavDestination ?? throw new ArgumentNullException(nameof(NavDestination));
+
+ var view = NavDestination.Page.ToNative(NavDestination.MauiContext);
+ return view;
+ }
+
+ public override void OnViewCreated(AView view, Bundle savedInstanceState)
+ {
+ base.OnViewCreated(view, savedInstanceState);
+
+ var controller = NavHostFragment.FindNavController(this);
+ var appbarConfig =
+ new AppBarConfiguration
+ .Builder(controller.Graph)
+ .Build();
+
+ NavigationUI
+ .SetupWithNavController(NavDestination.NavigationPageHandler.Toolbar, controller, appbarConfig);
+
+ HasOptionsMenu = true;
+
+ NavDestination.NavigationPageHandler.Toolbar.SetNavigationOnClickListener(BackClick);
+
+ UpdateToolbar();
+ NavDestination.NavigationPageHandler.Toolbar
+ .Title = NavDestination.Page.Title;
+
+ if (Context.GetActivity() is AppCompatActivity aca)
+ {
+ aca.SupportActionBar.Title = NavDestination.Page.Title;
+
+ // TODO MAUI put this elsewhere once we figure out how attached property handlers work
+ bool showNavBar = false;
+ if (NavDestination.Page is BindableObject bo)
+ showNavBar = NavigationPage.GetHasNavigationBar(bo);
+
+ var appBar = NavDestination.NavigationPageHandler.AppBar;
+ if (!showNavBar)
+ {
+ if (appBar.LayoutParameters is CoordinatorLayout.LayoutParams cl)
+ {
+ cl.Height = 0;
+ appBar.LayoutParameters = cl;
+ }
+ }
+ else
+ {
+ if (appBar.LayoutParameters is CoordinatorLayout.LayoutParams cl)
+ {
+ cl.Height = ActionBarHeight();
+ appBar.LayoutParameters = cl;
+ }
+ }
+ }
+
+
+ int ActionBarHeight()
+ {
+ int attr = Resource.Attribute.actionBarSize;
+
+ int actionBarHeight = (int)Context.GetThemeAttributePixels(Resource.Attribute.actionBarSize);
+
+ //if (actionBarHeight <= 0)
+ // return Device.Info.CurrentOrientation.IsPortrait() ? (int)Context.ToPixels(56) : (int)Context.ToPixels(48);
+
+ //if (Context.GetActivity().Window.Attributes.Flags.HasFlag(WindowManagerFlags.TranslucentStatus) || Context.GetActivity().Window.Attributes.Flags.HasFlag(WindowManagerFlags.TranslucentNavigation))
+ //{
+ // if (_toolbar.PaddingTop == 0)
+ // _toolbar.SetPadding(0, GetStatusBarHeight(), 0, 0);
+
+ // return actionBarHeight + GetStatusBarHeight();
+ //}
+
+ return actionBarHeight;
+ }
+
+ }
+
+ public override void OnCreate(Bundle savedInstanceState)
+ {
+ base.OnCreate(savedInstanceState);
+ RequireActivity()
+ .OnBackPressedDispatcher
+ .AddCallback(this, BackClick);
+ }
+
+ public void HandleOnBackPressed()
+ {
+ NavDestination.NavigationPageHandler.OnPop();
+ }
+
+ // TODO Move somewhere else
+ void UpdateToolbar()
+ {
+
+ }
+
+
+ class ProcessBackClick : AndroidX.Activity.OnBackPressedCallback, AView.IOnClickListener
+ {
+ NavHostPageFragment _navHostPageFragment;
+
+ public ProcessBackClick(NavHostPageFragment navHostPageFragment)
+ : base(true)
+ {
+ _navHostPageFragment = navHostPageFragment;
+ }
+
+ public override void HandleOnBackPressed()
+ {
+ _navHostPageFragment.HandleOnBackPressed();
+ }
+
+ public void OnClick(AView v)
+ {
+ HandleOnBackPressed();
+ }
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Android/ViewExtensions.cs b/src/Controls/src/Core/Platform/Android/ViewExtensions.cs
new file mode 100644
index 000000000000..5691a0ba57d7
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Android/ViewExtensions.cs
@@ -0,0 +1,152 @@
+using System.Collections.Generic;
+using System.Linq;
+using Android.Content;
+using Android.Graphics.Drawables;
+using Android.OS;
+using Android.Util;
+using Android.Views;
+using AndroidX.Core.Content;
+using Microsoft.Maui.Handlers;
+using AColor = Android.Graphics.Color;
+using ARect = Android.Graphics.Rect;
+using AView = Android.Views.View;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ public static class ViewExtensions
+ {
+ 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)
+ {
+
+ 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.IsAlive())
+ {
+ return;
+ }
+
+ if (view.Id == AView.NoId)
+ {
+ view.Id = global::Android.Views.View.GenerateViewId();
+ }
+ }
+
+ public static bool GetClipToOutline(this AView view)
+ {
+ if (!view.IsAlive())
+ return false;
+
+ return view.ClipToOutline;
+ }
+
+ public static void SetClipToOutline(this AView view, bool value)
+ {
+ if (!view.IsAlive())
+ return;
+
+ view.ClipToOutline = value;
+ }
+
+ public static bool SetElevation(this AView view, float value)
+ {
+ if (!view.IsAlive())
+ return false;
+
+ view.Elevation = value;
+ return true;
+ }
+
+ internal static void MaybeRequestLayout(this AView view)
+ {
+ var isInLayout = false;
+ if ((int)Build.VERSION.SdkInt >= 18)
+ isInLayout = view.IsInLayout;
+
+ if (!isInLayout && !view.IsLayoutRequested)
+ view.RequestLayout();
+ }
+
+ internal static T GetParentOfType(this IViewParent view)
+ where T : class
+ {
+ if (view is T t)
+ return t;
+
+ while (view != null)
+ {
+ T parent = view.Parent as T;
+ if (parent != null)
+ return parent;
+
+ view = view.Parent;
+ }
+
+ return default(T);
+ }
+
+ internal static T GetParentOfType(this AView view)
+ where T : class
+ {
+ T t = view as T;
+ if (view != null)
+ return t;
+
+ return view.Parent.GetParentOfType();
+ }
+
+ internal static T FindParentOfType(this VisualElement element)
+ {
+ var navPage = element.GetParentsPath()
+ .OfType()
+ .FirstOrDefault();
+ return navPage;
+ }
+
+ internal static IEnumerable GetParentsPath(this VisualElement self)
+ {
+ Element current = self;
+
+ while (!Application.IsApplicationOrNull(current.RealParent))
+ {
+ current = current.RealParent;
+ yield return current;
+ }
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/BackgroundTracker.cs b/src/Controls/src/Core/Platform/Windows/BackgroundTracker.cs
new file mode 100644
index 000000000000..d5f9ca68e7ef
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/BackgroundTracker.cs
@@ -0,0 +1,81 @@
+using System;
+using System.ComponentModel;
+using Microsoft.Maui.Graphics;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Media;
+using Microsoft.UI.Xaml.Media.Imaging;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal sealed class BackgroundTracker : VisualElementTracker where T : FrameworkElement
+ {
+ readonly DependencyProperty _backgroundProperty;
+ bool _backgroundNeedsUpdate = true;
+
+ public BackgroundTracker(DependencyProperty backgroundProperty)
+ {
+ if (backgroundProperty == null)
+ throw new ArgumentNullException("backgroundProperty");
+
+ _backgroundProperty = backgroundProperty;
+ }
+
+ protected override void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.IsOneOf(VisualElement.BackgroundColorProperty, VisualElement.BackgroundProperty, Page.BackgroundImageSourceProperty))
+ {
+ UpdateBackground();
+ }
+
+ base.OnPropertyChanged(sender, e);
+ }
+
+ protected override void UpdateNativeControl()
+ {
+ base.UpdateNativeControl();
+
+ if (_backgroundNeedsUpdate)
+ UpdateBackground();
+ }
+
+ async void UpdateBackground()
+ {
+ if (Element == null)
+ return;
+
+ FrameworkElement element = Control ?? Container;
+ if (element == null)
+ return;
+
+ var backgroundImage = await Element.BackgroundImageSource.ToWindowsImageSourceAsync();
+
+ if (backgroundImage != null)
+ {
+ element.SetValue(_backgroundProperty, new ImageBrush { ImageSource = backgroundImage });
+ }
+ else
+ {
+ if (!Element.Background.IsEmpty)
+ {
+ element.SetValue(_backgroundProperty, Element.Background.ToBrush());
+ }
+ else
+ {
+ Color backgroundColor = Element.BackgroundColor;
+ if (!backgroundColor.IsDefault())
+ {
+ element.SetValue(_backgroundProperty, backgroundColor.ToNative());
+ }
+ else
+ {
+ object localBackground = element.ReadLocalValue(_backgroundProperty);
+ if (localBackground != null && localBackground != DependencyProperty.UnsetValue)
+ element.ClearValue(_backgroundProperty);
+ }
+ }
+ }
+
+ _backgroundNeedsUpdate = false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/CompositionHelper.cs b/src/Controls/src/Core/Platform/Windows/CompositionHelper.cs
new file mode 100644
index 000000000000..583fa3fc770f
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/CompositionHelper.cs
@@ -0,0 +1,32 @@
+#nullable enable
+using System;
+using System.Linq;
+using System.Reflection;
+using Windows.UI.Composition;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ static class CompositionHelper
+ {
+ static bool SetTypePresent;
+ static bool IsTypePresent;
+
+ public static bool IsCompositionGeometryTypePresent
+ {
+ get
+ {
+ if (!SetTypePresent)
+ {
+ var compositorMethods = typeof(Compositor).GetMethods();
+ var createGeometricClipExists = compositorMethods.Any(m => m.Name == "CreateGeometricClip");
+ var createEllipseGeometryExists = compositorMethods.Any(m => m.Name == "CreateEllipseGeometry");
+
+ IsTypePresent = createGeometricClipExists && createEllipseGeometryExists;
+ SetTypePresent = true;
+ }
+
+ return IsTypePresent;
+ }
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/AccessibilityExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/AccessibilityExtensions.cs
new file mode 100644
index 000000000000..a1c23145dac4
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/AccessibilityExtensions.cs
@@ -0,0 +1,148 @@
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Automation.Peers;
+using NativeAutomationProperties = Microsoft.UI.Xaml.Automation.AutomationProperties;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ 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,
+ IMauiContext mauiContext,
+ UIElement _defaultAutomationPropertiesLabeledBy = null)
+ {
+ if (Element == null)
+ return _defaultAutomationPropertiesLabeledBy;
+
+ // TODO Maui: this is a bit of a hack because Elements
+ // currently don't implement IFrameworkElement but they should
+ mauiContext ??= (Element as IFrameworkElement)?.Handler?.MauiContext;
+
+ if (_defaultAutomationPropertiesLabeledBy == null)
+ _defaultAutomationPropertiesLabeledBy = (UIElement)Control.GetValue(NativeAutomationProperties.LabeledByProperty);
+
+ var elemValue = (VisualElement)Element.GetValue(AutomationProperties.LabeledByProperty);
+
+ FrameworkElement nativeElement = null;
+
+ if(mauiContext != null)
+ nativeElement = (elemValue as IView)?.GetOrCreateHandler(mauiContext)?.NativeView as FrameworkElement;
+
+ if (nativeElement != null)
+ Control.SetValue(AutomationProperties.LabeledByProperty, nativeElement);
+ else
+ Control.SetValue(NativeAutomationProperties.LabeledByProperty, _defaultAutomationPropertiesLabeledBy);
+
+ return _defaultAutomationPropertiesLabeledBy;
+ }
+
+ // TODO MAUI: 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)
+ {
+ if (Element == null)
+ return;
+
+ var elemValue = ConcatenateNameAndHint(Element);
+
+ Control.BackButtonTitle = elemValue;
+ }
+
+ static string ConcatenateNameAndHint(Element Element)
+ {
+ string separator;
+
+ var name = (string)Element.GetValue(AutomationProperties.NameProperty);
+
+ var hint = (string)Element.GetValue(AutomationProperties.HelpTextProperty);
+
+
+ if (string.IsNullOrWhiteSpace(name) || string.IsNullOrWhiteSpace(hint))
+ separator = "";
+
+ else
+ separator = ". ";
+
+
+ return string.Join(separator, name, hint);
+
+ }
+
+ public static void SetAutomationProperties(
+ this FrameworkElement frameworkElement,
+ Element element,
+ IMauiContext mauiContext,
+ string defaultName = null)
+ {
+ frameworkElement.SetAutomationPropertiesAutomationId(element?.AutomationId);
+ frameworkElement.SetAutomationPropertiesName(element, defaultName);
+ frameworkElement.SetAutomationPropertiesHelpText(element);
+ frameworkElement.SetAutomationPropertiesLabeledBy(element, mauiContext);
+ frameworkElement.SetAutomationPropertiesAccessibilityView(element);
+ }
+ }
+}
diff --git a/src/Compatibility/Core/src/WinUI/Extensions/AspectExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/AspectExtensions.cs
similarity index 86%
rename from src/Compatibility/Core/src/WinUI/Extensions/AspectExtensions.cs
rename to src/Controls/src/Core/Platform/Windows/Extensions/AspectExtensions.cs
index 61f265f72033..ba3fcd80c8c0 100644
--- a/src/Compatibility/Core/src/WinUI/Extensions/AspectExtensions.cs
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/AspectExtensions.cs
@@ -1,6 +1,6 @@
using WStretch = Microsoft.UI.Xaml.Media.Stretch;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
+namespace Microsoft.Maui.Controls.Platform
{
internal static class AspectExtensions
{
diff --git a/src/Compatibility/Core/src/WinUI/BrushExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/BrushExtensions.cs
similarity index 93%
rename from src/Compatibility/Core/src/WinUI/BrushExtensions.cs
rename to src/Controls/src/Core/Platform/Windows/Extensions/BrushExtensions.cs
index cc73d8d79014..be1c8da6af98 100644
--- a/src/Compatibility/Core/src/WinUI/BrushExtensions.cs
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/BrushExtensions.cs
@@ -6,7 +6,7 @@
using WPoint = Windows.Foundation.Point;
using WRadialGradientBrush = Microsoft.UI.Xaml.Media.RadialGradientBrush;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
+namespace Microsoft.Maui.Controls.Platform
{
public static class BrushExtensions
{
@@ -22,7 +22,7 @@ public static WBrush ToBrush(this Brush brush)
return null;
}
- return solidColorBrush.Color.ToBrush();
+ return solidColorBrush.Color.ToNative();
}
if (brush is LinearGradientBrush linearGradientBrush)
@@ -43,7 +43,6 @@ public static WBrush ToBrush(this Brush brush)
};
}
-#if UWP_18362
if (brush is RadialGradientBrush radialGradientBrush)
{
var wRadialGradientBrush = new WRadialGradientBrush()
@@ -61,7 +60,6 @@ public static WBrush ToBrush(this Brush brush)
return wRadialGradientBrush;
}
-#endif
return null;
}
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/ClipExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/ClipExtensions.cs
new file mode 100644
index 000000000000..475ea014eb0a
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/ClipExtensions.cs
@@ -0,0 +1,60 @@
+using Microsoft.UI.Composition;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Hosting;
+using Microsoft.Maui.Controls.Shapes;
+using WRectangleGeometry = Microsoft.UI.Xaml.Media.RectangleGeometry;
+using WVector2 = System.Numerics.Vector2;
+
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal static class ClipExtensions
+ {
+ public static void Clip(this FrameworkElement frameworkElement, Geometry geometry)
+ {
+ var wGeometry = geometry.ToNative();
+
+ if (wGeometry is WRectangleGeometry wRectangleGeometry && frameworkElement.Clip != wRectangleGeometry)
+ frameworkElement.Clip = wRectangleGeometry;
+ }
+
+ public static void ClipVisual(this FrameworkElement frameworkElement, Geometry geometry)
+ {
+ var compositor = ElementCompositionPreview.GetElementVisual(frameworkElement).Compositor;
+ var visual = ElementCompositionPreview.GetElementVisual(frameworkElement);
+
+ CompositionClip compositionClip = null;
+
+ if (geometry is EllipseGeometry ellipseGeometry)
+ {
+ var compositionEllipseGeometry = compositor.CreateEllipseGeometry();
+
+ compositionEllipseGeometry.Center = new WVector2((float)ellipseGeometry.Center.X, (float)ellipseGeometry.Center.Y);
+ compositionEllipseGeometry.Radius = new WVector2((float)ellipseGeometry.RadiusX, (float)ellipseGeometry.RadiusY);
+
+ compositionClip = compositor.CreateGeometricClip(compositionEllipseGeometry);
+ }
+ else if (geometry is LineGeometry lineGeometry)
+ {
+ var compositionLineGeometry = compositor.CreateLineGeometry();
+
+ compositionLineGeometry.Start = new WVector2((float)lineGeometry.StartPoint.X, (float)lineGeometry.StartPoint.Y);
+ compositionLineGeometry.End = new WVector2((float)lineGeometry.EndPoint.X, (float)lineGeometry.EndPoint.Y);
+
+ compositionClip = compositor.CreateGeometricClip(compositionLineGeometry);
+ }
+ else if (geometry is RectangleGeometry rectangleGeometry)
+ {
+ var compositionRectangleGeometry = compositor.CreateRectangleGeometry();
+
+ compositionRectangleGeometry.Offset = new WVector2((float)rectangleGeometry.Rect.X, (float)rectangleGeometry.Rect.Y);
+ compositionRectangleGeometry.Size = new WVector2((float)rectangleGeometry.Rect.Width, (float)rectangleGeometry.Rect.Height);
+
+ compositionClip = compositor.CreateGeometricClip(compositionRectangleGeometry);
+ }
+
+ if (visual.Clip != compositionClip)
+ visual.Clip = compositionClip;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/Extensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/Extensions.cs
new file mode 100644
index 000000000000..4b93c4719447
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/Extensions.cs
@@ -0,0 +1,103 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Threading;
+using System.Threading.Tasks;
+using Windows.Foundation;
+using Windows.UI.Text;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media;
+using Microsoft.Maui.Controls.Internals;
+using WImageSource = Microsoft.UI.Xaml.Media.ImageSource;
+using UwpScrollBarVisibility = Microsoft.UI.Xaml.Controls.ScrollBarVisibility;
+using Microsoft.UI.Xaml.Media.Imaging;
+//using Microsoft.Graphics.Canvas.UI.Xaml;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal static class Extensions
+ {
+ public static ConfiguredTaskAwaitable DontSync(this IAsyncOperation self)
+ {
+ return self.AsTask().ConfigureAwait(false);
+ }
+
+ public static ConfiguredTaskAwaitable DontSync(this IAsyncAction self)
+ {
+ return self.AsTask().ConfigureAwait(false);
+ }
+
+ public static void SetBinding(this FrameworkElement self, DependencyProperty property, string path)
+ {
+ self.SetBinding(property, new Microsoft.UI.Xaml.Data.Binding { Path = new PropertyPath(path) });
+ }
+
+ public static void SetBinding(this FrameworkElement self, DependencyProperty property, string path, Microsoft.UI.Xaml.Data.IValueConverter converter)
+ {
+ self.SetBinding(property, new Microsoft.UI.Xaml.Data.Binding { Path = new PropertyPath(path), Converter = converter });
+ }
+
+ internal static InputScopeNameValue GetKeyboardButtonType(this ReturnType returnType)
+ {
+ switch (returnType)
+ {
+ case ReturnType.Default:
+ case ReturnType.Done:
+ case ReturnType.Go:
+ case ReturnType.Next:
+ case ReturnType.Send:
+ return InputScopeNameValue.Default;
+ case ReturnType.Search:
+ return InputScopeNameValue.Search;
+ default:
+ throw new NotImplementedException($"ReturnType {returnType} not supported");
+ }
+ }
+
+ internal static InputScope ToInputScope(this ReturnType returnType)
+ {
+ var scopeName = new InputScopeName()
+ {
+ NameValue = GetKeyboardButtonType(returnType)
+ };
+
+ var inputScope = new InputScope
+ {
+ Names = { scopeName }
+ };
+
+ return inputScope;
+ }
+
+ internal static UwpScrollBarVisibility ToUwpScrollBarVisibility(this Maui.Controls.ScrollBarVisibility visibility)
+ {
+ switch (visibility)
+ {
+ case Maui.Controls.ScrollBarVisibility.Always:
+ return UwpScrollBarVisibility.Visible;
+ case Maui.Controls.ScrollBarVisibility.Default:
+ return UwpScrollBarVisibility.Auto;
+ case Maui.Controls.ScrollBarVisibility.Never:
+ return UwpScrollBarVisibility.Hidden;
+ default:
+ return UwpScrollBarVisibility.Auto;
+ }
+ }
+
+ public static T Clamp(this T value, T min, T max) where T : IComparable
+ {
+ if (value.CompareTo(min) < 0)
+ return min;
+ if (value.CompareTo(max) > 0)
+ return max;
+ return value;
+ }
+
+
+ internal static int ToEm(this double pt)
+ {
+ return Convert.ToInt32( pt * 0.0624f * 1000); //Coefficient for converting Pt to Em. The value is uniform spacing between characters, in units of 1/1000 of an em.
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/FrameworkElementExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/FrameworkElementExtensions.cs
new file mode 100644
index 000000000000..3c42f95cd852
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/FrameworkElementExtensions.cs
@@ -0,0 +1,145 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Media;
+using Microsoft.Maui.Controls.Internals;
+using WBinding = Microsoft.UI.Xaml.Data.Binding;
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
+using WBindingExpression = Microsoft.UI.Xaml.Data.BindingExpression;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal static class FrameworkElementExtensions
+ {
+ static readonly Lazy> ForegroundProperties =
+ new Lazy>(() => new ConcurrentDictionary());
+
+ public static WBrush GetForeground(this FrameworkElement element)
+ {
+ if (element == null)
+ throw new ArgumentNullException("element");
+
+ return (WBrush)element.GetValue(GetForegroundProperty(element));
+ }
+
+ public static WBinding GetForegroundBinding(this FrameworkElement element)
+ {
+ WBindingExpression expr = element.GetBindingExpression(GetForegroundProperty(element));
+ if (expr == null)
+ return null;
+
+ return expr.ParentBinding;
+ }
+
+ public static object GetForegroundCache(this FrameworkElement element)
+ {
+ WBinding binding = GetForegroundBinding(element);
+ if (binding != null)
+ return binding;
+
+ return GetForeground(element);
+ }
+
+ public static void RestoreForegroundCache(this FrameworkElement element, object cache)
+ {
+ var binding = cache as WBinding;
+ if (binding != null)
+ SetForeground(element, binding);
+ else
+ SetForeground(element, (WBrush)cache);
+ }
+
+ public static void SetForeground(this FrameworkElement element, WBrush foregroundBrush)
+ {
+ if (element == null)
+ throw new ArgumentNullException("element");
+
+ element.SetValue(GetForegroundProperty(element), foregroundBrush);
+ }
+
+ public static void SetForeground(this FrameworkElement element, WBinding binding)
+ {
+ if (element == null)
+ throw new ArgumentNullException("element");
+
+ element.SetBinding(GetForegroundProperty(element), binding);
+ }
+
+ internal static IEnumerable GetDescendantsByName(this DependencyObject parent, string elementName) where T : DependencyObject
+ {
+ int myChildrenCount = VisualTreeHelper.GetChildrenCount(parent);
+ for (int i = 0; i < myChildrenCount; i++)
+ {
+ var child = VisualTreeHelper.GetChild(parent, i);
+ var controlName = child.GetValue(FrameworkElement.NameProperty) as string;
+ if (controlName == elementName && child is T)
+ yield return child as T;
+ else
+ {
+ foreach (var subChild in child.GetDescendantsByName(elementName))
+ yield return subChild;
+ }
+ }
+ }
+
+ internal static T GetFirstDescendant(this DependencyObject element) where T : FrameworkElement
+ {
+ int count = VisualTreeHelper.GetChildrenCount(element);
+ for (var i = 0; i < count; i++)
+ {
+ DependencyObject child = VisualTreeHelper.GetChild(element, i);
+
+ T target = child as T ?? GetFirstDescendant(child);
+ if (target != null)
+ return target;
+ }
+
+ return null;
+ }
+
+ static DependencyProperty GetForegroundProperty(FrameworkElement element)
+ {
+ if (element is Control)
+ return Control.ForegroundProperty;
+ if (element is TextBlock)
+ return TextBlock.ForegroundProperty;
+
+ Type type = element.GetType();
+
+ DependencyProperty foregroundProperty;
+ if (!ForegroundProperties.Value.TryGetValue(type, out foregroundProperty))
+ {
+ FieldInfo field = ReflectionExtensions.GetFields(type).FirstOrDefault(f => f.Name == "ForegroundProperty");
+ if (field == null)
+ throw new ArgumentException("type is not a Foregroundable type");
+
+ var property = (DependencyProperty)field.GetValue(null);
+ ForegroundProperties.Value.TryAdd(type, property);
+
+ return property;
+ }
+
+ return foregroundProperty;
+ }
+
+ internal static IEnumerable GetChildren(this DependencyObject parent) where T : DependencyObject
+ {
+ int myChildrenCount = VisualTreeHelper.GetChildrenCount(parent);
+ for (int i = 0; i < myChildrenCount; i++)
+ {
+ var child = VisualTreeHelper.GetChild(parent, i);
+ if (child is T)
+ yield return child as T;
+ else
+ {
+ foreach (var subChild in child.GetChildren())
+ yield return subChild;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/WinUI/GeometryExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/GeometryExtensions.cs
similarity index 82%
rename from src/Compatibility/Core/src/WinUI/GeometryExtensions.cs
rename to src/Controls/src/Core/Platform/Windows/Extensions/GeometryExtensions.cs
index e505ea28d78f..54664a8bee98 100644
--- a/src/Compatibility/Core/src/WinUI/GeometryExtensions.cs
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/GeometryExtensions.cs
@@ -1,12 +1,17 @@
+using System;
using Microsoft.Maui.Controls.Shapes;
using WFoundation = Windows.Foundation;
using WMedia = Microsoft.UI.Xaml.Media;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
+namespace Microsoft.Maui.Controls.Platform
{
public static class GeometryExtensions
{
- public static WMedia.Geometry ToWindows(this Geometry geometry)
+ [Obsolete("ToWindows is obsolete. Please use ToNative instead")]
+ public static WMedia.Geometry ToWindows(this Geometry geometry) =>
+ geometry.ToNative();
+
+ public static WMedia.Geometry ToNative(this Geometry geometry)
{
WMedia.Geometry wGeometry = null;
@@ -15,8 +20,8 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
LineGeometry lineGeometry = geometry as LineGeometry;
wGeometry = new WMedia.LineGeometry
{
- StartPoint = lineGeometry.StartPoint.ToWindows(),
- EndPoint = lineGeometry.EndPoint.ToWindows()
+ StartPoint = lineGeometry.StartPoint.ToNative(),
+ EndPoint = lineGeometry.EndPoint.ToNative()
};
}
else if (geometry is RectangleGeometry)
@@ -32,7 +37,7 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
EllipseGeometry ellipseGeometry = geometry as EllipseGeometry;
wGeometry = new WMedia.EllipseGeometry
{
- Center = ellipseGeometry.Center.ToWindows(),
+ Center = ellipseGeometry.Center.ToNative(),
RadiusX = ellipseGeometry.RadiusX,
RadiusY = ellipseGeometry.RadiusY
};
@@ -47,7 +52,7 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
foreach (Geometry children in geometryGroup.Children)
{
- WMedia.Geometry winChild = children.ToWindows();
+ WMedia.Geometry winChild = children.ToNative();
(wGeometry as WMedia.GeometryGroup).Children.Add(winChild);
}
}
@@ -64,7 +69,7 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
{
WMedia.PathFigure wPathFigure = new WMedia.PathFigure
{
- StartPoint = xamPathFigure.StartPoint.ToWindows(),
+ StartPoint = xamPathFigure.StartPoint.ToNative(),
IsFilled = xamPathFigure.IsFilled,
IsClosed = xamPathFigure.IsClosed
};
@@ -79,7 +84,7 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
WMedia.LineSegment winSegment = new WMedia.LineSegment
{
- Point = lineSegment.Point.ToWindows()
+ Point = lineSegment.Point.ToNative()
};
wPathFigure.Segments.Add(winSegment);
@@ -93,7 +98,7 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
foreach (var point in polyLineSegment.Points)
{
- wSegment.Points.Add(point.ToWindows());
+ wSegment.Points.Add(point.ToNative());
}
wPathFigure.Segments.Add(wSegment);
@@ -106,9 +111,9 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
WMedia.BezierSegment wSegment = new WMedia.BezierSegment
{
- Point1 = bezierSegment.Point1.ToWindows(),
- Point2 = bezierSegment.Point2.ToWindows(),
- Point3 = bezierSegment.Point3.ToWindows()
+ Point1 = bezierSegment.Point1.ToNative(),
+ Point2 = bezierSegment.Point2.ToNative(),
+ Point3 = bezierSegment.Point3.ToNative()
};
wPathFigure.Segments.Add(wSegment);
@@ -121,7 +126,7 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
foreach (var point in polyBezierSegment.Points)
{
- wSegment.Points.Add(point.ToWindows());
+ wSegment.Points.Add(point.ToNative());
}
wPathFigure.Segments.Add(wSegment);
@@ -134,8 +139,8 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
WMedia.QuadraticBezierSegment wSegment = new WMedia.QuadraticBezierSegment
{
- Point1 = quadraticBezierSegment.Point1.ToWindows(),
- Point2 = quadraticBezierSegment.Point2.ToWindows()
+ Point1 = quadraticBezierSegment.Point1.ToNative(),
+ Point2 = quadraticBezierSegment.Point2.ToNative()
};
wPathFigure.Segments.Add(wSegment);
@@ -148,7 +153,7 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
foreach (var point in polyQuadraticBezierSegment.Points)
{
- wSegment.Points.Add(point.ToWindows());
+ wSegment.Points.Add(point.ToNative());
}
wPathFigure.Segments.Add(wSegment);
@@ -164,7 +169,7 @@ public static WMedia.Geometry ToWindows(this Geometry geometry)
RotationAngle = arcSegment.RotationAngle,
IsLargeArc = arcSegment.IsLargeArc,
SweepDirection = arcSegment.SweepDirection == SweepDirection.Clockwise ? WMedia.SweepDirection.Clockwise : WMedia.SweepDirection.Counterclockwise,
- Point = arcSegment.Point.ToWindows()
+ Point = arcSegment.Point.ToNative()
};
wPathFigure.Segments.Add(wSegment);
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/ImageExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/ImageExtensions.cs
new file mode 100644
index 000000000000..cce1a59eeb4d
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/ImageExtensions.cs
@@ -0,0 +1,130 @@
+using System;
+using Microsoft.Graphics.Canvas.UI.Xaml;
+using Microsoft.UI.Xaml.Media.Imaging;
+using System.Runtime.CompilerServices;
+using System.Threading;
+using System.Threading.Tasks;
+using Windows.Foundation;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media;
+using Microsoft.Maui.Controls.Internals;
+using WImageSource = Microsoft.UI.Xaml.Media.ImageSource;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal static class ImageExtensions
+ {
+ public static Graphics.Size GetImageSourceSize(this WImageSource source)
+ {
+ if (source is null)
+ {
+ return Graphics.Size.Zero;
+ }
+ else if (source is BitmapSource bitmap)
+ {
+ return new Graphics.Size
+ {
+ Width = bitmap.PixelWidth,
+ Height = bitmap.PixelHeight
+ };
+ }
+ else if (source is CanvasImageSource canvas)
+ {
+ return new Graphics.Size
+ {
+ Width = canvas.Size.Width,
+ Height = canvas.Size.Height
+ };
+ }
+
+ throw new InvalidCastException($"\"{source.GetType().FullName}\" is not supported.");
+ }
+
+ public static Microsoft.UI.Xaml.Controls.IconSource ToWindowsIconSource(this ImageSource source)
+ {
+ return source.ToWindowsIconSourceAsync().GetAwaiter().GetResult();
+ }
+
+ public static async Task ToWindowsIconSourceAsync(this ImageSource source, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (source == null || source.IsEmpty)
+ return null;
+
+ var handler = Registrar.Registered.GetHandlerForObject(source);
+ if (handler == null)
+ return null;
+
+ try
+ {
+ return await handler.LoadIconSourceAsync(source, cancellationToken);
+ }
+ catch (OperationCanceledException)
+ {
+ // no-op
+ }
+
+ return null;
+ }
+
+ public static IconElement ToWindowsIconElement(this ImageSource source)
+ {
+ return source.ToWindowsIconElementAsync().GetAwaiter().GetResult();
+ }
+
+ public static async Task ToWindowsIconElementAsync(this ImageSource source, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (source == null || source.IsEmpty)
+ return null;
+
+ var handler = Registrar.Registered.GetHandlerForObject(source);
+ if (handler == null)
+ return null;
+
+ try
+ {
+ return await handler.LoadIconElementAsync(source, cancellationToken);
+ }
+ catch (OperationCanceledException)
+ {
+ // no-op
+ }
+
+ return null;
+ }
+
+ public static WImageSource ToWindowsImageSource(this ImageSource source)
+ {
+ return source.ToWindowsImageSourceAsync().GetAwaiter().GetResult();
+ }
+
+ public static async Task ToWindowsImageSourceAsync(this ImageSource source, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (source == null || source.IsEmpty)
+ return null;
+
+ var handler = Registrar.Registered.GetHandlerForObject(source);
+ if (handler == null)
+ return null;
+
+ try
+ {
+ return await handler.LoadImageAsync(source, cancellationToken);
+ }
+ catch (OperationCanceledException)
+ {
+ Log.Warning("Image loading", "Image load cancelled");
+ }
+ catch (Exception ex)
+ {
+ Log.Warning("Image loading", $"Image load failed: {ex}");
+#if DEBUG
+ throw;
+#endif
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/PointExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/PointExtensions.cs
new file mode 100644
index 000000000000..e00e2d0f5219
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/PointExtensions.cs
@@ -0,0 +1,12 @@
+using System;
+using Microsoft.Maui.Graphics;
+using WPoint = Windows.Foundation.Point;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ public static class PointExtensions
+ {
+ [Obsolete("ToWindows is obsolete. Please use ToNative instead")]
+ public static WPoint ToWindows(this Point point) => point.ToNative();
+ }
+}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/WinUI/Extensions/TextBlockExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/TextBlockExtensions.cs
similarity index 95%
rename from src/Compatibility/Core/src/WinUI/Extensions/TextBlockExtensions.cs
rename to src/Controls/src/Core/Platform/Windows/Extensions/TextBlockExtensions.cs
index 04095e97f50a..dd033806716c 100644
--- a/src/Compatibility/Core/src/WinUI/Extensions/TextBlockExtensions.cs
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/TextBlockExtensions.cs
@@ -2,7 +2,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.UAP.Extensions
+namespace Microsoft.Maui.Controls.Platform
{
internal static class TextBlockExtensions
{
diff --git a/src/Compatibility/Core/src/WinUI/Extensions/TransformExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/TransformExtensions.cs
similarity index 68%
rename from src/Compatibility/Core/src/WinUI/Extensions/TransformExtensions.cs
rename to src/Controls/src/Core/Platform/Windows/Extensions/TransformExtensions.cs
index c1d9ca83f432..2081b5d68fcb 100644
--- a/src/Compatibility/Core/src/WinUI/Extensions/TransformExtensions.cs
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/TransformExtensions.cs
@@ -1,16 +1,9 @@
using Microsoft.Maui.Controls.Shapes;
-#if WINDOWS_UWP
using WMatrix = Microsoft.UI.Xaml.Media.Matrix;
using WMatrixTransform = Microsoft.UI.Xaml.Media.MatrixTransform;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
-#else
-using WMatrix = System.Windows.Media.Matrix;
-using WMatrixTransform = System.Windows.Media.MatrixTransform;
-
-namespace Microsoft.Maui.Controls.Compatibility.Platform.WPF
-#endif
+namespace Microsoft.Maui.Controls.Platform
{
public static class TransformExtensions
{
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/ViewExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/ViewExtensions.cs
new file mode 100644
index 000000000000..28e42188fdc8
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/ViewExtensions.cs
@@ -0,0 +1,20 @@
+using System.Collections.Generic;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal static class ViewExtensions
+ {
+ public static IEnumerable GetParentPages(this IView target)
+ {
+ var result = new List();
+ var parent = target.Parent as IPage;
+ while (!Application.IsApplicationOrNull(parent))
+ {
+ result.Add(parent);
+ parent = parent.Parent as IPage;
+ }
+
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/VisualElementExtensions.cs b/src/Controls/src/Core/Platform/Windows/Extensions/VisualElementExtensions.cs
new file mode 100644
index 000000000000..6c29acfb9222
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/VisualElementExtensions.cs
@@ -0,0 +1,48 @@
+using System;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ public static class VisualElementExtensions
+ {
+ public static IViewHandler GetOrCreateHandler(this IView self, IMauiContext mauiContext)
+ {
+ if (self == null)
+ throw new ArgumentNullException("self");
+
+ if (self.Handler != null)
+ return self.Handler;
+
+ self.ToNative(mauiContext);
+ return self.Handler;
+ }
+
+ // TODO MAUI Make this work against IVIEW
+ internal static void Cleanup(this VisualElement self)
+ {
+ if (self == null)
+ throw new ArgumentNullException("self");
+
+ IViewHandler handler = self.Handler;
+
+ foreach (Element element in self.Descendants())
+ {
+ var visual = element as VisualElement;
+ if (visual == null)
+ continue;
+
+ visual.Handler = null;
+ }
+
+ self.Handler = null;
+ }
+
+ internal static bool UseFormsVsm(this T element) where T : VisualElement, IElementConfiguration
+ {
+ // Determine whether we're letting the VSM handle the colors or doing it the old way
+ // or disabling the legacy color management and doing it the old-old (pre 2.0) way
+ return element.HasVisualStateGroups()
+ || !element.OnThisPlatform().GetIsLegacyColorModeEnabled();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/Extensions/WinUIHelpers.cs b/src/Controls/src/Core/Platform/Windows/Extensions/WinUIHelpers.cs
new file mode 100644
index 000000000000..e12a5f6439b0
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Extensions/WinUIHelpers.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WThickness = Microsoft.UI.Xaml.Thickness;
+using WCornerRadius = Microsoft.UI.Xaml.CornerRadius;
+using WGridLength = Microsoft.UI.Xaml.GridLength;
+using UwpGridUnitType = Microsoft.UI.Xaml.GridUnitType;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ static class WinUIHelpers
+ {
+ public static WThickness CreateThickness(double left, double top, double right, double bottom)
+ {
+ return new WThickness
+ {
+ Left = left,
+ Top = top,
+ Right = right,
+ Bottom = bottom
+ };
+ }
+
+ public static WThickness CreateThickness(double all)
+ {
+ return new WThickness
+ {
+ Left = all,
+ Top = all,
+ Right = all,
+ Bottom = all
+ };
+ }
+ public static WCornerRadius CreateCornerRadius(double left, double top, double right, double bottom)
+ {
+ return new WCornerRadius
+ {
+ TopLeft = left,
+ TopRight = top,
+ BottomRight = right,
+ BottomLeft = bottom
+ };
+ }
+
+ public static WCornerRadius CreateCornerRadius(double all)
+ {
+ return new WCornerRadius
+ {
+ TopLeft = all,
+ TopRight = all,
+ BottomRight = all,
+ BottomLeft = all
+ };
+ }
+
+ public static WGridLength CreateGridLength(int v, UwpGridUnitType auto)
+ {
+ return new WGridLength(v, auto);
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/IDontGetFocus.cs b/src/Controls/src/Core/Platform/Windows/IDontGetFocus.cs
new file mode 100644
index 000000000000..d1229d0f97a2
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/IDontGetFocus.cs
@@ -0,0 +1,6 @@
+namespace Microsoft.Maui.Controls.Platform
+{
+ public interface IDontGetFocus
+ {
+ }
+}
diff --git a/src/Compatibility/Core/src/WinUI/IIconElementHandler.cs b/src/Controls/src/Core/Platform/Windows/IIconElementHandler.cs
similarity index 87%
rename from src/Compatibility/Core/src/WinUI/IIconElementHandler.cs
rename to src/Controls/src/Core/Platform/Windows/IIconElementHandler.cs
index c352fdb4b032..642395bbb505 100644
--- a/src/Compatibility/Core/src/WinUI/IIconElementHandler.cs
+++ b/src/Controls/src/Core/Platform/Windows/IIconElementHandler.cs
@@ -2,7 +2,7 @@
using System.Threading.Tasks;
using Microsoft.UI.Xaml.Controls;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
+namespace Microsoft.Maui.Controls.Platform
{
public interface IIconElementHandler : IRegisterable
{
diff --git a/src/Compatibility/Core/src/WinUI/IImageSourceHandler.cs b/src/Controls/src/Core/Platform/Windows/IImageSourceHandler.cs
similarity index 81%
rename from src/Compatibility/Core/src/WinUI/IImageSourceHandler.cs
rename to src/Controls/src/Core/Platform/Windows/IImageSourceHandler.cs
index e28e30f767cc..0afa367f6efe 100644
--- a/src/Compatibility/Core/src/WinUI/IImageSourceHandler.cs
+++ b/src/Controls/src/Core/Platform/Windows/IImageSourceHandler.cs
@@ -1,7 +1,7 @@
using System.Threading;
using System.Threading.Tasks;
-namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
+namespace Microsoft.Maui.Controls.Platform
{
public interface IImageSourceHandler : IRegisterable
{
diff --git a/src/Controls/src/Core/Platform/Windows/ITabStopOnDescendants.cs b/src/Controls/src/Core/Platform/Windows/ITabStopOnDescendants.cs
new file mode 100644
index 000000000000..1bddbd1b0e67
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ITabStopOnDescendants.cs
@@ -0,0 +1,6 @@
+namespace Microsoft.Maui.Controls.Platform
+{
+ public interface ITabStopOnDescendants : IDontGetFocus
+ {
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/ITitleIconProvider.cs b/src/Controls/src/Core/Platform/Windows/ITitleIconProvider.cs
new file mode 100644
index 000000000000..89db007f9787
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ITitleIconProvider.cs
@@ -0,0 +1,7 @@
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal interface ITitleIconProvider
+ {
+ Microsoft.UI.Xaml.Media.ImageSource TitleIcon { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/ITitleProvider.cs b/src/Controls/src/Core/Platform/Windows/ITitleProvider.cs
new file mode 100644
index 000000000000..c4cbfc5e8ba8
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ITitleProvider.cs
@@ -0,0 +1,15 @@
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal interface ITitleProvider
+ {
+ WBrush BarBackgroundBrush { set; }
+
+ WBrush BarForegroundBrush { set; }
+
+ bool ShowTitle { get; set; }
+
+ string Title { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/ITitleViewProvider.cs b/src/Controls/src/Core/Platform/Windows/ITitleViewProvider.cs
new file mode 100644
index 000000000000..558a514ec898
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ITitleViewProvider.cs
@@ -0,0 +1,7 @@
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal interface ITitleViewProvider
+ {
+ View TitleView { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/ITitleViewRendererController.cs b/src/Controls/src/Core/Platform/Windows/ITitleViewRendererController.cs
new file mode 100644
index 000000000000..60adf5b3f54c
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ITitleViewRendererController.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal interface ITitleViewRendererController
+ {
+ View TitleView { get; }
+ FrameworkElement TitleViewPresenter { get; }
+ Visibility TitleViewVisibility { get; set; }
+ CommandBar CommandBar { get; }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/IToolBarForegroundBinder.cs b/src/Controls/src/Core/Platform/Windows/IToolBarForegroundBinder.cs
new file mode 100644
index 000000000000..0eabc80b4ce2
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/IToolBarForegroundBinder.cs
@@ -0,0 +1,10 @@
+using Microsoft.UI.Xaml.Controls;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal interface IToolBarForegroundBinder
+ {
+ void BindForegroundColor(AppBar appBar);
+ void BindForegroundColor(AppBarButton button);
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/IToolbarProvider.cs b/src/Controls/src/Core/Platform/Windows/IToolbarProvider.cs
new file mode 100644
index 000000000000..e205053cce1f
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/IToolbarProvider.cs
@@ -0,0 +1,10 @@
+using System.Threading.Tasks;
+using Microsoft.UI.Xaml.Controls;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal interface IToolbarProvider
+ {
+ Task GetCommandBarAsync();
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/ImageConverter.cs b/src/Controls/src/Core/Platform/Windows/ImageConverter.cs
new file mode 100644
index 000000000000..59bd32c13766
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ImageConverter.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Threading.Tasks;
+using Microsoft.Maui.Controls.Internals;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ public class ImageConverter : Microsoft.UI.Xaml.Data.IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ return value is ImageSource source
+ ? source.ToWindowsImageSourceAsync().AsAsyncValue()
+ : null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ throw new NotSupportedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/ImageSourceIconElementConverter.cs b/src/Controls/src/Core/Platform/Windows/ImageSourceIconElementConverter.cs
new file mode 100644
index 000000000000..e618b851f715
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ImageSourceIconElementConverter.cs
@@ -0,0 +1,20 @@
+using System;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal class ImageSourceIconElementConverter : Microsoft.UI.Xaml.Data.IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ if (value is ImageSource source)
+ return source.ToWindowsIconElement();
+
+ return null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/MauiCommandBar.cs b/src/Controls/src/Core/Platform/Windows/MauiCommandBar.cs
new file mode 100644
index 000000000000..2bd05764de7f
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/MauiCommandBar.cs
@@ -0,0 +1,151 @@
+using System;
+using Windows.Foundation.Collections;
+using Microsoft.UI.Xaml;
+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.Platform
+{
+ public class MauiCommandBar : CommandBar
+ {
+ Microsoft.UI.Xaml.Controls.Button _moreButton;
+ Microsoft.UI.Xaml.Controls.ItemsControl _primaryItemsControl;
+ bool _isInValidLocation;
+
+ public MauiCommandBar()
+ {
+ PrimaryCommands.VectorChanged += OnCommandsChanged;
+ SecondaryCommands.VectorChanged += OnCommandsChanged;
+ UpdateVisibility();
+ WatchForContentChanges();
+ }
+
+ // Set by the container if the container is a valid place to show a toolbar.
+ // This exists to provide consistency with the other platforms; we've got
+ // rules in place that limit toolbars to Navigation Page and to Tabbed
+ // and Flyout-Detail Pages when they're currently displaying a Navigation Page
+ public bool IsInValidLocation
+ {
+ get { return _isInValidLocation; }
+ set
+ {
+ _isInValidLocation = value;
+ UpdateVisibility();
+ }
+ }
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _moreButton = GetTemplateChild("MoreButton") as Microsoft.UI.Xaml.Controls.Button;
+ _primaryItemsControl = GetTemplateChild("PrimaryItemsControl") as Microsoft.UI.Xaml.Controls.ItemsControl;
+ }
+
+ void OnCommandsChanged(IObservableVector sender, IVectorChangedEventArgs args)
+ {
+ UpdateVisibility();
+ }
+
+ void UpdateVisibility()
+ {
+ // Determine whether we have a title (or some other content) inside this command bar
+ var frameworkElement = Content as FrameworkElement;
+
+ // Apply the rules for consistency with other platforms
+
+ // Not in one of the acceptable toolbar locations from the other platforms
+ if (!IsInValidLocation)
+ {
+ // 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 != WVisibility.Visible)
+ {
+ // Just collapse the whole thing
+ 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 = WVisibility.Visible;
+
+ if (_moreButton != null)
+ {
+ _moreButton.Visibility = WVisibility.Collapsed;
+ }
+
+ if (_primaryItemsControl != null)
+ {
+ _primaryItemsControl.Visibility = WVisibility.Collapsed;
+ }
+
+ return;
+ }
+
+ // We're in one of the acceptable toolbar locations from the other platforms so the normal rules apply
+
+ if (_primaryItemsControl != null)
+ {
+ // This is normally visible by default, but it might have been collapsed by the toolbar consistency rules above
+ _primaryItemsControl.Visibility = WVisibility.Visible;
+ }
+
+ // Are there any commands to display?
+ var visibility = PrimaryCommands.Count + SecondaryCommands.Count > 0 ? WVisibility.Visible : WVisibility.Collapsed;
+
+ if (_moreButton != null)
+ {
+ // The "..." button should only be visible if we have commands to display
+ _moreButton.Visibility = visibility;
+
+ // There *is* an OverflowButtonVisibility property that does more or less the same thing,
+ // but it became available in 10.0.14393.0 and we have to support 10.0.10240
+ }
+
+ 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 = WVisibility.Visible;
+ }
+ else
+ {
+ // Otherwise, visibility depends on whether we have commands
+ Visibility = visibility;
+ }
+ }
+
+ void WatchForContentChanges()
+ {
+ // If the content of the command bar changes while it's collapsed, we need to
+ // react and update the visibility (e.g., if the bar is placed at the bottom and
+ // has no commands, then is moved to the top and now includes the title)
+
+ // There's no event on CommandBar when the content changes, so we'll bind our own
+ // dependency property to Content and update our visibility when it changes
+ var binding = new Microsoft.UI.Xaml.Data.Binding
+ {
+ Source = this,
+ Path = new PropertyPath(nameof(Content)),
+ Mode = Microsoft.UI.Xaml.Data.BindingMode.OneWay
+ };
+
+ BindingOperations.SetBinding(this, s_contentChangeWatcher, binding);
+ }
+
+ static readonly DependencyProperty s_contentChangeWatcher =
+ DependencyProperty.Register(
+ "ContentChangeWatcher",
+ typeof(object),
+ typeof(object),
+ new PropertyMetadata(null, ContentChanged));
+
+ static void ContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ (d as MauiCommandBar)?.UpdateVisibility();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/MauiPresenter.cs b/src/Controls/src/Core/Platform/Windows/MauiPresenter.cs
new file mode 100644
index 000000000000..4c46fa6b9250
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/MauiPresenter.cs
@@ -0,0 +1,30 @@
+using System;
+using Microsoft.UI.Xaml;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Graphics;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal class MauiPresenter : Microsoft.UI.Xaml.Controls.ContentPresenter
+ {
+ public MauiPresenter()
+ {
+ Loaded += FormsPresenter_Loaded;
+ Unloaded += FormsPresenter_Unloaded;
+ SizeChanged += (s, e) =>
+ {
+ if (ActualWidth > 0 && ActualHeight > 0 && DataContext != null)
+ {
+ var page = (Page)DataContext;
+ ((Page)page.RealParent).ContainerArea = new Rectangle(0, 0, ActualWidth, ActualHeight);
+ }
+ };
+ }
+
+ void FormsPresenter_Loaded(object sender, RoutedEventArgs e)
+ => (DataContext as Page)?.SendAppearing();
+
+ void FormsPresenter_Unloaded(object sender, RoutedEventArgs e)
+ => (DataContext as Page)?.SendDisappearing();
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/MenuItemCommand.cs b/src/Controls/src/Core/Platform/Windows/MenuItemCommand.cs
new file mode 100644
index 000000000000..a89c25367aa5
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/MenuItemCommand.cs
@@ -0,0 +1,42 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Input;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal class MenuItemCommand : ICommand
+ {
+ readonly MenuItem _menuItem;
+
+ public MenuItemCommand(MenuItem item)
+ {
+ _menuItem = item;
+ _menuItem.PropertyChanged += OnElementPropertyChanged;
+ }
+
+ public virtual bool CanExecute(object parameter)
+ {
+ return _menuItem.IsEnabled;
+ }
+
+ public event EventHandler CanExecuteChanged;
+
+ public void Execute(object parameter)
+ {
+ ((IMenuItemController)_menuItem).Activate();
+ }
+
+ void OnCanExecuteChanged()
+ {
+ EventHandler changed = CanExecuteChanged;
+ if (changed != null)
+ changed(this, EventArgs.Empty);
+ }
+
+ void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
+ OnCanExecuteChanged();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/NativeBindingExtensions.cs b/src/Controls/src/Core/Platform/Windows/NativeBindingExtensions.cs
new file mode 100644
index 000000000000..bd055420e86f
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/NativeBindingExtensions.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Microsoft.UI.Xaml;
+using Microsoft.Maui.Controls.Internals;
+using static System.String;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ public static class NativeBindingExtensions
+ {
+ // TODO MAUI
+ //public static void SetBinding(this FrameworkElement view, string propertyName, BindingBase bindingBase, string updateSourceEventName = null)
+ //{
+ // var binding = bindingBase as Binding;
+ // updateSourceEventName = updateSourceEventName ?? binding?.UpdateSourceEventName;
+
+ // if (IsNullOrEmpty(updateSourceEventName))
+ // {
+ // NativePropertyListener nativePropertyListener = null;
+ // if (bindingBase.Mode == BindingMode.TwoWay)
+ // nativePropertyListener = new NativePropertyListener(view, propertyName);
+
+ // NativeBindingHelpers.SetBinding(view, propertyName, bindingBase, nativePropertyListener as INotifyPropertyChanged);
+ // return;
+ // }
+
+ // NativeEventWrapper eventE = null;
+ // if (binding.Mode == BindingMode.TwoWay && !(view is INotifyPropertyChanged))
+ // eventE = new NativeEventWrapper(view, propertyName, updateSourceEventName);
+
+ // NativeBindingHelpers.SetBinding(view, propertyName, binding, eventE);
+ //}
+
+ public static void SetBinding(this FrameworkElement view, BindableProperty targetProperty, BindingBase binding)
+ {
+ NativeBindingHelpers.SetBinding(view, targetProperty, binding);
+ }
+
+ public static void SetValue(this FrameworkElement target, BindableProperty targetProperty, object value)
+ {
+ NativeBindingHelpers.SetValue(target, targetProperty, value);
+ }
+
+ public static void SetBindingContext(this FrameworkElement target, object bindingContext, Func> getChildren = null)
+ {
+ NativeBindingHelpers.SetBindingContext(target, bindingContext, getChildren);
+ }
+
+ internal static void TransferbindablePropertiesToWrapper(this FrameworkElement target, View wrapper)
+ {
+ NativeBindingHelpers.TransferBindablePropertiesToWrapper(target, wrapper);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/PageControl.cs b/src/Controls/src/Core/Platform/Windows/PageControl.cs
new file mode 100644
index 000000000000..de90d10fc1d5
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/PageControl.cs
@@ -0,0 +1,184 @@
+using System.Threading.Tasks;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+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.Platform
+{
+ public sealed class PageControl : ContentControl, IToolbarProvider, ITitleViewRendererController
+ {
+ 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)));
+
+ public static readonly DependencyProperty BackButtonTitleProperty = DependencyProperty.Register("BackButtonTitle", typeof(string), typeof(PageControl), new PropertyMetadata(false));
+
+ public static readonly DependencyProperty ContentMarginProperty = DependencyProperty.Register("ContentMargin", typeof(Microsoft.UI.Xaml.Thickness), typeof(PageControl),
+ new PropertyMetadata(default(Microsoft.UI.Xaml.Thickness)));
+
+ public static readonly DependencyProperty TitleIconProperty = DependencyProperty.Register(nameof(TitleIcon), typeof(WImageSource), typeof(PageControl), new PropertyMetadata(default(WImageSource)));
+
+ 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(WVisibility), typeof(PageControl), new PropertyMetadata(WVisibility.Collapsed));
+
+ public static readonly DependencyProperty TitleInsetProperty = DependencyProperty.Register("TitleInset", typeof(double), typeof(PageControl), new PropertyMetadata(default(double)));
+
+ public static readonly DependencyProperty TitleBrushProperty = DependencyProperty.Register("TitleBrush", typeof(WBrush), typeof(PageControl), new PropertyMetadata(null));
+
+ CommandBar _commandBar;
+ FrameworkElement _titleViewPresenter;
+
+ ToolbarPlacement _toolbarPlacement;
+ bool _toolbarDynamicOverflowEnabled = true;
+ readonly ToolbarPlacementHelper _toolbarPlacementHelper = new ToolbarPlacementHelper();
+
+ public bool ShouldShowToolbar
+ {
+ get { return _toolbarPlacementHelper.ShouldShowToolBar; }
+ set { _toolbarPlacementHelper.ShouldShowToolBar = value; }
+ }
+
+ public WImageSource TitleIcon
+ {
+ get { return (WImageSource)GetValue(TitleIconProperty); }
+ set { SetValue(TitleIconProperty, value); }
+ }
+
+ public View TitleView
+ {
+ get { return (View)GetValue(TitleViewProperty); }
+ set { SetValue(TitleViewProperty, value); }
+ }
+
+ TaskCompletionSource _commandBarTcs;
+ Microsoft.UI.Xaml.Controls.ContentPresenter _presenter;
+ TitleViewManager _titleViewManager;
+
+ public PageControl()
+ {
+ Style = Microsoft.UI.Xaml.Application.Current.Resources["MauiControlsPageControlStyle"] as Microsoft.UI.Xaml.Style;
+ }
+
+ public string BackButtonTitle
+ {
+ get { return (string)GetValue(BackButtonTitleProperty); }
+ set { SetValue(BackButtonTitleProperty, value); }
+ }
+
+ public double ContentHeight
+ {
+ get { return _presenter != null ? _presenter.ActualHeight : 0; }
+ }
+
+ public Microsoft.UI.Xaml.Thickness ContentMargin
+ {
+ get { return (Microsoft.UI.Xaml.Thickness)GetValue(ContentMarginProperty); }
+ set { SetValue(ContentMarginProperty, value); }
+ }
+
+ public double ContentWidth
+ {
+ get { return _presenter != null ? _presenter.ActualWidth : 0; }
+ }
+
+ public WBrush ToolbarBackground
+ {
+ get { return (WBrush)GetValue(ToolbarBackgroundProperty); }
+ set { SetValue(ToolbarBackgroundProperty, value); }
+ }
+
+ public ToolbarPlacement ToolbarPlacement
+ {
+ get { return _toolbarPlacement; }
+ set
+ {
+ _toolbarPlacement = value;
+ _toolbarPlacementHelper.UpdateToolbarPlacement();
+ }
+ }
+
+ public bool ToolbarDynamicOverflowEnabled
+ {
+ get { return _toolbarDynamicOverflowEnabled; }
+ set
+ {
+ _toolbarDynamicOverflowEnabled = value;
+ UpdateToolbarDynamicOverflowEnabled();
+ }
+ }
+
+ public Visibility TitleVisibility
+ {
+ get { return (Visibility)GetValue(TitleVisibilityProperty); }
+ set { SetValue(TitleVisibilityProperty, value); }
+ }
+
+ public Visibility TitleViewVisibility
+ {
+ get { return (Visibility)GetValue(TitleViewVisibilityProperty); }
+ set { SetValue(TitleViewVisibilityProperty, value); }
+ }
+
+ public WBrush TitleBrush
+ {
+ get { return (WBrush)GetValue(TitleBrushProperty); }
+ set { SetValue(TitleBrushProperty, value); }
+ }
+
+ public double TitleInset
+ {
+ get { return (double)GetValue(TitleInsetProperty); }
+ set { SetValue(TitleInsetProperty, value); }
+ }
+
+ FrameworkElement ITitleViewRendererController.TitleViewPresenter => _titleViewPresenter;
+ CommandBar ITitleViewRendererController.CommandBar => _commandBar;
+
+ Task IToolbarProvider.GetCommandBarAsync()
+ {
+ if (_commandBar != null)
+ return Task.FromResult(_commandBar);
+
+ _commandBarTcs = new TaskCompletionSource();
+ ApplyTemplate();
+ return _commandBarTcs.Task;
+ }
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _presenter = GetTemplateChild("presenter") as Microsoft.UI.Xaml.Controls.ContentPresenter;
+
+ _titleViewPresenter = GetTemplateChild("TitleViewPresenter") as FrameworkElement;
+
+ _commandBar = GetTemplateChild("CommandBar") as CommandBar;
+
+ _titleViewManager = new TitleViewManager(this);
+
+ _toolbarPlacementHelper.Initialize(_commandBar, () => ToolbarPlacement, GetTemplateChild);
+ UpdateToolbarDynamicOverflowEnabled();
+
+ TaskCompletionSource tcs = _commandBarTcs;
+ tcs?.SetResult(_commandBar);
+ }
+
+ static void OnTitleViewPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
+ {
+ ((PageControl)dependencyObject)._titleViewManager?.OnTitleViewPropertyChanged();
+ }
+
+ void UpdateToolbarDynamicOverflowEnabled()
+ {
+ if (_commandBar != null)
+ {
+ _commandBar.IsDynamicOverflowEnabled = ToolbarDynamicOverflowEnabled;
+ }
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/PlatformConfigurationExtensions.cs b/src/Controls/src/Core/Platform/Windows/PlatformConfigurationExtensions.cs
new file mode 100644
index 000000000000..9db9dc4a228a
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/PlatformConfigurationExtensions.cs
@@ -0,0 +1,11 @@
+namespace Microsoft.Maui.Controls.Platform
+{
+ public static class PlatformConfigurationExtensions
+ {
+ public static IPlatformElementConfiguration OnThisPlatform(this T element)
+ where T : Element, IElementConfiguration
+ {
+ return (element).On();
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/Styles/MauiControlsPageControlStyle.xaml b/src/Controls/src/Core/Platform/Windows/Styles/MauiControlsPageControlStyle.xaml
new file mode 100644
index 000000000000..eb296b37cda9
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Styles/MauiControlsPageControlStyle.xaml
@@ -0,0 +1,54 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/Styles/Resources.xaml b/src/Controls/src/Core/Platform/Windows/Styles/Resources.xaml
new file mode 100644
index 000000000000..24b480ce625d
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/Styles/Resources.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/src/Controls/src/Core/Platform/Windows/TitleViewManager.cs b/src/Controls/src/Core/Platform/Windows/TitleViewManager.cs
new file mode 100644
index 000000000000..280a44363996
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/TitleViewManager.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using WVisibility = Microsoft.UI.Xaml.Visibility;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal class TitleViewManager
+ {
+ readonly ITitleViewRendererController _titleViewRendererController;
+
+ View TitleView => _titleViewRendererController.TitleView;
+ CommandBar CommandBar => _titleViewRendererController.CommandBar;
+ FrameworkElement TitleViewPresenter => _titleViewRendererController.TitleViewPresenter;
+
+ public TitleViewManager(ITitleViewRendererController titleViewRendererController)
+ {
+ _titleViewRendererController = titleViewRendererController;
+
+ if (TitleViewPresenter != null)
+ {
+ TitleViewPresenter.Loaded += OnTitleViewPresenterLoaded;
+ }
+
+ if (CommandBar != null)
+ {
+ CommandBar.LayoutUpdated += commandLayoutUpdated;
+ CommandBar.Unloaded += commandBarUnloaded;
+ }
+ }
+
+ internal void OnTitleViewPropertyChanged()
+ {
+ UpdateTitleViewWidth();
+ }
+
+ void OnTitleViewPresenterLoaded(object sender, RoutedEventArgs e)
+ {
+ UpdateTitleViewWidth();
+ if (TitleViewPresenter != null)
+ {
+ TitleViewPresenter.Loaded -= OnTitleViewPresenterLoaded;
+ }
+ }
+
+ void commandBarUnloaded(object sender, RoutedEventArgs e)
+ {
+ if (CommandBar != null)
+ {
+ CommandBar.LayoutUpdated -= commandLayoutUpdated;
+ CommandBar.Unloaded -= commandBarUnloaded;
+ }
+ }
+
+ void commandLayoutUpdated(object sender, object e)
+ {
+ UpdateTitleViewWidth();
+ }
+
+ void UpdateTitleViewWidth()
+ {
+ if (TitleView == null || TitleViewPresenter == null || CommandBar == null)
+ return;
+
+ if (CommandBar.ActualWidth <= 0)
+ return;
+
+ double buttonWidth = 0;
+
+ foreach (var item in CommandBar.GetDescendantsByName("MoreButton"))
+ if (item.Visibility == WVisibility.Visible)
+ buttonWidth += item.ActualWidth;
+
+ if (!CommandBar.IsDynamicOverflowEnabled)
+ foreach (var item in CommandBar.GetDescendantsByName("PrimaryItemsControl"))
+ buttonWidth += item.ActualWidth;
+
+ TitleViewPresenter.Width = CommandBar.ActualWidth - buttonWidth;
+ UpdateVisibility();
+ }
+
+ void UpdateVisibility()
+ {
+ if (TitleView == null)
+ _titleViewRendererController.TitleViewVisibility = Visibility.Collapsed;
+ else
+ _titleViewRendererController.TitleViewVisibility = Visibility.Visible;
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/ToolbarManager.cs b/src/Controls/src/Core/Platform/Windows/ToolbarManager.cs
new file mode 100644
index 000000000000..b8d346aade33
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ToolbarManager.cs
@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.UI.Xaml.Controls;
+using WImage = Microsoft.UI.Xaml.Controls.Image;
+using NativeAutomationProperties = Microsoft.UI.Xaml.Automation.AutomationProperties;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ // TODO MAUI
+ // this needs to be fixed to handle multi page
+ static internal class ToolbarManager
+ {
+ static ToolbarTracker _toolbarTracker = new ToolbarTracker();
+ static ImageConverter _imageConverter = new ImageConverter();
+ static ImageSourceIconElementConverter _imageSourceIconElementConverter = new ImageSourceIconElementConverter();
+
+ static internal async Task UpdateToolbarItems(NavigationPage page)
+ {
+ _toolbarTracker.Target = page.CurrentPage;
+ var toolbarProvider = GetToolbarProvider(page);
+
+ if (toolbarProvider == null)
+ {
+ return;
+ }
+
+ var commandBar = await toolbarProvider.GetCommandBarAsync();
+
+ if (commandBar == null)
+ {
+ return;
+ }
+
+ commandBar.PrimaryCommands.Clear();
+ commandBar.SecondaryCommands.Clear();
+
+ var toolBarForegroundBinder = GetToolbarProvider(page) as IToolBarForegroundBinder;
+
+ foreach (ToolbarItem item in _toolbarTracker.ToolbarItems)
+ {
+ toolBarForegroundBinder?.BindForegroundColor(commandBar);
+
+ var button = new AppBarButton();
+ button.SetBinding(AppBarButton.LabelProperty, "Text");
+
+ if (commandBar.IsDynamicOverflowEnabled && item.Order == ToolbarItemOrder.Secondary)
+ {
+ button.SetBinding(AppBarButton.IconProperty, "IconImageSource", _imageSourceIconElementConverter);
+ }
+ else
+ {
+ var img = new WImage();
+ img.SetBinding(WImage.SourceProperty, "Value");
+ img.SetBinding(WImage.DataContextProperty, "IconImageSource", _imageConverter);
+ button.Content = img;
+ }
+
+ button.Command = new MenuItemCommand(item);
+ button.DataContext = item;
+ button.SetValue(NativeAutomationProperties.AutomationIdProperty, item.AutomationId);
+ button.SetAutomationPropertiesName(item);
+ button.SetAutomationPropertiesAccessibilityView(item);
+ button.SetAutomationPropertiesHelpText(item);
+
+ // TODO MAUI
+ button.SetAutomationPropertiesLabeledBy(item, null);
+
+ ToolbarItemOrder order = item.Order == ToolbarItemOrder.Default ? ToolbarItemOrder.Primary : item.Order;
+ if (order == ToolbarItemOrder.Primary)
+ {
+ toolBarForegroundBinder?.BindForegroundColor(button);
+ commandBar.PrimaryCommands.Add(button);
+ }
+ else
+ {
+ commandBar.SecondaryCommands.Add(button);
+ }
+ }
+ }
+
+ static internal IToolbarProvider GetToolbarProvider(Page page)
+ {
+ IToolbarProvider provider = null;
+
+ Page element = page;
+ while (element != null)
+ {
+ provider = element.Handler as IToolbarProvider;
+ if (provider != null)
+ break;
+
+ var pageContainer = element as IPageContainer;
+ element = pageContainer?.CurrentPage;
+ }
+
+ return provider;
+ }
+
+ }
+}
diff --git a/src/Controls/src/Core/Platform/Windows/ToolbarPlacementHelper.cs b/src/Controls/src/Core/Platform/Windows/ToolbarPlacementHelper.cs
new file mode 100644
index 000000000000..bfa5086fb26d
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/ToolbarPlacementHelper.cs
@@ -0,0 +1,121 @@
+using System;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ internal class ToolbarPlacementHelper
+ {
+ Border _bottomCommandBarArea;
+ CommandBar _commandBar;
+ Func _getToolbarPlacement;
+ Border _titleArea;
+ Border _topCommandBarArea;
+
+ public void Initialize(CommandBar commandBar, Func getToolbarPlacement,
+ Func getTemplateChild)
+ {
+ _commandBar = commandBar;
+ _getToolbarPlacement = getToolbarPlacement;
+ _bottomCommandBarArea = getTemplateChild("BottomCommandBarArea") as Border;
+ _topCommandBarArea = getTemplateChild("TopCommandBarArea") as Border;
+ _titleArea = getTemplateChild("TitleArea") as Border;
+
+ if (_commandBar != null && _bottomCommandBarArea != null && _topCommandBarArea != null)
+ {
+ // We have to wait for the command bar to load so that it'll be in the control hierarchy
+ // otherwise we can't properly move it to wherever the toolbar is supposed to be
+ _commandBar.Loaded += (sender, args) =>
+ {
+ UpdateToolbarPlacement();
+ UpdateIsInValidLocation();
+ };
+ }
+ }
+
+ public void UpdateToolbarPlacement()
+ {
+ if (_commandBar == null || _getToolbarPlacement == null || _bottomCommandBarArea == null ||
+ _topCommandBarArea == null)
+ {
+ // Template hasn't been applied yet, so we're not ready to update the toolbar placement
+ return;
+ }
+
+ UpdateToolbarPlacement(_commandBar, _getToolbarPlacement(), _bottomCommandBarArea, _topCommandBarArea, _titleArea);
+ }
+
+ static void UpdateToolbarPlacement(CommandBar toolbar, ToolbarPlacement toolbarPlacement, Border bottomCommandBarArea,
+ Border topCommandBarArea, Border titleArea)
+ {
+ // Figure out what's hosting the command bar right now
+ var current = toolbar.Parent as Border;
+
+ // And figure out where it should be
+ Border target;
+
+ switch (toolbarPlacement)
+ {
+ case ToolbarPlacement.Top:
+ target = topCommandBarArea;
+ break;
+ case ToolbarPlacement.Bottom:
+ target = bottomCommandBarArea;
+ break;
+ case ToolbarPlacement.Default:
+ default:
+ target = Device.Idiom == TargetIdiom.Phone ? bottomCommandBarArea : topCommandBarArea;
+ break;
+ }
+
+ if (current == null || target == null || current == target)
+ {
+ return;
+ }
+
+ // Remove the command bar from its current host and add it to the new one
+ current.Child = null;
+ target.Child = toolbar;
+
+ if (titleArea != null)
+ {
+ if (target == bottomCommandBarArea)
+ {
+ // If the title is hosted in the command bar and we're moving the command bar to the bottom,
+ // put the title into the topCommandBarArea
+ toolbar.Content = null;
+ topCommandBarArea.Child = titleArea;
+ }
+ else
+ {
+ // Put the title back into the command bar
+ toolbar.Content = titleArea;
+ }
+ }
+ }
+
+ // For the time being, keeping this logic for dealing with consistency between the platforms
+ // re: toolbar visibility here; at some point we should be separating toolbars from navigation bars,
+ // and this won't be necessary
+ bool _shouldShowToolBar;
+ public bool ShouldShowToolBar
+ {
+ get { return _shouldShowToolBar; }
+ set
+ {
+ _shouldShowToolBar = value;
+ UpdateIsInValidLocation();
+ }
+ }
+
+ void UpdateIsInValidLocation()
+ {
+ var MauiCommandBar = _commandBar as MauiCommandBar;
+ if (MauiCommandBar != null)
+ {
+ MauiCommandBar.IsInValidLocation = ShouldShowToolBar;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Windows/VisualElementTracker.cs b/src/Controls/src/Core/Platform/Windows/VisualElementTracker.cs
new file mode 100644
index 000000000000..4bae91ec9bc0
--- /dev/null
+++ b/src/Controls/src/Core/Platform/Windows/VisualElementTracker.cs
@@ -0,0 +1,906 @@
+#nullable enable
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Linq;
+using System.Threading.Tasks;
+using Windows.ApplicationModel.DataTransfer;
+using Windows.Graphics.Imaging;
+using Windows.Storage.Streams;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Hosting;
+using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media;
+using Microsoft.UI.Xaml.Media.Imaging;
+using Microsoft.Maui.Controls.Internals;
+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.Platform
+{
+ // TODO MAUI: can we convert this over to using IView
+ public class VisualElementTracker : IDisposable where TElement : VisualElement where TNativeElement : FrameworkElement
+ {
+ readonly NotifyCollectionChangedEventHandler _collectionChangedHandler;
+ readonly List _fingers = new List();
+ FrameworkElement? _container;
+ TNativeElement? _control;
+ TElement? _element;
+
+ bool _invalidateArrangeNeeded = false;
+
+ bool _isDisposed = false;
+ bool _isPanning = false;
+ bool _isSwiping = false;
+ bool _isPinching = false;
+ bool _wasPanGestureStartedSent = false;
+ bool _wasPinchGestureStartedSent = false;
+ public event EventHandler? Updated;
+
+ static bool HasClip;
+
+ public VisualElementTracker()
+ {
+ _collectionChangedHandler = ModelGestureRecognizersOnCollectionChanged;
+ }
+
+ public FrameworkElement? Container
+ {
+ get { return _container; }
+ set
+ {
+ if (_container == value)
+ return;
+
+ ClearContainerEventHandlers();
+
+ _container = value;
+
+ UpdatingGestureRecognizers();
+
+ UpdateNativeControl();
+ }
+ }
+
+ public bool PreventGestureBubbling { get; set; }
+
+ public TNativeElement? Control
+ {
+ get { return _control; }
+ set
+ {
+ if (_control == value)
+ return;
+
+ if (_control != null)
+ {
+ _control.Tapped -= HandleTapped;
+ _control.DoubleTapped -= HandleDoubleTapped;
+ }
+
+ _control = value;
+ UpdateNativeControl();
+
+ if (PreventGestureBubbling)
+ {
+ UpdatingGestureRecognizers();
+ }
+ }
+ }
+
+ void SendEventArgs(Action func)
+ {
+ if (_container == null && _control == null)
+ return;
+
+ var view = Element as View;
+ var gestures =
+ view?
+ .GestureRecognizers?
+ .OfType();
+
+ if (gestures == null)
+ return;
+
+ foreach (var gesture in gestures)
+ {
+ func(gesture);
+ }
+ }
+
+ void HandleDragLeave(object sender, Microsoft.UI.Xaml.DragEventArgs e)
+ {
+ var package = e.DataView.Properties["_XFPropertes_DONTUSE"] as DataPackage;
+ var dragEventArgs = new DragEventArgs(package);
+
+ dragEventArgs.AcceptedOperation = (DataPackageOperation)((int)dragEventArgs.AcceptedOperation);
+ SendEventArgs(rec =>
+ {
+ if (!rec.AllowDrop)
+ {
+ return;
+ }
+
+ var operationPriorToSend = dragEventArgs.AcceptedOperation;
+ rec.SendDragLeave(dragEventArgs);
+
+ // If you set the AcceptedOperation to a value it was already set to
+ // it causes the related animation to remain visible when the dragging component leaves
+ // for example
+ // e.AcceptedOperation = Windows.ApplicationModel.DataTransfer.DataPackageOperation.Copy;
+ // Even if AcceptedOperation is already set to Copy it will cause the copy animation
+ // to remain even after the the dragged element has left
+ if (operationPriorToSend != dragEventArgs.AcceptedOperation)
+ {
+ var result = (int)dragEventArgs.AcceptedOperation;
+ e.AcceptedOperation = (Windows.ApplicationModel.DataTransfer.DataPackageOperation)result;
+ }
+ });
+ }
+
+ void HandleDragOver(object sender, Microsoft.UI.Xaml.DragEventArgs e)
+ {
+ var package = e.DataView.Properties["_XFPropertes_DONTUSE"] as DataPackage;
+ var dragEventArgs = new DragEventArgs(package);
+
+ SendEventArgs(rec =>
+ {
+ if(!rec.AllowDrop)
+ {
+ e.AcceptedOperation = Windows.ApplicationModel.DataTransfer.DataPackageOperation.None;
+ return;
+ }
+
+ rec.SendDragOver(dragEventArgs);
+ var result = (int)dragEventArgs.AcceptedOperation;
+ e.AcceptedOperation = (Windows.ApplicationModel.DataTransfer.DataPackageOperation)result;
+ });
+ }
+
+ void HandleDropCompleted(UIElement sender, Microsoft.UI.Xaml.DropCompletedEventArgs e)
+ {
+ var args = new DropCompletedEventArgs();
+ SendEventArgs(rec => rec.SendDropCompleted(args));
+ }
+
+ void HandleDrop(object sender, Microsoft.UI.Xaml.DragEventArgs e)
+ {
+ var datapackage = e.DataView.Properties["_XFPropertes_DONTUSE"] as DataPackage;
+
+ var args = new DropEventArgs(datapackage?.View);
+ SendEventArgs(async rec =>
+ {
+ if (!rec.AllowDrop)
+ return;
+
+ try
+ {
+ await rec.SendDrop(args);
+ }
+ catch (Exception dropExc)
+ {
+ Internals.Log.Warning(nameof(DropGestureRecognizer), $"{dropExc}");
+ }
+ });
+ }
+
+ void HandleDragStarting(UIElement sender, Microsoft.UI.Xaml.DragStartingEventArgs e)
+ {
+ SendEventArgs(rec =>
+ {
+ if (!rec.CanDrag)
+ {
+ e.Cancel = true;
+ return;
+ }
+
+ var renderer = sender as IViewHandler;
+ var args = rec.SendDragStarting(renderer?.VirtualView);
+ e.Data.Properties["_XFPropertes_DONTUSE"] = args.Data;
+
+ if (!args.Handled && renderer != null)
+ {
+ if (renderer.NativeView is Microsoft.UI.Xaml.Controls.Image nativeImage &&
+ nativeImage.Source is BitmapImage bi && bi.UriSource != null)
+ {
+ e.Data.SetBitmap(RandomAccessStreamReference.CreateFromUri(bi.UriSource));
+ }
+ else if(!String.IsNullOrWhiteSpace(args.Data.Text))
+ {
+ Uri? uri;
+ if (Uri.TryCreate(args.Data.Text, UriKind.Absolute, out uri))
+ {
+ if (args.Data.Text.StartsWith("http", StringComparison.OrdinalIgnoreCase))
+ e.Data.SetWebLink(uri);
+ else
+ e.Data.SetApplicationLink(uri);
+ }
+ else
+ {
+ e.Data.SetText(args.Data.Text);
+ }
+ }
+ }
+
+ e.Cancel = args.Cancel;
+ e.AllowedOperations = Windows.ApplicationModel.DataTransfer.DataPackageOperation.Copy;
+ });
+ }
+
+ public TElement? Element
+ {
+ get { return _element; }
+ set
+ {
+ if (_element == value)
+ return;
+
+ if (_element != null)
+ {
+ _element.BatchCommitted -= OnRedrawNeeded;
+ _element.PropertyChanged -= OnPropertyChanged;
+
+ var view = _element as View;
+ if (view != null)
+ {
+ var oldRecognizers = (ObservableCollection)view.GestureRecognizers;
+ oldRecognizers.CollectionChanged -= _collectionChangedHandler;
+ var gestures = (view as IGestureController)?.CompositeGestureRecognizers as ObservableCollection;
+
+ if(gestures != null)
+ gestures.CollectionChanged -= _collectionChangedHandler;
+ }
+ }
+
+ _element = value;
+
+ if (_element != null)
+ {
+ _element.BatchCommitted += OnRedrawNeeded;
+ _element.PropertyChanged += OnPropertyChanged;
+
+ var view = _element as View;
+ if (view != null)
+ {
+ var newRecognizers = (ObservableCollection)view.GestureRecognizers;
+ newRecognizers.CollectionChanged += _collectionChangedHandler;
+
+ var gestures = (view as IGestureController)?.CompositeGestureRecognizers as ObservableCollection;
+ if (gestures != null)
+ gestures.CollectionChanged += _collectionChangedHandler;
+ }
+ }
+
+ UpdateNativeControl();
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ void ClearContainerEventHandlers()
+ {
+ if (_container != null)
+ {
+ _container.DragStarting -= HandleDragStarting;
+ _container.DropCompleted -= HandleDropCompleted;
+ _container.DragOver -= HandleDragOver;
+ _container.Drop -= HandleDrop;
+ _container.Tapped -= OnTap;
+ _container.DoubleTapped -= OnDoubleTap;
+ _container.ManipulationDelta -= OnManipulationDelta;
+ _container.ManipulationStarted -= OnManipulationStarted;
+ _container.ManipulationCompleted -= OnManipulationCompleted;
+ _container.PointerPressed -= OnPointerPressed;
+ _container.PointerExited -= OnPointerExited;
+ _container.PointerReleased -= OnPointerReleased;
+ _container.PointerCanceled -= OnPointerCanceled;
+ }
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_isDisposed)
+ return;
+
+ _isDisposed = true;
+
+ if (!disposing)
+ return;
+
+ ClearContainerEventHandlers();
+
+ if (_element != null)
+ {
+ _element.BatchCommitted -= OnRedrawNeeded;
+ _element.PropertyChanged -= OnPropertyChanged;
+
+ var view = _element as View;
+ if (view != null)
+ {
+ var oldRecognizers = (ObservableCollection)view.GestureRecognizers;
+ oldRecognizers.CollectionChanged -= _collectionChangedHandler;
+ }
+ }
+
+ if (_control != null)
+ {
+ _control.Tapped -= HandleTapped;
+ _control.DoubleTapped -= HandleDoubleTapped;
+ }
+
+ Control = null;
+ Element = null;
+ Container = null;
+ }
+
+ protected virtual void OnPropertyChanged(object? sender, PropertyChangedEventArgs e)
+ {
+ if (Element == null)
+ return;
+
+ if (Element.Batched)
+ {
+ if (e.PropertyName == VisualElement.XProperty.PropertyName || e.PropertyName == VisualElement.YProperty.PropertyName || e.PropertyName == VisualElement.WidthProperty.PropertyName ||
+ e.PropertyName == VisualElement.HeightProperty.PropertyName)
+ {
+ _invalidateArrangeNeeded = true;
+ }
+ return;
+ }
+
+ if (Container == null)
+ return;
+
+ if (e.PropertyName == VisualElement.XProperty.PropertyName || e.PropertyName == VisualElement.YProperty.PropertyName || e.PropertyName == VisualElement.WidthProperty.PropertyName ||
+ e.PropertyName == VisualElement.HeightProperty.PropertyName)
+ {
+ MaybeInvalidate();
+ }
+
+
+ if (e.PropertyName == VisualElement.AnchorXProperty.PropertyName || e.PropertyName == VisualElement.AnchorYProperty.PropertyName)
+ {
+ UpdateScaleAndRotation(Element, Container);
+ }
+ else if (e.PropertyName == VisualElement.ScaleProperty.PropertyName || e.PropertyName == VisualElement.ScaleXProperty.PropertyName || e.PropertyName == VisualElement.ScaleYProperty.PropertyName)
+ {
+ UpdateScaleAndRotation(Element, Container);
+ }
+ else if (e.PropertyName == VisualElement.TranslationXProperty.PropertyName || e.PropertyName == VisualElement.TranslationYProperty.PropertyName ||
+ e.PropertyName == VisualElement.RotationProperty.PropertyName || e.PropertyName == VisualElement.RotationXProperty.PropertyName || e.PropertyName == VisualElement.RotationYProperty.PropertyName)
+ {
+ UpdateRotation(Element, Container);
+ }
+ else if (e.PropertyName == VisualElement.IsVisibleProperty.PropertyName)
+ {
+ UpdateVisibility(Element, Container);
+ }
+ else if (e.PropertyName == VisualElement.OpacityProperty.PropertyName)
+ {
+ UpdateOpacity(Element, Container);
+ }
+ else if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
+ {
+ UpdateInputTransparent(Element, Container);
+ }
+ else if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
+ {
+ UpdateInputTransparent(Element, Container);
+ }
+ else if (e.PropertyName == VisualElement.ClipProperty.PropertyName)
+ {
+ UpdateClip(Element, Container);
+ }
+ }
+
+ protected virtual void UpdateNativeControl()
+ {
+ if (Element == null || Container == null)
+ return;
+
+ UpdateVisibility(Element, Container);
+ UpdateOpacity(Element, Container);
+ UpdateScaleAndRotation(Element, Container);
+ UpdateInputTransparent(Element, Container);
+ UpdateClip(Element, Container);
+
+ if (_invalidateArrangeNeeded)
+ {
+ MaybeInvalidate();
+ }
+ _invalidateArrangeNeeded = false;
+
+ OnUpdated();
+ }
+
+ void HandleSwipe(ManipulationDeltaRoutedEventArgs e, View view)
+ {
+ if (_fingers.Count > 1 || view == null)
+ return;
+
+ _isSwiping = true;
+
+ foreach (SwipeGestureRecognizer recognizer in view.GestureRecognizers.GetGesturesFor())
+ {
+ ((ISwipeGestureController)recognizer).SendSwipe(view, e.Delta.Translation.X + e.Cumulative.Translation.X, e.Delta.Translation.Y + e.Cumulative.Translation.Y);
+ }
+ }
+
+ void HandlePan(ManipulationDeltaRoutedEventArgs e, View view)
+ {
+ if (view == null)
+ return;
+
+ _isPanning = true;
+
+ foreach (PanGestureRecognizer recognizer in view.GestureRecognizers.GetGesturesFor().Where(g => g.TouchPoints == _fingers.Count))
+ {
+ if (!_wasPanGestureStartedSent)
+ {
+ recognizer.SendPanStarted(view, Application.Current.PanGestureId);
+ }
+ recognizer.SendPan(view, e.Delta.Translation.X + e.Cumulative.Translation.X, e.Delta.Translation.Y + e.Cumulative.Translation.Y, Application.Current.PanGestureId);
+ }
+ _wasPanGestureStartedSent = true;
+ }
+
+ void HandlePinch(ManipulationDeltaRoutedEventArgs e, View view)
+ {
+ if (_fingers.Count < 2 || view == null)
+ return;
+
+ _isPinching = true;
+
+ Windows.Foundation.Point translationPoint = e.Container.TransformToVisual(Container).TransformPoint(e.Position);
+
+ var scaleOriginPoint = new Point(translationPoint.X / view.Width, translationPoint.Y / view.Height);
+ IEnumerable pinchGestures = view.GestureRecognizers.GetGesturesFor();
+ foreach (PinchGestureRecognizer recognizer in pinchGestures)
+ {
+ if (!_wasPinchGestureStartedSent)
+ {
+ recognizer.SendPinchStarted(view, scaleOriginPoint);
+ }
+ recognizer.SendPinch(view, e.Delta.Scale, scaleOriginPoint);
+ }
+ _wasPinchGestureStartedSent = true;
+ }
+
+ void MaybeInvalidate()
+ {
+ if (Element?.IsInNativeLayout == true)
+ return;
+
+ var parent = (FrameworkElement?)Container?.Parent;
+ parent?.InvalidateMeasure();
+ Container?.InvalidateMeasure();
+ }
+
+ void ModelGestureRecognizersOnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
+ {
+ UpdatingGestureRecognizers();
+ }
+
+ void OnDoubleTap(object sender, DoubleTappedRoutedEventArgs e)
+ {
+ var view = Element as View;
+ if (view == null)
+ return;
+
+ var tapPosition = e.GetPosition(Control);
+ var children = (view as IGestureController)?.GetChildElements(new Point(tapPosition.X, tapPosition.Y));
+
+ if (children != null)
+ foreach (var recognizer in children.GetChildGesturesFor(g => g.NumberOfTapsRequired == 1 || g.NumberOfTapsRequired == 2))
+ {
+ recognizer.SendTapped(view);
+ e.Handled = true;
+ }
+
+ if (e.Handled)
+ return;
+
+ IEnumerable doubleTapGestures = view.GestureRecognizers.GetGesturesFor(g => g.NumberOfTapsRequired == 1 || g.NumberOfTapsRequired == 2);
+ foreach (TapGestureRecognizer recognizer in doubleTapGestures)
+ {
+ recognizer.SendTapped(view);
+ e.Handled = true;
+ }
+ }
+
+ void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
+ {
+ SwipeComplete(true);
+ PinchComplete(true);
+ PanComplete(true);
+ }
+
+ void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
+ {
+ var view = Element as View;
+ if (view == null)
+ return;
+ HandleSwipe(e, view);
+ HandlePinch(e, view);
+ HandlePan(e, view);
+ }
+
+ void OnManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
+ {
+ var view = Element as View;
+ if (view == null)
+ return;
+ _wasPinchGestureStartedSent = false;
+ _wasPanGestureStartedSent = false;
+ }
+
+ void OnPointerCanceled(object sender, PointerRoutedEventArgs e)
+ {
+ uint id = e.Pointer.PointerId;
+ if (_fingers.Contains(id))
+ _fingers.Remove(id);
+ SwipeComplete(false);
+ PinchComplete(false);
+ PanComplete(false);
+ }
+
+ void OnPointerExited(object sender, PointerRoutedEventArgs e)
+ {
+ uint id = e.Pointer.PointerId;
+ if (_fingers.Contains(id))
+ _fingers.Remove(id);
+ SwipeComplete(true);
+ PinchComplete(true);
+ PanComplete(true);
+ }
+
+ void OnPointerPressed(object sender, PointerRoutedEventArgs e)
+ {
+ uint id = e.Pointer.PointerId;
+ if (!_fingers.Contains(id))
+ _fingers.Add(id);
+ }
+
+ void OnPointerReleased(object? sender, PointerRoutedEventArgs e)
+ {
+ uint id = e.Pointer.PointerId;
+ if (_fingers.Contains(id))
+ _fingers.Remove(id);
+ SwipeComplete(true);
+ PinchComplete(true);
+ PanComplete(true);
+ }
+
+ void OnRedrawNeeded(object? sender, EventArgs e)
+ {
+ UpdateNativeControl();
+ }
+
+ void OnTap(object? sender, TappedRoutedEventArgs e)
+ {
+ var view = Element as View;
+ if (view == null)
+ return;
+
+ var tapPosition = e.GetPosition(Control);
+ var children = (view as IGestureController)?.GetChildElements(new Point(tapPosition.X, tapPosition.Y));
+
+ if (children != null)
+ foreach (var recognizer in children.GetChildGesturesFor(g => g.NumberOfTapsRequired == 1))
+ {
+ recognizer.SendTapped(view);
+ e.Handled = true;
+ }
+
+ if (e.Handled)
+ return;
+
+ IEnumerable tapGestures = view.GestureRecognizers.GetGesturesFor(g => g.NumberOfTapsRequired == 1);
+ foreach (var recognizer in tapGestures)
+ {
+ recognizer.SendTapped(view);
+ e.Handled = true;
+ }
+ }
+
+ void SwipeComplete(bool success)
+ {
+ var view = Element as View;
+ if (view == null || !_isSwiping)
+ return;
+
+ if (success)
+ {
+ foreach (SwipeGestureRecognizer recognizer in view.GestureRecognizers.GetGesturesFor())
+ {
+ ((ISwipeGestureController)recognizer).DetectSwipe(view, recognizer.Direction);
+ }
+ }
+
+ _isSwiping = false;
+ }
+
+ void OnUpdated()
+ {
+ if (Updated != null)
+ Updated(this, EventArgs.Empty);
+ }
+
+ void PanComplete(bool success)
+ {
+ var view = Element as View;
+ if (view == null || !_isPanning)
+ return;
+
+ foreach (PanGestureRecognizer recognizer in view.GestureRecognizers.GetGesturesFor().Where(g => g.TouchPoints == _fingers.Count))
+ {
+ if (success)
+ {
+ recognizer.SendPanCompleted(view, Application.Current.PanGestureId);
+ }
+ else
+ {
+ recognizer.SendPanCanceled(view, Application.Current.PanGestureId);
+ }
+ }
+
+ Application.Current.PanGestureId++;
+ _isPanning = false;
+ }
+
+ void PinchComplete(bool success)
+ {
+ var view = Element as View;
+ if (view == null || !_isPinching)
+ return;
+
+ IEnumerable pinchGestures = view.GestureRecognizers.GetGesturesFor();
+ foreach (PinchGestureRecognizer recognizer in pinchGestures)
+ {
+ if (success)
+ {
+ recognizer.SendPinchEnded(view);
+ }
+ else
+ {
+ recognizer.SendPinchCanceled(view);
+ }
+ }
+
+ _isPinching = false;
+ }
+
+ static void UpdateInputTransparent(VisualElement view, FrameworkElement frameworkElement)
+ {
+ if (view is Layout)
+ {
+ // Let VisualElementRenderer handle this
+ }
+
+ frameworkElement.IsHitTestVisible = view.IsEnabled && !view.InputTransparent;
+ }
+
+ static void UpdateClip(VisualElement view, FrameworkElement frameworkElement)
+ {
+ if (!ShouldUpdateClip(view, frameworkElement))
+ return;
+
+ var geometry = view.Clip;
+
+ HasClip = geometry != null;
+
+ if (CompositionHelper.IsCompositionGeometryTypePresent)
+ frameworkElement.ClipVisual(geometry);
+ else
+ frameworkElement.Clip(geometry);
+ }
+
+ static bool ShouldUpdateClip(VisualElement view, FrameworkElement frameworkElement)
+ {
+ if (view == null || frameworkElement == null)
+ return false;
+
+ var formsGeometry = view.Clip;
+
+ if (formsGeometry != null)
+ return true;
+
+ if (formsGeometry == null && HasClip)
+ return true;
+
+ return false;
+ }
+
+ static void UpdateOpacity(VisualElement view, FrameworkElement frameworkElement)
+ {
+ frameworkElement.Opacity = view.Opacity;
+ }
+
+ static void UpdateRotation(VisualElement view, FrameworkElement frameworkElement)
+ {
+ double anchorX = view.AnchorX;
+ double anchorY = view.AnchorY;
+ double rotationX = view.RotationX;
+ double rotationY = view.RotationY;
+ double rotation = view.Rotation;
+ double translationX = view.TranslationX;
+ double translationY = view.TranslationY;
+ double scaleX = view.Scale * view.ScaleX;
+ double scaleY = view.Scale * view.ScaleY;
+
+ if (rotationX % 360 == 0 && rotationY % 360 == 0 && rotation % 360 == 0 && translationX == 0 && translationY == 0 && scaleX == 1 && scaleY == 1)
+ {
+ frameworkElement.Projection = null;
+ frameworkElement.RenderTransform = null;
+ }
+ else
+ {
+ // PlaneProjection removes touch and scrollwheel functionality on scrollable views such
+ // as ScrollView, ListView, and TableView. If neither RotationX or RotationY are set
+ // (i.e. their absolute value is 0), a CompositeTransform is instead used to allow for
+ // rotation of the control on a 2D plane, and the other values are set. Otherwise, the
+ // rotation values are set, but the aforementioned functionality will be lost.
+ if (Math.Abs(view.RotationX) != 0 || Math.Abs(view.RotationY) != 0)
+ {
+ frameworkElement.Projection = new PlaneProjection
+ {
+ CenterOfRotationX = anchorX,
+ CenterOfRotationY = anchorY,
+ GlobalOffsetX = translationX,
+ GlobalOffsetY = translationY,
+ RotationX = -rotationX,
+ RotationY = -rotationY,
+ RotationZ = -rotation
+ };
+ }
+ else
+ {
+ frameworkElement.RenderTransform = new WCompositeTransform
+ {
+ CenterX = anchorX,
+ CenterY = anchorY,
+ Rotation = rotation,
+ ScaleX = scaleX,
+ ScaleY = scaleY,
+ TranslateX = translationX,
+ TranslateY = translationY
+ };
+ }
+ }
+ }
+
+ static void UpdateScaleAndRotation(VisualElement view, FrameworkElement frameworkElement)
+ {
+ double anchorX = view.AnchorX;
+ double anchorY = view.AnchorY;
+ frameworkElement.RenderTransformOrigin = new Windows.Foundation.Point(anchorX, anchorY);
+ frameworkElement.RenderTransform = new WScaleTransform { ScaleX = view.Scale * view.ScaleX, ScaleY = view.Scale * view.ScaleY };
+
+ UpdateRotation(view, frameworkElement);
+ }
+
+ static void UpdateVisibility(VisualElement view, FrameworkElement frameworkElement)
+ {
+ frameworkElement.Visibility = view.IsVisible ? WVisibility.Visible : WVisibility.Collapsed;
+ }
+
+ void UpdateDragAndDropGestureRecognizers()
+ {
+ if (_container == null)
+ return;
+
+ var view = Element as View;
+ IList? gestures = view?.GestureRecognizers;
+
+ if (gestures == null)
+ return;
+
+ _container.CanDrag = gestures.GetGesturesFor()
+ .FirstOrDefault()?.CanDrag ?? false;
+
+ _container.AllowDrop = gestures.GetGesturesFor()
+ .FirstOrDefault()?.AllowDrop ?? false;
+
+ if (_container.CanDrag)
+ {
+ _container.DragStarting += HandleDragStarting;
+ _container.DropCompleted += HandleDropCompleted;
+ }
+
+ if(_container.AllowDrop)
+ {
+ _container.DragOver += HandleDragOver;
+ _container.Drop += HandleDrop;
+ _container.DragLeave += HandleDragLeave;
+ }
+ }
+
+ void UpdatingGestureRecognizers()
+ {
+ var view = Element as View;
+ IList? gestures = view?.GestureRecognizers;
+
+ if (_container == null || gestures == null)
+ return;
+
+ ClearContainerEventHandlers();
+ UpdateDragAndDropGestureRecognizers();
+
+ var children = (view as IGestureController)?.GetChildElements(Point.Zero);
+ IList? childGestures = children?.GetChildGesturesFor().ToList();
+
+ if (gestures.GetGesturesFor(g => g.NumberOfTapsRequired == 1).Any()
+ || children?.GetChildGesturesFor(g => g.NumberOfTapsRequired == 1).Any() == true)
+ {
+ _container.Tapped += OnTap;
+ }
+ else
+ {
+ if (_control != null && PreventGestureBubbling)
+ {
+ _control.Tapped += HandleTapped;
+ }
+ }
+
+ if (gestures.GetGesturesFor(g => g.NumberOfTapsRequired == 1 || g.NumberOfTapsRequired == 2).Any()
+ || children?.GetChildGesturesFor(g => g.NumberOfTapsRequired == 1 || g.NumberOfTapsRequired == 2).Any() == true)
+ {
+ _container.DoubleTapped += OnDoubleTap;
+ }
+ else
+ {
+ if (_control != null && PreventGestureBubbling)
+ {
+ _control.DoubleTapped += HandleDoubleTapped;
+ }
+ }
+
+ bool hasSwipeGesture = gestures.GetGesturesFor().GetEnumerator().MoveNext();
+ bool hasPinchGesture = gestures.GetGesturesFor().GetEnumerator().MoveNext();
+ bool hasPanGesture = gestures.GetGesturesFor().GetEnumerator().MoveNext();
+ if (!hasSwipeGesture && !hasPinchGesture && !hasPanGesture)
+ return;
+
+ //We can't handle ManipulationMode.Scale and System , so we don't support pinch/pan on a scrollview
+ if (Element is ScrollView)
+ {
+ if (hasPinchGesture)
+ Log.Warning("Gestures", "PinchGestureRecognizer is not supported on a ScrollView in Windows Platforms");
+ if (hasPanGesture)
+ Log.Warning("Gestures", "PanGestureRecognizer is not supported on a ScrollView in Windows Platforms");
+ if (hasSwipeGesture)
+ Log.Warning("Gestures", "SwipeGestureRecognizer is not supported on a ScrollView in Windows Platforms");
+ return;
+ }
+
+ _container.ManipulationMode = ManipulationModes.Scale | ManipulationModes.TranslateX | ManipulationModes.TranslateY;
+ _container.ManipulationDelta += OnManipulationDelta;
+ _container.ManipulationStarted += OnManipulationStarted;
+ _container.ManipulationCompleted += OnManipulationCompleted;
+ _container.PointerPressed += OnPointerPressed;
+ _container.PointerExited += OnPointerExited;
+ _container.PointerReleased += OnPointerReleased;
+ _container.PointerCanceled += OnPointerCanceled;
+ }
+
+ void HandleTapped(object sender, TappedRoutedEventArgs tappedRoutedEventArgs)
+ {
+ tappedRoutedEventArgs.Handled = true;
+ }
+
+ void HandleDoubleTapped(object sender, DoubleTappedRoutedEventArgs doubleTappedRoutedEventArgs)
+ {
+ doubleTappedRoutedEventArgs.Handled = true;
+ }
+ }
+}
diff --git a/src/Controls/src/Core/Platform/iOS/ControlsNavigationController.cs b/src/Controls/src/Core/Platform/iOS/ControlsNavigationController.cs
new file mode 100644
index 000000000000..bd78fa299ad5
--- /dev/null
+++ b/src/Controls/src/Core/Platform/iOS/ControlsNavigationController.cs
@@ -0,0 +1,249 @@
+//#nullable enable
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Foundation;
+using Microsoft.Maui.Controls.Handlers;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Handlers;
+using ObjCRuntime;
+using UIKit;
+
+namespace Microsoft.Maui.Controls.Platform
+{
+ public class ControlsNavigationController : UINavigationController
+ {
+ readonly NavigationPageHandler _handler;
+ Dictionary> _completionTasks =
+ new Dictionary>();
+ TaskCompletionSource _popCompletionTask;
+
+ // This holds the view controllers for each page
+ readonly Dictionary _trackers =
+ new Dictionary();
+
+ IReadOnlyList NavigationStack => _handler.VirtualView.Navigation.NavigationStack;
+
+ public ControlsNavigationController(NavigationPageHandler handler) : base()
+ {
+ Delegate = new NavDelegate(this);
+ _handler = handler;
+ }
+
+ public ControlsNavigationController(NavigationPageHandler handler, Type navigationBarType, Type toolbarType)
+ : base(navigationBarType, toolbarType)
+ {
+ Delegate = new NavDelegate(this);
+ _handler = handler;
+ }
+
+ [Export("navigationBar:shouldPopItem:")]
+ [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)]
+ 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;
+
+ //foreach (var tracker in _trackers)
+ //{
+ // if (tracker.Value.ViewController == TopViewController)
+ // {
+ // var behavior = Shell.GetBackButtonBehavior(tracker.Value.Page);
+ // var command = behavior.GetPropertyIfSet(BackButtonBehavior.CommandProperty, null);
+ // var commandParameter = behavior.GetPropertyIfSet