diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index e8b8ab2c7f52..5278f6232bd1 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
- "version": "1.0.0-prerelease.22270.1",
+ "version": "1.0.0-prerelease.22358.1",
"commands": [
"xharness"
]
diff --git a/.github/DEVELOPMENT.md b/.github/DEVELOPMENT.md
index c057ddcc4220..3518bbd871c9 100644
--- a/.github/DEVELOPMENT.md
+++ b/.github/DEVELOPMENT.md
@@ -121,6 +121,13 @@ dotnet tool restore
dotnet cake --target=VS-NET6
```
+You can also run:
+
+```dotnetcli
+dotnet tool restore
+dotnet cake --target=VS
+```
+
_NOTES:_
- _If the IDE doesn't show any Android devices try unloading and reloading the `Sample.Droid-net6` project._
@@ -135,7 +142,7 @@ dotnet build src\DotNet\DotNet.csproj
# Builds the rest of Maui
.\bin\dotnet\dotnet build Microsoft.Maui.sln
# (Windows-only) to launch Visual Studio
-dotnet cake --target=VS-DOGFOOD
+dotnet cake --target=VS
```
To build & run .NET 6 sample apps, you will also need to use `.\bin\dotnet\dotnet` or just `dotnet` if you've
@@ -208,6 +215,76 @@ public static int foo = 2130771968;
5. Restore the commented code in `Directory.Build.targets`.
+## What branch should I use?
+
+- net7.0
+ - I want to use the net7.0 sdk and make changes that will be released with the .NET 7 release of MAUI
+- net6.0
+ - This PR seems like it should go out with a net6.0 service release
+- main (start here if you don't know what to use)
+ - I want to use the net6.0 sdk and make changes that will be released with the .NET 7 release of MAUI
+
+## Repository projects
+
+### Samples
+ ```
+├── Controls
+│ ├── samples
+│ │ ├── Maui.Controls.Sample
+│ │ ├── Maui.Controls.Sample.Sandbox
+├── Essentials
+│ ├── samples
+│ │ ├── Essentials.Sample
+├── BlazorWebView
+│ ├── samples
+│ │ ├── BlazorWinFormsApp
+│ │ ├── BlazorWpfApp
+```
+
+- *Maui.Controls.Sample*: Full gallery sample with all of the controls and features of .NET MAUI
+- *Maui.Controls.Sample.Sandbox*: Empty project useful for testing reproductions or use cases
+- *Essentials.Sample*: Full gallery demonstrating the library previously known as essentials. These are all the non UI related MAUI APIs.
+
+### Device Test Projects
+
+These are tests that will run on an actual device
+
+ ```
+├── Controls
+│ ├── test
+│ │ ├── Controls.DeviceTests
+├── Core
+│ ├── test
+│ │ ├── Core.DeviceTests
+├── Essentials
+│ ├── test
+│ │ ├── Essentials.DeviceTests
+├── BlazorWebView
+│ ├── test
+│ │ ├── MauiBlazorWebView.DeviceTests
+```
+
+- *Controls.DeviceTests*: .NET MAUI Controls Visual Runner for running device based xunit tests. This is useful for tests that require XAML features
+- *Core.DeviceTests*: .NET MAUI Core Visual Runner for running device based xunit tests. This is for tests that don't require any MAUI Controls based features
+- *Essentials.DeviceTests*: Visual Runner running all the .NET MAUI essentials xunit tests.
+- *MauiBlazorWebView.DeviceTests*: Visual Runner for BlazorWebView tests.
+
+### Unit Test Projects
+
+These are tests that will not run on a device. This is useful for testing device independent logic.
+
+ ```
+├── Controls
+│ ├── test
+│ │ ├── Controls.Core.UnitTests
+├── Core
+│ ├── test
+│ │ ├── Core.UnitTests
+├── Essentials
+│ ├── test
+│ │ ├── Essentials.UnitTests
+```
+
## Stats
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
index dfbe0d8b1657..0e0afeff3c2c 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -34,11 +34,10 @@ body:
label: Version with bug
description: In what version do you see this issue?
options:
- - Preview 13
- - Preview 14
- - Release Candidate 1
- - Release Candidate 2
- - Release Candidate 3 (current)
+ - 6.0 Release Candidate 1 or older
+ - 6.0 Release Candidate 2
+ - 6.0 Release Candidate 3
+ - 6.0 (current)
- Unknown/Other (please specify)
validations:
required: true
diff --git a/.github/workflows/dotnet-format-daily.yml b/.github/workflows/dotnet-format-daily.yml
index a87cb9bd77f1..a9a6685bb384 100644
--- a/.github/workflows/dotnet-format-daily.yml
+++ b/.github/workflows/dotnet-format-daily.yml
@@ -1,5 +1,6 @@
name: Daily code format check
on:
+ workflow_dispatch:
schedule:
- cron: 0 0 * * * # Every day at midnight (UTC)
@@ -11,22 +12,13 @@ jobs:
dotnet-format:
runs-on: windows-latest
steps:
- - name: Install dotnet-format
- run: dotnet tool install -g dotnet-format
-
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Run dotnet format
- id: format
- uses: jfversluis/dotnet-format@v1.0.5
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- action: "fix"
- #only-changed-files: true # only works for PRs
- workspace: "Microsoft.Maui.sln"
+ run: dotnet format whitespace ./src --folder
- name: Commit files
if: steps.format.outputs.has-changes == 'true'
diff --git a/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets b/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets
index 4a61874b157e..bfa81e0fadab 100644
--- a/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets
+++ b/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets
@@ -69,7 +69,7 @@
-
+
Platform\Windows\
@@ -96,38 +96,22 @@
$(DefineConstants);IOS
+
$(DefineConstants);MACCATALYST;IOS
-
+
$(DefineConstants);TIZEN
-
-
-
-
-
-
-
-
-
-
+
WINDOWS;$(DefineConstants)
WINDOWS_UWP;$(DefineConstants)
-
-
-
-
-
-
-
-
-
+
diff --git a/.nuspec/Microsoft.Maui.Controls.SingleProject.props b/.nuspec/Microsoft.Maui.Controls.SingleProject.props
index 5c9e1e424f02..64a7144978c8 100644
--- a/.nuspec/Microsoft.Maui.Controls.SingleProject.props
+++ b/.nuspec/Microsoft.Maui.Controls.SingleProject.props
@@ -2,10 +2,11 @@
WinExe
- MSIX
- false
+ MSIX
+ true
+ false
true
- <_SingleProjectRIDRequired Condition="'$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe'">true
+ <_SingleProjectRIDRequired Condition="'$(OutputType)' == 'WinExe'">true
<_SingleProjectRIDSpecified Condition="'$(RuntimeIdentifier)' != '' or '$(RuntimeIdentifiers)' != ''">true
diff --git a/.nuspec/Microsoft.Maui.Controls.SingleProject.targets b/.nuspec/Microsoft.Maui.Controls.SingleProject.targets
index 350d7877cec1..15f98664a1a3 100644
--- a/.nuspec/Microsoft.Maui.Controls.SingleProject.targets
+++ b/.nuspec/Microsoft.Maui.Controls.SingleProject.targets
@@ -140,6 +140,7 @@
Condition="'$(WindowsPackageType)' == 'None' and '@(AppxManifest)' != ''">
+ <_MauiAppxManifest Include="@(AppxManifest)" />
diff --git a/.nuspec/Microsoft.Maui.Resizetizer.targets b/.nuspec/Microsoft.Maui.Resizetizer.targets
index 9de479025ec2..603fa1c19e38 100644
--- a/.nuspec/Microsoft.Maui.Resizetizer.targets
+++ b/.nuspec/Microsoft.Maui.Resizetizer.targets
@@ -84,9 +84,7 @@
False
- <_ResizetizerDefaultInvalidFilenamesErrorMessage>
- One or more invalid file names were detected. File names must be lowercase, start and end with a letter character, and contain only alphanumeric characters or underscores:
-
+ <_ResizetizerDefaultInvalidFilenamesErrorMessage>One or more invalid file names were detected. File names must be lowercase, start and end with a letter character, and contain only alphanumeric characters or underscores:
@@ -306,7 +304,7 @@
@@ -636,12 +634,13 @@
on "_ValidatePresenceOfAppxManifestItems" and we need to get in before then. -->
+ DependsOnTargets="MauiGeneratePackageAppxManifest"
+ Condition="'$(_ResizetizerIsUWPApp)' == 'True' Or '$(_ResizetizerIsWindowsAppSdk)' == 'True'" />
@@ -651,7 +650,7 @@
-
+
+
+ <_MauiAppxManifest Remove="@(_MauiAppxManifest)" />
+ <_MauiAppxManifest Include="$(_MauiIntermediateManifest)Package.appxmanifest" />
+
+
+
+
+
+
+
+
+
+
+ <_MauiAppxManifestContents>$([System.IO.File]::ReadAllText('$(_MauiIntermediateManifest)Package.appxmanifest'))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_Parameter1>Microsoft.Maui.ApplicationModel.AppInfo.PackageName
+ <_Parameter2>@(_MauiAppxManifestIdentity)
+
+
+ <_Parameter1>Microsoft.Maui.ApplicationModel.AppInfo.PublisherName
+ <_Parameter2>@(_MauiAppxManifestPublisher)
+
+
+ <_Parameter1>Microsoft.Maui.ApplicationModel.AppInfo.Name
+ <_Parameter2>@(_MauiAppxManifestDisplayName)
+
+
+ <_Parameter1>Microsoft.Maui.ApplicationModel.AppInfo.Version
+ <_Parameter2>@(_MauiAppxManifestVersion)
+
+
+
diff --git a/Directory.Build.props b/Directory.Build.props
index 078ff0522111..96db69c03405 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -2,7 +2,9 @@
- <_MauiDotNetVersion Condition="'$(_MauiDotNetVersion)' == ''">6.0
+ <_MauiDotNetVersionMajor Condition="'$(_MauiDotNetVersionMajor)' == ''">6
+ <_MauiDotNetVersionMinor Condition="'$(_MauiDotNetVersionMinor)' == ''">0
+ <_MauiDotNetVersion Condition="'$(_MauiDotNetVersion)' == ''">$(_MauiDotNetVersionMajor).$(_MauiDotNetVersionMinor)
<_MauiDotNetTfm Condition="'$(_MauiDotNetTfm)' == ''">net$(_MauiDotNetVersion)
<_MauiTargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))
<_MauiNoTargetPlatform Condition="'$(_MauiTargetPlatformIdentifier)' == ''">True
@@ -14,7 +16,7 @@
<_MauiTargetPlatformIsWindows Condition="$(_MauiTargetPlatformIdentifier.Contains('windows')) == 'True'">True
<_MauiTargetPlatformIsTizen Condition="'$(_MauiTargetPlatformIdentifier)' == 'tizen'">True
- true
+ true
true
@@ -27,6 +29,7 @@
true
false
+ true
diff --git a/Directory.Build.targets b/Directory.Build.targets
index dc0e3527e735..34f4e5c3b0a5 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -64,7 +64,12 @@
-
+
+
+
+
diff --git a/GitInfo.txt b/GitInfo.txt
index 7839c8834842..4c2e8ca7b61f 100644
--- a/GitInfo.txt
+++ b/GitInfo.txt
@@ -1 +1 @@
-6.0.400-preview.1
+6.0.409
diff --git a/eng/AndroidX.targets b/eng/AndroidX.targets
index 9183678db956..8f49a697621f 100644
--- a/eng/AndroidX.targets
+++ b/eng/AndroidX.targets
@@ -54,7 +54,7 @@
/>
-
+
https://github.com/dotnet/installer
- 3fed194c0b277b0ac0986f92401a50dd6c34f43d
+ c671341ee86ecdafde8791709c37487e3e377ca8
-
+
https://github.com/dotnet/runtime
- a21b9a2dd4c31cf5bd37626562b7612faf21cee6
+ 705ec75fc00dc5d62ffeae1b6d5439fd14ada9b4
-
+
https://github.com/xamarin/xamarin-android
- 4c460a89cb070ee8dfd731842f36bc3dc68dc75c
+ d267a4f16d26dad98259a802fefb6bc12897ad68
-
+
https://github.com/xamarin/xamarin-macios
- ce10c913a2921673b0caedcd268778b46d52c392
+ 3c5ccbee4e53c331a4c534c18a7b7e006f0f668a
-
+
https://github.com/xamarin/xamarin-macios
- ce10c913a2921673b0caedcd268778b46d52c392
+ 3c5ccbee4e53c331a4c534c18a7b7e006f0f668a
-
+
https://github.com/xamarin/xamarin-macios
- ce10c913a2921673b0caedcd268778b46d52c392
+ 3c5ccbee4e53c331a4c534c18a7b7e006f0f668a
-
+
https://github.com/xamarin/xamarin-macios
- ce10c913a2921673b0caedcd268778b46d52c392
+ 3c5ccbee4e53c331a4c534c18a7b7e006f0f668a
https://github.com/dotnet/emsdk
@@ -35,57 +35,57 @@
https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionInternal
-
+
https://github.com/dotnet/aspnetcore
- 308378368c1182e98e7af93ed6e66c38f945837e
+ e8bba19667fae8b6f9cb154d2645d4550f235360
-
+
https://github.com/dotnet/aspnetcore
- 308378368c1182e98e7af93ed6e66c38f945837e
+ e8bba19667fae8b6f9cb154d2645d4550f235360
-
+
https://github.com/dotnet/aspnetcore
- 308378368c1182e98e7af93ed6e66c38f945837e
+ e8bba19667fae8b6f9cb154d2645d4550f235360
-
+
https://github.com/dotnet/aspnetcore
- 308378368c1182e98e7af93ed6e66c38f945837e
+ e8bba19667fae8b6f9cb154d2645d4550f235360
-
+
https://github.com/dotnet/aspnetcore
- 308378368c1182e98e7af93ed6e66c38f945837e
+ e8bba19667fae8b6f9cb154d2645d4550f235360
-
+
https://github.com/dotnet/aspnetcore
- 308378368c1182e98e7af93ed6e66c38f945837e
+ e8bba19667fae8b6f9cb154d2645d4550f235360
-
+
https://github.com/dotnet/aspnetcore
- 308378368c1182e98e7af93ed6e66c38f945837e
+ e8bba19667fae8b6f9cb154d2645d4550f235360
-
+
https://github.com/dotnet/aspnetcore
- 308378368c1182e98e7af93ed6e66c38f945837e
+ e8bba19667fae8b6f9cb154d2645d4550f235360
https://github.com/dotnet/templating
3f4da9ced34942d83054e647f3b1d9d7dde281e8
-
+
https://github.com/dotnet/Microsoft.Maui.Graphics
- e15f2d552d851c28771e7fe092895e908395f8a4
+ 691c654ff69df33f16f43b390ad6ef9b4ec03e6e
-
+
https://github.com/dotnet/xharness
- 9cacd2f874c946a6497110124a2369fb5131c68f
+ 8fda60c83422bbf6e31690c2d96ab8adb7e60c63
-
+
https://github.com/dotnet/xharness
- 9cacd2f874c946a6497110124a2369fb5131c68f
+ 8fda60c83422bbf6e31690c2d96ab8adb7e60c63
-
+
https://github.com/dotnet/xharness
- 9cacd2f874c946a6497110124a2369fb5131c68f
+ 8fda60c83422bbf6e31690c2d96ab8adb7e60c63
diff --git a/eng/Versions.props b/eng/Versions.props
index 43c203311a06..01ff4462bed3 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -1,42 +1,43 @@
- 6.0.301-rtm.22254.17
+ 6.0.400-preview.22356.7
- 6.0.5
+ 6.0.7
6.0.0
6.0.1
6.0.0
- 32.0.301
+ 32.0.443
- 15.4.303
- 15.4.303
- 12.3.303
- 15.4.303
- 7.0.303
+ 15.4.440
+ 15.4.440
+ 12.3.440
+ 15.4.440
+
+ 7.0.400-preview.1.0
6.0.4
$(MicrosoftNETWorkloadEmscriptenManifest60300PackageVersion)
- 1.0.3
+ 1.1.2
10.0.22000.194
1.0.3.1
- 6.0.5
- 6.0.5
- 6.0.5
- 6.0.5
- 6.0.5
- 6.0.5
- 6.0.5
- 6.0.5
+ 6.0.7
+ 6.0.7
+ 6.0.7
+ 6.0.7
+ 6.0.7
+ 6.0.7
+ 6.0.7
+ 6.0.7
- 7.0.0-preview1.22229.1
+ 7.0.0-preview1.22302.1
3.3.3
3.3.3
- 6.0.400-preview.1.1367
+ 6.0.403
4.5.0
<_MicrosoftWebWebView2Version>1.0.1210.39
@@ -54,9 +55,9 @@
<_HarfBuzzSharpVersion>2.8.2
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.2e12735359928ead60dd08cdf0b983c4e3d4dc56.268
7.0.100-preview.5.22226.1
- 1.0.0-prerelease.22270.1
- 1.0.0-prerelease.22270.1
- 1.0.0-prerelease.22270.1
+ 1.0.0-prerelease.22276.1
+ 1.0.0-prerelease.22276.1
+ 1.0.0-prerelease.22276.1
0.8.1
0.5.13
1.2.0
@@ -64,13 +65,12 @@
- 6.0.300
-
- $(DotNetVersionBand)
- $(DotNetVersionBand)
- $(DotNetVersionBand)
- $(DotNetVersionBand)
- $(DotNetVersionBand)
- $(DotNetVersionBand)
+ 6.0.400
+ 6.0.400
+ 6.0.300
+ 6.0.300
+ 6.0.400
+ 6.0.400
+ 6.0.400
diff --git a/eng/automation/SignList.xml b/eng/automation/SignList.xml
index 505864503fca..1b576315cf58 100644
--- a/eng/automation/SignList.xml
+++ b/eng/automation/SignList.xml
@@ -32,7 +32,6 @@
-
diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake
index 433bdf9b34b0..afb1a420c480 100644
--- a/eng/cake/dotnet.cake
+++ b/eng/cake/dotnet.cake
@@ -6,8 +6,15 @@ string configuration = GetBuildVariable("configuration", GetBuildVariable("BUILD
var localDotnet = GetBuildVariable("workloads", "local") == "local";
var vsVersion = GetBuildVariable("VS", "");
string MSBuildExe = Argument("msbuild", EnvironmentVariable("MSBUILD_EXE", ""));
+string TestTFM = Argument("testtfm", "");
+if (TestTFM == "default")
+ TestTFM = "";
+
Exception pendingException = null;
+var NuGetOnlyPackages = new string[] {
+};
+
// Tasks for CI
Task("dotnet")
@@ -82,9 +89,12 @@ Task("dotnet-build")
Task("dotnet-samples")
.Does(() =>
{
+ var tempDir = PrepareSeparateBuildContext("samplesTest", false);
+
RunMSBuildWithDotNet("./Microsoft.Maui.Samples.slnf", new Dictionary {
["UseWorkload"] = "true",
// ["GenerateAppxPackageOnBuild"] = "true",
+ ["RestoreConfigFile"] = tempDir.CombineWithFilePath("NuGet.config").FullPath,
});
});
@@ -96,15 +106,7 @@ Task("dotnet-templates")
var dn = localDotnet ? dotnetPath : "dotnet";
- var templatesTest = GetTempDirectory().Combine("templatesTest");
-
- EnsureDirectoryExists(templatesTest);
- CleanDirectories(templatesTest.FullPath);
-
- // Create empty Directory.Build.props/targets
- FileWriteText(templatesTest.CombineWithFilePath("Directory.Build.props"), "");
- FileWriteText(templatesTest.CombineWithFilePath("Directory.Build.targets"), "");
- CopyFileToDirectory(File("./NuGet.config"), templatesTest);
+ var tempDir = PrepareSeparateBuildContext("templatesTest", true);
// See: https://github.com/dotnet/project-system/blob/main/docs/design-time-builds.md
var designTime = new Dictionary {
@@ -120,8 +122,8 @@ Task("dotnet-templates")
// Properties that ensure we don't use cached packages, and *only* the empty NuGet.config
{ "RestoreNoCache", "true" },
// { "GenerateAppxPackageOnBuild", "true" },
- { "RestorePackagesPath", MakeAbsolute(templatesTest.CombineWithFilePath("packages")).FullPath },
- { "RestoreConfigFile", MakeAbsolute(templatesTest.CombineWithFilePath("nuget.config")).FullPath },
+ { "RestorePackagesPath", tempDir.Combine("packages").FullPath },
+ { "RestoreConfigFile", tempDir.CombineWithFilePath("NuGet.config").FullPath },
// Avoid iOS build warning as error on Windows: There is no available connection to the Mac. Task 'VerifyXcodeVersion' will not be executed
{ "CustomBeforeMicrosoftCSharpTargets", MakeAbsolute(File("./src/Templates/TemplateTestExtraTargets.targets")).FullPath },
@@ -136,6 +138,12 @@ Task("dotnet-templates")
ReplaceTextInFiles($"{dir}/*.csproj", "UseMaui", "UseMauiCore");
ReplaceTextInFiles($"{dir}/*.csproj", "SingleProject", "EnablePreviewMsixTooling");
} },
+ { "mauiunpackaged:maui", dir => {
+ ReplaceTextInFiles($"{dir}/*.csproj", "true", "trueNone");
+ } },
+ { "mauiblazorunpackaged:maui-blazor", dir => {
+ ReplaceTextInFiles($"{dir}/*.csproj", "true", "trueNone");
+ } },
};
var alsoPack = new [] {
@@ -154,10 +162,13 @@ Task("dotnet-templates")
var projectName = template.Key.Split(":")[0];
var templateName = template.Key.Split(":")[1];
- projectName = $"{templatesTest}/{projectName}_{type}";
+ var framework = string.IsNullOrWhiteSpace(TestTFM) ? "" : $"--framework {TestTFM}";
+
+ projectName = $"{tempDir}/{projectName}_{type}";
+ projectName += string.IsNullOrWhiteSpace(TestTFM) ? "" : $"_{TestTFM.Replace('.', '_')}";
// Create
- StartProcess(dn, $"new {templateName} -o \"{projectName}\"");
+ StartProcess(dn, $"new {templateName} -o \"{projectName}\" {framework}");
// Modify
if (template.Value != null)
@@ -165,8 +176,11 @@ Task("dotnet-templates")
// Enable Tizen
ReplaceTextInFiles($"{projectName}/*.csproj",
- "",
- "$(TargetFrameworks);net6.0-tizen");
+ "",
+ "");
// Build
RunMSBuildWithDotNet(projectName, properties, warningsAsError: true, forceDotNetBuild: forceDotNetBuild);
@@ -182,7 +196,7 @@ Task("dotnet-templates")
try
{
- CleanDirectories(templatesTest.FullPath);
+ CleanDirectories(tempDir.FullPath);
}
catch
{
@@ -288,11 +302,36 @@ Task("dotnet-pack-library-packs")
Download("Microsoft.Maui.Graphics.Win2D.WinUI.Desktop", "MicrosoftMauiGraphicsVersion", "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json", "https://api.nuget.org/v3/index.json");
});
+Task("dotnet-pack-docs")
+ .WithCriteria(RunPackTarget())
+ .Does(() =>
+ {
+ var tempDir = $"./artifacts/docs-packs-temp";
+ EnsureDirectoryExists(tempDir);
+ CleanDirectories(tempDir);
+
+ var destDir = $"./artifacts/docs-packs";
+ EnsureDirectoryExists(destDir);
+ CleanDirectories(destDir);
+
+ foreach (var nupkg in GetFiles("./artifacts/Microsoft.Maui.*.Ref.*.nupkg"))
+ {
+ var d = $"{tempDir}/{nupkg.GetFilename()}";
+ Unzip(nupkg, d);
+ DeleteFiles($"{d}/**/*.pri");
+ DeleteFiles($"{d}/**/*.aar");
+ CopyDirectory($"{d}/ref", $"{destDir}");
+ }
+
+ CleanDirectories(tempDir);
+ });
+
Task("dotnet-pack")
.WithCriteria(RunPackTarget())
.IsDependentOn("dotnet-pack-maui")
.IsDependentOn("dotnet-pack-additional")
- .IsDependentOn("dotnet-pack-library-packs");
+ .IsDependentOn("dotnet-pack-library-packs")
+ .IsDependentOn("dotnet-pack-docs");
Task("dotnet-build-test")
.IsDependentOn("dotnet")
@@ -439,29 +478,6 @@ bool RunPackTarget()
return false;
}
-string FindMSBuild()
-{
- if (!string.IsNullOrWhiteSpace(MSBuildExe))
- return MSBuildExe;
-
- 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";
-}
-
-
Dictionary GetDotNetEnvironmentVariables()
{
Dictionary envVariables = new Dictionary();
@@ -497,7 +513,7 @@ void SetDotNetEnvironmentVariables()
SetEnvironmentVariable("PATH", dotnet, prepend: true);
// Get "full" .binlog in Project System Tools
- if (HasArgument("debug"))
+ if (HasArgument("dbg"))
SetEnvironmentVariable("MSBuildDebugEngine", "1");
}
@@ -571,83 +587,45 @@ void RunMSBuildWithDotNet(
if(localDotnet)
SetDotNetEnvironmentVariables();
- // If we're not on Windows, use ./bin/dotnet/dotnet
- if (useDotNetBuild)
- {
- var msbuildSettings = new DotNetCoreMSBuildSettings()
- .SetConfiguration(configuration)
- .SetMaxCpuCount(0)
- .WithTarget(target)
- .EnableBinaryLogger(binlog);
+ var msbuildSettings = new DotNetCoreMSBuildSettings()
+ .SetConfiguration(configuration)
+ .SetMaxCpuCount(0)
+ .WithTarget(target)
+ .EnableBinaryLogger(binlog);
- if (warningsAsError)
- {
- msbuildSettings.TreatAllWarningsAs(MSBuildTreatAllWarningsAs.Error);
- }
+ if (warningsAsError)
+ {
+ msbuildSettings.TreatAllWarningsAs(MSBuildTreatAllWarningsAs.Error);
+ }
- if (properties != null)
+ if (properties != null)
+ {
+ foreach (var property in properties)
{
- foreach (var property in properties)
- {
- msbuildSettings.WithProperty(property.Key, property.Value);
- }
+ msbuildSettings.WithProperty(property.Key, property.Value);
}
+ }
- var dotnetBuildSettings = new DotNetCoreBuildSettings
- {
- MSBuildSettings = msbuildSettings,
- };
-
- dotnetBuildSettings.ArgumentCustomization = args =>
- {
- if (!restore)
- args.Append("--no-restore");
-
- if (!string.IsNullOrEmpty(targetFramework))
- args.Append($"-f {targetFramework}");
-
- return args;
- };
-
- if (localDotnet)
- dotnetBuildSettings.ToolPath = dotnetPath;
+ var dotnetBuildSettings = new DotNetCoreBuildSettings
+ {
+ MSBuildSettings = msbuildSettings,
+ };
- DotNetCoreBuild(sln, dotnetBuildSettings);
- }
- else
+ dotnetBuildSettings.ArgumentCustomization = args =>
{
- // Otherwise we need to run MSBuild for WinUI support
- var msbuild = FindMSBuild();
- Information("Using MSBuild: {0}", msbuild);
- var msbuildSettings = new MSBuildSettings { ToolPath = msbuild }
- .SetConfiguration(configuration)
- .SetMaxCpuCount(0)
- .WithTarget(target)
- .EnableBinaryLogger(binlog);
-
- if (warningsAsError)
- {
- msbuildSettings.WarningsAsError = true;
- }
- if (restore)
- {
- msbuildSettings.WithRestore();
- }
+ if (!restore)
+ args.Append("--no-restore");
+
if (!string.IsNullOrEmpty(targetFramework))
- {
- msbuildSettings.WithProperty("TargetFramework", targetFramework);
- }
+ args.Append($"-f {targetFramework}");
- if (properties != null)
- {
- foreach (var property in properties)
- {
- msbuildSettings.WithProperty(property.Key, property.Value);
- }
- }
+ return args;
+ };
- MSBuild(sln, msbuildSettings);
- }
+ if (localDotnet)
+ dotnetBuildSettings.ToolPath = dotnetPath;
+
+ DotNetCoreBuild(sln, dotnetBuildSettings);
}
void RunTestWithLocalDotNet(string csproj)
@@ -670,3 +648,34 @@ void RunTestWithLocalDotNet(string csproj)
ArgumentCustomization = args => args.Append($"-bl:{binlog}")
});
}
+
+DirectoryPath PrepareSeparateBuildContext(string dirName, bool generateDirectoryProps = false)
+{
+ var dir = GetTempDirectory().Combine(dirName);
+ EnsureDirectoryExists(dir);
+ CleanDirectories(dir.FullPath);
+
+ var nugetOnly = dir.Combine("nuget-only");
+ EnsureDirectoryExists(nugetOnly);
+ CleanDirectories(nugetOnly.FullPath);
+
+ CopyFileToDirectory(File("./NuGet.config"), dir);
+ var config = dir.CombineWithFilePath("NuGet.config");
+
+ foreach (var pattern in NuGetOnlyPackages)
+ {
+ CopyFiles($"./artifacts/{pattern}", nugetOnly, false);
+ }
+
+ // Add a specific folder for nuget-only packages
+ ReplaceTextInFiles(
+ config.FullPath,
+ $"",
+ $"");
+
+ // Create empty Directory.Build.props/targets
+ FileWriteText(dir.CombineWithFilePath("Directory.Build.props"), "");
+ FileWriteText(dir.CombineWithFilePath("Directory.Build.targets"), "");
+
+ return MakeAbsolute(dir);
+}
diff --git a/eng/devices/android.cake b/eng/devices/android.cake
index 180536e67092..83296c895272 100644
--- a/eng/devices/android.cake
+++ b/eng/devices/android.cake
@@ -32,6 +32,10 @@ bool DEVICE_BOOT_WAIT = Argument("wait", true);
var ANDROID_SDK_ROOT = GetAndroidSDKPath();
SetEnvironmentVariable("PATH", $"{ANDROID_SDK_ROOT}/tools/bin", prepend: true);
+SetEnvironmentVariable("PATH", $"{ANDROID_SDK_ROOT}/cmdline-tools/5.0/bin", prepend: true);
+SetEnvironmentVariable("PATH", $"{ANDROID_SDK_ROOT}/cmdline-tools/7.0/bin", prepend: true);
+SetEnvironmentVariable("PATH", $"{ANDROID_SDK_ROOT}/cmdline-tools/latest/bin", prepend: true);
+
SetEnvironmentVariable("PATH", $"{ANDROID_SDK_ROOT}/platform-tools", prepend: true);
SetEnvironmentVariable("PATH", $"{ANDROID_SDK_ROOT}/emulator", prepend: true);
@@ -42,7 +46,10 @@ Information("Build Configuration: {0}", CONFIGURATION);
var avdSettings = new AndroidAvdManagerToolSettings { SdkRoot = ANDROID_SDK_ROOT };
var adbSettings = new AdbToolSettings { SdkRoot = ANDROID_SDK_ROOT };
-var emuSettings = new AndroidEmulatorToolSettings { SdkRoot = ANDROID_SDK_ROOT, ArgumentCustomization = args => args.Append("-no-window") };
+var emuSettings = new AndroidEmulatorToolSettings { SdkRoot = ANDROID_SDK_ROOT };
+
+if (IsCIBuild())
+ emuSettings.ArgumentCustomization = args => args.Append("-no-window");
AndroidEmulatorProcess emulatorProcess = null;
diff --git a/eng/package.ps1 b/eng/package.ps1
index ac0be1097351..519ce179c975 100644
--- a/eng/package.ps1
+++ b/eng/package.ps1
@@ -9,8 +9,11 @@ Write-Host "MSBUILD_EXE: $env:MSBUILD_EXE"
$artifacts = Join-Path $PSScriptRoot ../artifacts
$logsDirectory = Join-Path $artifacts logs
-$sln = Join-Path $PSScriptRoot ../Microsoft.Maui.Packages.slnf
-$slnMac = Join-Path $PSScriptRoot ../Microsoft.Maui.Packages-mac.slnf
+if ($IsWindows) {
+ $sln = Join-Path $PSScriptRoot ../Microsoft.Maui.Packages.slnf
+} else {
+ $sln = Join-Path $PSScriptRoot ../Microsoft.Maui.Packages-mac.slnf
+}
# Full path to dotnet folder
$dotnet = Join-Path $PSScriptRoot ../bin/dotnet/
@@ -23,104 +26,26 @@ if (Test-Path -Path $dotnet) {
$dotnet = (Get-Item $dotnet).FullName
-if ($IsWindows)
+$oldPATH=$env:PATH
+$oldDOTNET_ROOT=$env:DOTNET_ROOT
+try
{
- if (-not $msbuild)
- {
- $msbuild = $env:MSBUILD_EXE
- }
-
- if (-not $msbuild)
- {
- # If MSBuild path isn't specified, use the standard location of 'vswhere' to determine an appropriate MSBuild to use.
- # Learn more about VSWhere here: https://github.com/microsoft/vswhere/wiki/Find-MSBuild
- $msbuild = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
-
- if (-not $msbuild)
- {
- throw 'Could not locate MSBuild automatically. Set the $msbuild parameter of this script to provide a location.'
- }
- Write-Host "Found MSBuild at ${msbuild}"
- }
-
- # NOTE: I've not found a better way to do this
- # see: https://github.com/PowerShell/PowerShell/issues/3316
- $oldDOTNET_INSTALL_DIR=$env:DOTNET_INSTALL_DIR
- $oldDOTNET_ROOT=$env:DOTNET_ROOT
- $oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
- $oldDOTNET_MULTILEVEL_LOOKUP=$env:DOTNET_MULTILEVEL_LOOKUP
- $oldMSBuildEnableWorkloadResolver=$env:MSBuildEnableWorkloadResolver
- $oldPATH=$env:PATH
- try
- {
- $env:DOTNET_INSTALL_DIR=$dotnet
-
- # This tells .NET to use the bootstrapped runtime
- $env:DOTNET_ROOT=$dotnet
-
- # This tells MSBuild to load the SDK from the directory of the bootstrapped SDK
- $env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_ROOT
-
- # This tells .NET not to go looking for .NET in other places
- $env:DOTNET_MULTILEVEL_LOOKUP=0
-
- # This enables workload support inside the IDE
- $env:MSBuildEnableWorkloadResolver=$true
-
- # Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
- $env:PATH=($dotnet + [IO.Path]::PathSeparator + $env:PATH)
-
- # Have to build the solution first so the xbf files are there for pack
- & $msbuild $sln `
- /p:configuration=$configuration `
- /p:SymbolPackageFormat=snupkg `
- /restore `
- /t:Build `
- /p:Packing=true `
- /bl:"$logsDirectory/maui-build-$configuration.binlog"
- if (!$?) { throw "Build .NET MAUI failed." }
-
- & $msbuild $sln `
- /p:configuration=$configuration `
- /p:SymbolPackageFormat=snupkg `
- /t:Pack `
- /p:Packing=true `
- /bl:"$logsDirectory/maui-pack-$configuration.binlog"
- if (!$?) { throw "Pack .NET MAUI failed." }
- }
- finally
- {
- $env:DOTNET_INSTALL_DIR = $oldDOTNET_INSTALL_DIR
- $env:DOTNET_ROOT=$oldDOTNET_ROOT
- $env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
- $env:DOTNET_MULTILEVEL_LOOKUP=$oldDOTNET_MULTILEVEL_LOOKUP
- $env:MSBuildEnableWorkloadResolver=$oldMSBuildEnableWorkloadResolver
- $env:PATH=$oldPATH
- }
+ # Put our local dotnet on $PATH
+ $env:PATH=($dotnet + [IO.Path]::PathSeparator + $env:PATH)
+ $dotnet_tool = Join-Path $dotnet dotnet
+
+ # This tells .NET to use the bootstrapped runtime
+ $env:DOTNET_ROOT=$dotnet
+
+ # Build with ./bin/dotnet/dotnet
+ & $dotnet_tool pack $sln `
+ -c:$configuration `
+ -p:SymbolPackageFormat=snupkg `
+ -bl:$logsDirectory/maui-pack-$configuration.binlog
+ if (!$?) { throw "Pack failed." }
}
-else
+finally
{
- $oldPATH=$env:PATH
- $oldDOTNET_ROOT=$env:DOTNET_ROOT
- try
- {
- # Put our local dotnet on $PATH
- $env:PATH=($dotnet + [IO.Path]::PathSeparator + $env:PATH)
- $dotnet_tool = Join-Path $dotnet dotnet
-
- # This tells .NET to use the bootstrapped runtime
- $env:DOTNET_ROOT=$dotnet
-
- # Build with ./bin/dotnet/dotnet
- & $dotnet_tool pack $slnMac `
- -c:$configuration `
- -p:SymbolPackageFormat=snupkg `
- -bl:$logsDirectory/maui-pack-$configuration.binlog
- if (!$?) { throw "Pack failed." }
- }
- finally
- {
- $env:PATH=$oldPATH
- $env:DOTNET_ROOT=$oldDOTNET_ROOT
- }
+ $env:PATH=$oldPATH
+ $env:DOTNET_ROOT=$oldDOTNET_ROOT
}
diff --git a/eng/pipelines/common/insertion.yml b/eng/pipelines/common/insertion.yml
index a0a8e58abb3e..38348463e0d8 100644
--- a/eng/pipelines/common/insertion.yml
+++ b/eng/pipelines/common/insertion.yml
@@ -21,7 +21,7 @@ stages:
- stage: sdk_insertion
displayName: 'SDK Insertion'
dependsOn: nuget_signing
- condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') ))))
+ condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/net6.0'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') )))))
jobs:
- template: sdk-insertion.yml
parameters:
@@ -31,7 +31,7 @@ stages:
- stage: sbom
displayName: 'Software Bill of Materials'
dependsOn: nuget_signing
- condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') ))))
+ condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/net6.0'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') )))))
jobs:
- template: compliance/sbom/job.v1.yml@xamarin-templates
parameters:
@@ -39,4 +39,4 @@ stages:
artifactMap: [ nuget/signed ] # Use artifacts that match the filter from the signed directory and not the top-level directory for the nuget artifact
packageName: 'Microsoft Maui'
packageFilter: '*.msi;*.nupkg'
- condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') ))))
+ condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/net6.0'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') )))))
diff --git a/eng/pipelines/common/localization-handback.yml b/eng/pipelines/common/localization-handback.yml
index 38289e8bb571..6ff96f8d14d2 100644
--- a/eng/pipelines/common/localization-handback.yml
+++ b/eng/pipelines/common/localization-handback.yml
@@ -14,13 +14,31 @@ stages:
persistCredentials: true
clean: true
+ - powershell: |
+ $srcBranch = $(Build.SourceBranch)
+ Write-Host "Extracting branch name from $srcBranch..."
+ if ("$srcBranch" -eq "refs/heads/loc") {
+ $baseBranchName = "main"
+ $locBranchName = "loc"
+ } elseif ("$srcBranch".StartsWith("refs/heads/loc-")) {
+ $baseBranchName = "$srcBranch".SubString("refs/heads/loc-".Length)
+ $locBranchName = "loc-$baseBranchName"
+ } else {
+ throw "Invalid branch name $srcBranch."
+ }
+ Write-Host "Using base branch: $baseBranchName"
+ Write-Host "Using loc branch: $locBranchName"
+ Write-Host "##vso[task.setvariable variable=LOC_BASE_BRANCH_NAME;]$baseBranchName"
+ Write-Host "##vso[task.setvariable variable=LOC_BRANCH_NAME;]$locBranchName"
+ displayName: 'Extract branch name variables'
+
- powershell: |
#-- Import Invoke-Git Module function
Import-Module $(Build.SourcesDirectory)\eng\automation\scripts\Invoke-Git.psm1 -Force -DisableNameChecking
git config user.email "vs-mobiletools-engineering-service2@microsoft.com"
git config user.name "VS Mobile Engineering Serice Account"
- Invoke-Git checkout main
- Invoke-Git merge origin/$(LocBranch) --no-commit
+ Invoke-Git checkout $(LOC_BASE_BRANCH_NAME)
+ Invoke-Git merge origin/$(LOC_BRANCH_NAME) --no-commit
displayName: 'Merge loc Branch'
- task: cesve.one-loc-build.one-loc-build.OneLocBuild@2
@@ -44,7 +62,7 @@ stages:
#--Clear Stage
Invoke-Git reset HEAD -- .
#-- Create new branch
- $branchName = "$(LocBranchPrefix)/$(new-guid)"
+ $branchName = "$(LocBranchPrefix)/$(LOC_BASE_BRANCH_NAME)_$(new-guid)"
Invoke-Git checkout -B ${branchName}
Write-Host ("##vso[task.setvariable variable=HANDBACK_BRANCH_NAME;]$branchName")
#-- Stage Build Changes
@@ -64,7 +82,7 @@ stages:
$payload=@{
title = "[LOC_HB] checkin of localized string files"
head = "$(HANDBACK_BRANCH_NAME)"
- base = "main"
+ base = "$(LOC_BASE_BRANCH_NAME)"
maintainer_can_modify = $true
}
diff --git a/eng/pipelines/common/localization-handoff.yml b/eng/pipelines/common/localization-handoff.yml
index c026de5a823b..bb1f34b07bdf 100644
--- a/eng/pipelines/common/localization-handoff.yml
+++ b/eng/pipelines/common/localization-handoff.yml
@@ -2,7 +2,7 @@ stages:
- stage: localization_handoff
displayName: Localization Handoff
dependsOn: []
- condition: and(succeeded(), eq(variables.isMainBranch, true))
+ condition: and(succeeded(), eq(variables.isLocHandoffBranch, true))
jobs:
- job : generate_lci
diff --git a/eng/pipelines/common/pack.yml b/eng/pipelines/common/pack.yml
index 014269f3bf10..98b485584bfd 100644
--- a/eng/pipelines/common/pack.yml
+++ b/eng/pipelines/common/pack.yml
@@ -32,6 +32,7 @@ steps:
- ${{ if eq(parameters.platform, 'Windows') }}:
- pwsh: ./build.ps1 --target=dotnet-diff --configuration="Release" --verbosity=diagnostic
displayName: 'Diff .NET Maui artifacts with NuGet'
+ # artifacts
- task: CopyFiles@2
condition: always()
displayName: 'Copy files to staging'
@@ -42,6 +43,7 @@ steps:
artifacts/vs-workload.props
eng/automation/SignList.xml
!artifacts/library-packs/**
+ !artifacts/docs-packs/**
TargetFolder: $(build.artifactstagingdirectory)
flattenFolders: true
- task: CopyFiles@2
@@ -66,21 +68,19 @@ steps:
displayName: publish artifacts
inputs:
ArtifactName: ${{ parameters.artifact }}
- - task: DeleteFiles@1
- inputs:
- SourceFolder: $(build.artifactstagingdirectory)
- Contents: '**/*'
- - task: CopyFiles@2
- condition: always()
- displayName: 'Copy library packs to staging'
- inputs:
- Contents: |
- artifacts/library-packs/**
- TargetFolder: $(build.artifactstagingdirectory)
- flattenFolders: true
+ # library-packs
- task: PublishBuildArtifacts@1
condition: always()
displayName: publish library packs artifacts
inputs:
+ PathToPublish: artifacts/library-packs
ArtifactName: ${{ parameters.libraryPacksArtifact }}
+ # xml-docs
+ - ${{ if eq(parameters.platform, 'Windows') }}:
+ - task: PublishBuildArtifacts@1
+ condition: always()
+ displayName: publish library packs artifacts
+ inputs:
+ PathToPublish: artifacts/docs-packs
+ ArtifactName: xml-docs
diff --git a/eng/pipelines/common/sign.yml b/eng/pipelines/common/sign.yml
index 6f9b784f5afd..93a0088d6513 100644
--- a/eng/pipelines/common/sign.yml
+++ b/eng/pipelines/common/sign.yml
@@ -12,7 +12,7 @@ stages:
signedArtifactName: nuget
signedArtifactPath: signed
displayName: Sign Phase
- condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') ))))
+ condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/net6.0'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') )))))
- template: nuget-msi-convert/job/v2.yml@xamarin-templates
parameters:
diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml
index 4ae58563f859..dbba305b3b15 100644
--- a/eng/pipelines/common/variables.yml
+++ b/eng/pipelines/common/variables.yml
@@ -9,22 +9,25 @@ variables:
value: 5.0.201
- name: LocBranchPrefix
value: 'loc-hb'
-- name: LocBranch
- value: 'loc'
- name: isMainBranch
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
- name: isLocBranch
- value: $[eq(variables['Build.SourceBranch'], 'refs/heads/loc')]
+ value: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/loc'), startsWith(variables['Build.SourceBranch'], 'refs/heads/loc-'))]
- name: isTargetMainBranch
value: $[eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/main')]
-- name: isTargetLocBranch
- value: $[eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/loc')]
- name: isLocPRBranch
value: $[startsWith(variables['System.PullRequest.SourceBranch'], 'loc-hb')]
- name: isPullRequest
value: $[eq(variables['Build.Reason'], 'PullRequest')]
+- name: isLocHandoffBranch
+ value: $[in(variables['Build.SourceBranch'], 'refs/heads/net6.0', 'refs/heads/net7.0', 'refs/heads/main')]
- name: signingCondition
- value: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') ))))
+ value: $[or(
+ eq(variables['Sign'], 'true'),
+ in(variables['Build.SourceBranch'], 'refs/heads/net6.0', 'refs/heads/net7.0', 'refs/heads/main'),
+ startsWith(variables['Build.SourceBranch'], 'refs/tags/'),
+ startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')
+ )]
# Common Agent Pools in use
- name: LogDirectory
value: $(Build.ArtifactStagingDirectory)/logs
diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml
index 29a9a93ac7ac..f26466c4c0f7 100644
--- a/eng/pipelines/handlers.yml
+++ b/eng/pipelines/handlers.yml
@@ -73,14 +73,14 @@ parameters:
vmImage: $(windowsNet6VmImage)
bootsAndroid: $(Android.Msi)
bootsiOS: $(iOS.Msi)
- artifact: net6-windows
+ artifact: build-windows
- name: macOS
poolName: $(macOSXNet6VmPool)
vmImage: $(macOSXNet6VmImage)
bootsAndroid: $(Android.Pkg)
bootsiOS: $(iOS.Pkg)
bootsMacCatalyst: $(MacCatalyst.Pkg)
- artifact: net6-macos
+ artifact: build-macos
- name: PackPlatforms
type: object
default:
@@ -97,6 +97,13 @@ parameters:
bootsiOS: $(iOS.Pkg)
bootsMacCatalyst: $(MacCatalyst.Pkg)
artifact: nuget-macos
+ - name: TestTargetFrameworks
+ type: object
+ default:
+ - name: default
+ tfm: default
+ - name: net6
+ tfm: net6.0
resources:
repositories:
@@ -114,7 +121,7 @@ resources:
stages:
- stage: build_net6
- displayName: Build .NET 6
+ displayName: Build .NET MAUI
dependsOn: []
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
@@ -170,7 +177,7 @@ stages:
ArtifactName: ${{ BuildPlatform.artifact }}
- stage: pack_net6
- displayName: Pack .NET 6
+ displayName: Pack .NET MAUI
dependsOn: []
jobs:
- ${{ each PackPlatform in parameters.PackPlatforms }}:
@@ -196,7 +203,7 @@ stages:
artifact: ${{ PackPlatform.artifact }}
- stage: samples_net6
- displayName: Build .NET 6 Samples
+ displayName: Build .NET MAUI Samples
dependsOn: pack_net6
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
@@ -245,7 +252,7 @@ stages:
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD: $(PrivateBuild)
- pwsh: ./build.ps1 --target=dotnet-samples --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
- displayName: 'Build .NET 6 Samples'
+ displayName: 'Build .NET MAUI Samples'
- task: PublishBuildArtifacts@1
condition: always()
displayName: publish artifacts
@@ -253,61 +260,62 @@ stages:
ArtifactName: ${{ BuildPlatform.artifact }}
- stage: templates_net6
- displayName: Build .NET 6 Templates
+ displayName: Build .NET MAUI Templates
dependsOn: pack_net6
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
- - job: build_net6_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
- workspace:
- clean: all
- displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
- timeoutInMinutes: 120
- condition: or(
- ${{ parameters.BuildEverything }},
- ne(variables['Build.Reason'], 'PullRequest'),
- eq('${{ BuildConfiguration }}', 'Release'))
- pool:
- name: ${{ BuildPlatform.poolName }}
- vmImage: ${{ BuildPlatform.vmImage }}
- demands:
- - macOS.Name -equals Monterey
- - macOS.Architecture -equals x64
- - Agent.HasDevices -equals False
- - Agent.IsPaired -equals False
- steps:
- - ${{ if eq(BuildPlatform.name, 'macOS') }}:
- - template: agent-cleanser/v1.yml@xamarin-templates
+ - ${{ each TestTFM in parameters.TestTargetFrameworks }}:
+ - job: build_${{ TestTFM.name }}_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
+ workspace:
+ clean: all
+ displayName: ${{ BuildPlatform.name }} ${{ TestTFM.tfm }} (${{ BuildConfiguration }})
+ timeoutInMinutes: 120
+ condition: or(
+ ${{ parameters.BuildEverything }},
+ ne(variables['Build.Reason'], 'PullRequest'),
+ eq('${{ BuildConfiguration }}', 'Release'))
+ pool:
+ name: ${{ BuildPlatform.poolName }}
+ vmImage: ${{ BuildPlatform.vmImage }}
+ demands:
+ - macOS.Name -equals Monterey
+ - macOS.Architecture -equals x64
+ - Agent.HasDevices -equals False
+ - Agent.IsPaired -equals False
+ steps:
+ - ${{ if eq(BuildPlatform.name, 'macOS') }}:
+ - template: agent-cleanser/v1.yml@xamarin-templates
+ parameters:
+ UninstallMono: false
+ UninstallXamarinMac: false
+ CleanseAgentToolsDotNet: true # Cleanse all .NET versions under the agent tools directory and use only those provisioned by the pipeline
+ - template: common/provision.yml
parameters:
- UninstallMono: false
- UninstallXamarinMac: false
- CleanseAgentToolsDotNet: true # Cleanse all .NET versions under the agent tools directory and use only those provisioned by the pipeline
- - template: common/provision.yml
- parameters:
- platform: ${{ BuildPlatform.name }}
- poolName: ${{ BuildPlatform.poolName }}
- provisionatorChannel: ${{ parameters.provisionatorChannel }}
- - task: DownloadBuildArtifacts@0
- displayName: 'Download Packages'
- inputs:
- artifactName: nuget
- itemPattern: '**/*.nupkg'
- downloadPath: $(System.DefaultWorkingDirectory)/artifacts
- - pwsh: Move-Item -Path artifacts\nuget\*.nupkg -Destination artifacts -Force
- displayName: Move the downloaded artifacts
- - pwsh: ./build.ps1 --target=dotnet-local-workloads --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
- displayName: 'Install .NET (Local Workloads)'
- retryCountOnTaskFailure: 3
- env:
- DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
- PRIVATE_BUILD: $(PrivateBuild)
- - pwsh: ./build.ps1 --target=dotnet-templates --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
- displayName: 'Build .NET 6 Templates'
- - task: PublishBuildArtifacts@1
- condition: always()
- displayName: publish artifacts
- inputs:
- ArtifactName: ${{ BuildPlatform.artifact }}
+ platform: ${{ BuildPlatform.name }}
+ poolName: ${{ BuildPlatform.poolName }}
+ provisionatorChannel: ${{ parameters.provisionatorChannel }}
+ - task: DownloadBuildArtifacts@0
+ displayName: 'Download Packages'
+ inputs:
+ artifactName: nuget
+ itemPattern: '**/*.nupkg'
+ downloadPath: $(System.DefaultWorkingDirectory)/artifacts
+ - pwsh: Move-Item -Path artifacts\nuget\*.nupkg -Destination artifacts -Force
+ displayName: Move the downloaded artifacts
+ - pwsh: ./build.ps1 --target=dotnet-local-workloads --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
+ displayName: 'Install .NET (Local Workloads)'
+ retryCountOnTaskFailure: 3
+ env:
+ DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
+ PRIVATE_BUILD: $(PrivateBuild)
+ - pwsh: ./build.ps1 --target=dotnet-templates --configuration="${{ BuildConfiguration }}" --testtfm="${{ TestTFM.tfm }}" --verbosity=diagnostic
+ displayName: 'Build .NET MAUI Templates'
+ - task: PublishBuildArtifacts@1
+ condition: always()
+ displayName: publish artifacts
+ inputs:
+ ArtifactName: ${{ BuildPlatform.artifact }}
- template: common/security-compliance.yml
diff --git a/eng/pipelines/maui-release.yml b/eng/pipelines/maui-release.yml
index cdae3a9a0a79..12d47a235485 100644
--- a/eng/pipelines/maui-release.yml
+++ b/eng/pipelines/maui-release.yml
@@ -58,7 +58,7 @@ resources:
stages:
- stage: pack_net6
- displayName: Pack .NET 6
+ displayName: Pack .NET MAUI
dependsOn: []
jobs:
- ${{ each PackPlatform in parameters.PackPlatforms }}:
diff --git a/loc/cs/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/cs/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..bdebe13a998c
--- /dev/null
+++ b/loc/cs/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/cs/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..798dc4661356
--- /dev/null
+++ b/loc/cs/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/cs/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..40cd7f5cdfcf
--- /dev/null
+++ b/loc/cs/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/cs/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..d62e1a505960
--- /dev/null
+++ b/loc/cs/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/cs/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..b6d4b054371e
--- /dev/null
+++ b/loc/cs/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/cs/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..23f8084b6d9b
--- /dev/null
+++ b/loc/cs/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/cs/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..485babe793ef
--- /dev/null
+++ b/loc/cs/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/cs/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..f3750933a06b
--- /dev/null
+++ b/loc/cs/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/cs/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..5bd684068ac6
--- /dev/null
+++ b/loc/cs/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/cs/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/cs/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..4f9c2ef2e9e0
--- /dev/null
+++ b/loc/cs/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/de/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..07eea9a3b04f
--- /dev/null
+++ b/loc/de/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/de/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..95fa955015a0
--- /dev/null
+++ b/loc/de/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/de/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..5200b2f0f369
--- /dev/null
+++ b/loc/de/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/de/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..0aa0223dfdf6
--- /dev/null
+++ b/loc/de/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/de/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..9be2a38c2299
--- /dev/null
+++ b/loc/de/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/de/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..6aceca0438fd
--- /dev/null
+++ b/loc/de/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/de/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..fe3e9a63c188
--- /dev/null
+++ b/loc/de/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/de/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..32dec37b1783
--- /dev/null
+++ b/loc/de/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/de/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..0cc5d3537f94
--- /dev/null
+++ b/loc/de/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/de/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/de/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..5dce31ee71af
--- /dev/null
+++ b/loc/de/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/es/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..135ce54205f4
--- /dev/null
+++ b/loc/es/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/es/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..a03e205f7e79
--- /dev/null
+++ b/loc/es/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/es/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..764caada0c10
--- /dev/null
+++ b/loc/es/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/es/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..038de6667f66
--- /dev/null
+++ b/loc/es/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/es/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..bbb5192bc452
--- /dev/null
+++ b/loc/es/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/es/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..e127029487ee
--- /dev/null
+++ b/loc/es/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/es/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..ae519da60cee
--- /dev/null
+++ b/loc/es/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/es/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..b348703efa3a
--- /dev/null
+++ b/loc/es/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/es/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..62f07ea39620
--- /dev/null
+++ b/loc/es/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/es/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/es/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..dc4d705a21bd
--- /dev/null
+++ b/loc/es/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/fr/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..31c104308722
--- /dev/null
+++ b/loc/fr/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/fr/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..621c66698fe4
--- /dev/null
+++ b/loc/fr/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/fr/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..110f09be1048
--- /dev/null
+++ b/loc/fr/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/fr/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..dcbc49f9c9ec
--- /dev/null
+++ b/loc/fr/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/fr/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..65799104c4c1
--- /dev/null
+++ b/loc/fr/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/fr/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..6b66d110aee4
--- /dev/null
+++ b/loc/fr/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/fr/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..0a0ffd9328a3
--- /dev/null
+++ b/loc/fr/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/fr/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..647f122b01fb
--- /dev/null
+++ b/loc/fr/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/fr/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..8a510fa1d65a
--- /dev/null
+++ b/loc/fr/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/fr/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/fr/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..70e012b7e204
--- /dev/null
+++ b/loc/fr/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/it/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..7d72c6e44055
--- /dev/null
+++ b/loc/it/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/it/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..fb19e7ba1f8f
--- /dev/null
+++ b/loc/it/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/it/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..d82b060bb47e
--- /dev/null
+++ b/loc/it/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/it/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..5cce1c0fde9a
--- /dev/null
+++ b/loc/it/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/it/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..d9352d930cc3
--- /dev/null
+++ b/loc/it/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/it/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..34a1958cdfd7
--- /dev/null
+++ b/loc/it/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/it/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..ec2c9a7b6062
--- /dev/null
+++ b/loc/it/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/it/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..bcdbb21580ed
--- /dev/null
+++ b/loc/it/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/it/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..fe071e260345
--- /dev/null
+++ b/loc/it/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/it/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/it/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..23a5abee2211
--- /dev/null
+++ b/loc/it/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/ja/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..c1640efeb062
--- /dev/null
+++ b/loc/ja/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/ja/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..8ecdd7272c87
--- /dev/null
+++ b/loc/ja/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/ja/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..b65f1948b812
--- /dev/null
+++ b/loc/ja/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/ja/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..fbf9ea4950bd
--- /dev/null
+++ b/loc/ja/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ja/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..bc3676551184
--- /dev/null
+++ b/loc/ja/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/ja/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..a5c7feccc40e
--- /dev/null
+++ b/loc/ja/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ja/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..fca976483332
--- /dev/null
+++ b/loc/ja/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/ja/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..5363b222ea6d
--- /dev/null
+++ b/loc/ja/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/ja/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..983b1798e6e9
--- /dev/null
+++ b/loc/ja/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ja/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ja/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..48898616cdb0
--- /dev/null
+++ b/loc/ja/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/ko/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..4f54a09f93d0
--- /dev/null
+++ b/loc/ko/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/ko/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..608ce6640076
--- /dev/null
+++ b/loc/ko/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/ko/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..8c411dbb172f
--- /dev/null
+++ b/loc/ko/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/ko/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..efba932b4303
--- /dev/null
+++ b/loc/ko/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ko/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..7c7a35823ca8
--- /dev/null
+++ b/loc/ko/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/ko/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..afb4963b6ccc
--- /dev/null
+++ b/loc/ko/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ko/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..1a7a6c107675
--- /dev/null
+++ b/loc/ko/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/ko/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..a86402952c85
--- /dev/null
+++ b/loc/ko/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/ko/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..0cddea56a146
--- /dev/null
+++ b/loc/ko/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ko/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ko/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..7d231b46ad21
--- /dev/null
+++ b/loc/ko/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/pl/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..18afd8e3d256
--- /dev/null
+++ b/loc/pl/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/pl/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..9a537abf5563
--- /dev/null
+++ b/loc/pl/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/pl/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..d675020bbac0
--- /dev/null
+++ b/loc/pl/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/pl/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..327a1b2ca3e9
--- /dev/null
+++ b/loc/pl/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/pl/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..4436126cfe78
--- /dev/null
+++ b/loc/pl/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/pl/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..ede86bb1aa56
--- /dev/null
+++ b/loc/pl/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/pl/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..424b525ab4e6
--- /dev/null
+++ b/loc/pl/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/pl/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..c2dca49e99ae
--- /dev/null
+++ b/loc/pl/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/pl/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..49cefa94dd50
--- /dev/null
+++ b/loc/pl/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pl/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/pl/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..eec8e6be5426
--- /dev/null
+++ b/loc/pl/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/pt-BR/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..32fb63bd50dd
--- /dev/null
+++ b/loc/pt-BR/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/pt-BR/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..26184d634c63
--- /dev/null
+++ b/loc/pt-BR/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/pt-BR/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..1ec51eef7064
--- /dev/null
+++ b/loc/pt-BR/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/pt-BR/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..ce9dfb988e5e
--- /dev/null
+++ b/loc/pt-BR/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/pt-BR/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..a28e9a35aa97
--- /dev/null
+++ b/loc/pt-BR/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/pt-BR/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..b2ca63417ccf
--- /dev/null
+++ b/loc/pt-BR/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/pt-BR/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..d236b4dfde0f
--- /dev/null
+++ b/loc/pt-BR/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/pt-BR/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..72dd74e584c8
--- /dev/null
+++ b/loc/pt-BR/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/pt-BR/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..8dc24eaff1a7
--- /dev/null
+++ b/loc/pt-BR/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/pt-BR/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/pt-BR/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..b6bbfea39457
--- /dev/null
+++ b/loc/pt-BR/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/ru/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..5bb8a14f7d64
--- /dev/null
+++ b/loc/ru/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/ru/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..6d21081b4fe8
--- /dev/null
+++ b/loc/ru/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/ru/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..fd7bad8481ff
--- /dev/null
+++ b/loc/ru/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/ru/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..ac15532d4be2
--- /dev/null
+++ b/loc/ru/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ru/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..266a1954a0f9
--- /dev/null
+++ b/loc/ru/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/ru/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..010d6db6af34
--- /dev/null
+++ b/loc/ru/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ru/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..ac63f835ea5a
--- /dev/null
+++ b/loc/ru/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/ru/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..aa82e4b06824
--- /dev/null
+++ b/loc/ru/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/ru/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..f183b718babc
--- /dev/null
+++ b/loc/ru/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/ru/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/ru/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..367e78213968
--- /dev/null
+++ b/loc/ru/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/tr/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..d9bc6f8f571b
--- /dev/null
+++ b/loc/tr/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/tr/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..8760153f1385
--- /dev/null
+++ b/loc/tr/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/tr/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..8f11d9d4f358
--- /dev/null
+++ b/loc/tr/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/tr/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..ae67d7f7b6ea
--- /dev/null
+++ b/loc/tr/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/tr/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..d69ed7b0278e
--- /dev/null
+++ b/loc/tr/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/tr/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..a866a55bbf12
--- /dev/null
+++ b/loc/tr/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/tr/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..ca2588dda0e0
--- /dev/null
+++ b/loc/tr/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/tr/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..797dd5ae4af1
--- /dev/null
+++ b/loc/tr/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/tr/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..8d4e6beb3a27
--- /dev/null
+++ b/loc/tr/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/tr/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/tr/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..7c19b2c10ebc
--- /dev/null
+++ b/loc/tr/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/zh-Hans/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..653eb1fc9f94
--- /dev/null
+++ b/loc/zh-Hans/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/zh-Hans/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..0d5c2d14a197
--- /dev/null
+++ b/loc/zh-Hans/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hans/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..13b5e4a95521
--- /dev/null
+++ b/loc/zh-Hans/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hans/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..89996008e9ff
--- /dev/null
+++ b/loc/zh-Hans/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hans/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..60dd7679e3e9
--- /dev/null
+++ b/loc/zh-Hans/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hans/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..90a70c856472
--- /dev/null
+++ b/loc/zh-Hans/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hans/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..0ba83fb61eb4
--- /dev/null
+++ b/loc/zh-Hans/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hans/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..2fa2a26ab423
--- /dev/null
+++ b/loc/zh-Hans/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hans/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..943706f74560
--- /dev/null
+++ b/loc/zh-Hans/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hans/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hans/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..8537756b6ce0
--- /dev/null
+++ b/loc/zh-Hans/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl b/loc/zh-Hant/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
new file mode 100644
index 000000000000..d89acaef8944
--- /dev/null
+++ b/loc/zh-Hant/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl b/loc/zh-Hant/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
new file mode 100644
index 000000000000..90553155f9bb
--- /dev/null
+++ b/loc/zh-Hant/src/Controls/src/Core/Compatibility/iOS/Resources/StringResources.resx.lcl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hant/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..eab593fc9b8c
--- /dev/null
+++ b/loc/zh-Hant/src/Templates/src/templates/maui-blazor/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hant/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..e5f68cb3a2f5
--- /dev/null
+++ b/loc/zh-Hant/src/Templates/src/templates/maui-contentpage-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hant/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..7de66552db80
--- /dev/null
+++ b/loc/zh-Hant/src/Templates/src/templates/maui-contentpage-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hant/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..7743f8b99bad
--- /dev/null
+++ b/loc/zh-Hant/src/Templates/src/templates/maui-contentview-csharp/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hant/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..691c70ef4199
--- /dev/null
+++ b/loc/zh-Hant/src/Templates/src/templates/maui-contentview-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hant/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..de2bb14166d7
--- /dev/null
+++ b/loc/zh-Hant/src/Templates/src/templates/maui-lib/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hant/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..82e302768646
--- /dev/null
+++ b/loc/zh-Hant/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/loc/zh-Hant/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl b/loc/zh-Hant/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
new file mode 100644
index 000000000000..b915e679c454
--- /dev/null
+++ b/loc/zh-Hant/src/Templates/src/templates/maui-resourcedictionary-xaml/.template.config/localize/templatestrings.json.lcl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/BlazorWebView/src/Maui/Android/AndroidWebKitWebViewManager.cs b/src/BlazorWebView/src/Maui/Android/AndroidWebKitWebViewManager.cs
index f6af22b85847..9def544942f8 100644
--- a/src/BlazorWebView/src/Maui/Android/AndroidWebKitWebViewManager.cs
+++ b/src/BlazorWebView/src/Maui/Android/AndroidWebKitWebViewManager.cs
@@ -27,7 +27,6 @@ internal class AndroidWebKitWebViewManager : WebViewManager
private static readonly AUri AndroidAppOriginUri = AUri.Parse(AppOrigin)!;
private readonly AWebView _webview;
private readonly string _contentRootRelativeToAppRoot;
- private WebMessagePort[]? _nativeToJSPorts;
///
/// Constructs an instance of .
@@ -38,9 +37,11 @@ internal class AndroidWebKitWebViewManager : WebViewManager
/// Provides static content to the webview.
/// Path to the directory containing application content files.
/// Path to the host page within the .
- public AndroidWebKitWebViewManager(AWebView webview!!, IServiceProvider services, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
+ public AndroidWebKitWebViewManager(AWebView webview, IServiceProvider services, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
: base(services, dispatcher, AppOriginUri, fileProvider, jsComponents, hostPageRelativePath)
{
+ ArgumentNullException.ThrowIfNull(webview);
+
#if WEBVIEW2_MAUI
if (services.GetService() is null)
{
@@ -74,33 +75,21 @@ internal bool TryGetResponseContentInternal(string uri, bool allowFallbackOnHost
internal void SetUpMessageChannel()
{
- _nativeToJSPorts = _webview.CreateWebMessageChannel();
+ // These ports will be closed automatically when the webview gets disposed.
+ var nativeToJSPorts = _webview.CreateWebMessageChannel();
var nativeToJs = new BlazorWebMessageCallback(message =>
{
MessageReceived(AppOriginUri, message!);
});
- var destPort = new[] { _nativeToJSPorts[1] };
+ var destPort = new[] { nativeToJSPorts[1] };
- _nativeToJSPorts[0].SetWebMessageCallback(nativeToJs);
+ nativeToJSPorts[0].SetWebMessageCallback(nativeToJs);
_webview.PostWebMessage(new WebMessage("capturePort", destPort), AndroidAppOriginUri);
}
- protected override async ValueTask DisposeAsyncCore()
- {
- await base.DisposeAsyncCore();
-
- if (_nativeToJSPorts is not null)
- {
- foreach (var port in _nativeToJSPorts)
- {
- port?.Close();
- }
- }
- }
-
private class BlazorWebMessageCallback : WebMessagePort.WebMessageCallback
{
private readonly Action _onMessageReceived;
diff --git a/src/BlazorWebView/src/Maui/Android/BlazorWebView.Android.cs b/src/BlazorWebView/src/Maui/Android/BlazorAndroidWebView.cs
similarity index 100%
rename from src/BlazorWebView/src/Maui/Android/BlazorWebView.Android.cs
rename to src/BlazorWebView/src/Maui/Android/BlazorAndroidWebView.cs
diff --git a/src/BlazorWebView/src/Maui/Android/WebKitWebViewClient.cs b/src/BlazorWebView/src/Maui/Android/WebKitWebViewClient.cs
index 02388a2b2744..0c3536ac46cb 100644
--- a/src/BlazorWebView/src/Maui/Android/WebKitWebViewClient.cs
+++ b/src/BlazorWebView/src/Maui/Android/WebKitWebViewClient.cs
@@ -20,8 +20,9 @@ internal class WebKitWebViewClient : WebViewClient
private readonly BlazorWebViewHandler? _webViewHandler;
- public WebKitWebViewClient(BlazorWebViewHandler webViewHandler!!)
+ public WebKitWebViewClient(BlazorWebViewHandler webViewHandler)
{
+ ArgumentNullException.ThrowIfNull(webViewHandler);
_webViewHandler = webViewHandler;
}
@@ -188,8 +189,9 @@ private class JavaScriptValueCallback : Java.Lang.Object, IValueCallback
{
private readonly Action _callback;
- public JavaScriptValueCallback(Action callback!!)
+ public JavaScriptValueCallback(Action callback)
{
+ ArgumentNullException.ThrowIfNull(callback);
_callback = callback;
}
diff --git a/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj b/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj
index fdfc6981580d..6c4121361c66 100644
--- a/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj
+++ b/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj
@@ -31,11 +31,7 @@
-
-
-
-
-
+
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-android/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Shipped.txt
similarity index 100%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-android/PublicAPI.Unshipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Shipped.txt
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-android/PublicAPI.Shipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Unshipped.txt
similarity index 100%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-android/PublicAPI.Shipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Unshipped.txt
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-ios/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-ios/PublicAPI.Shipped.txt
similarity index 99%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-ios/PublicAPI.Unshipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net-ios/PublicAPI.Shipped.txt
index 486bc4fc4e76..d6bfacc992b8 100644
--- a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-ios/PublicAPI.Unshipped.txt
+++ b/src/BlazorWebView/src/Maui/PublicAPI/net-ios/PublicAPI.Shipped.txt
@@ -1,4 +1,4 @@
-#nullable enable
+#nullable enable
Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs
Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.BlazorWebViewInitializedEventArgs() -> void
Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-ios/PublicAPI.Unshipped.txt
new file mode 100644
index 000000000000..7dc5c58110bf
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/PublicAPI/net-ios/PublicAPI.Unshipped.txt
@@ -0,0 +1 @@
+#nullable enable
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-maccatalyst/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt
similarity index 99%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-maccatalyst/PublicAPI.Unshipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt
index 486bc4fc4e76..d6bfacc992b8 100644
--- a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-maccatalyst/PublicAPI.Unshipped.txt
+++ b/src/BlazorWebView/src/Maui/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt
@@ -1,4 +1,4 @@
-#nullable enable
+#nullable enable
Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs
Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.BlazorWebViewInitializedEventArgs() -> void
Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
new file mode 100644
index 000000000000..7dc5c58110bf
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
@@ -0,0 +1 @@
+#nullable enable
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-tizen/PublicAPI.Shipped.txt
similarity index 100%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Unshipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net-tizen/PublicAPI.Shipped.txt
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-ios/PublicAPI.Shipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
similarity index 100%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-ios/PublicAPI.Shipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-windows10.0.19041/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-windows/PublicAPI.Shipped.txt
similarity index 100%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-windows10.0.19041/PublicAPI.Unshipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net-windows/PublicAPI.Shipped.txt
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-maccatalyst/PublicAPI.Shipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-windows/PublicAPI.Unshipped.txt
similarity index 100%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-maccatalyst/PublicAPI.Shipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net-windows/PublicAPI.Unshipped.txt
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net/PublicAPI.Shipped.txt
similarity index 100%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0/PublicAPI.Unshipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net/PublicAPI.Shipped.txt
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Shipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net/PublicAPI.Unshipped.txt
similarity index 100%
rename from src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Shipped.txt
rename to src/BlazorWebView/src/Maui/PublicAPI/net/PublicAPI.Unshipped.txt
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-windows10.0.20348/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net6.0-windows10.0.20348/PublicAPI.Unshipped.txt
deleted file mode 100644
index 410ef95475d2..000000000000
--- a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-windows10.0.20348/PublicAPI.Unshipped.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-#nullable enable
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.BlazorWebViewInitializedEventArgs() -> void
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BlazorWebViewInitializingEventArgs() -> void
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebView() -> void
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebViewInitialized -> System.EventHandler?
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebViewInitializing -> System.EventHandler?
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.get -> string?
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.set -> void
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.UrlLoading -> System.EventHandler?
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewHandler() -> void
-Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewHandler(Microsoft.Maui.PropertyMapper? mapper) -> void
-Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView
-Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.BlazorWebViewInitialized(Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs! args) -> void
-Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.BlazorWebViewInitializing(Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs! args) -> void
-Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
-Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.HostPage.get -> string?
-Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
-Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
-Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.UrlLoading(Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs! args) -> void
-Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder
-Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponent
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.ComponentType.get -> System.Type?
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.ComponentType.set -> void
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.Parameters.get -> System.Collections.Generic.IDictionary?
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.Parameters.set -> void
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.RootComponent() -> void
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.Selector.get -> string?
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.Selector.set -> void
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
-Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection.RootComponentsCollection(Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore! jsComponents) -> void
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.Url.get -> System.Uri!
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.get -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.set -> void
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.CancelLoad = 2 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenExternally = 0 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenInWebView = 1 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions
-override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.OnPropertyChanged(string? propertyName = null) -> void
-override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.OnPropertyChanging(string? propertyName = null) -> void
-override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.CreatePlatformView() -> Microsoft.UI.Xaml.Controls.WebView2!
-override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.DisconnectHandler(Microsoft.UI.Xaml.Controls.WebView2! platformView) -> void
-static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapHostPage(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
-static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapRootComponents(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
-static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
-static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddMauiBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder!
-static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewMapper -> Microsoft.Maui.PropertyMapper!
-virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.WebView.get -> Microsoft.UI.Xaml.Controls.WebView2
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.get -> string
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.set -> void
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.get -> Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.set -> void
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.get -> string
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.set -> void
diff --git a/src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs b/src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs
index 52b3a3423f67..beb14251deee 100644
--- a/src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs
+++ b/src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
///
public class WebViewContainer : WidgetLayout
{
-
+
///
/// A Tizen WebView.
///
diff --git a/src/BlazorWebView/src/Maui/Tizen/WebViewExtensions.cs b/src/BlazorWebView/src/Maui/Tizen/WebViewExtensions.cs
index 4150989f1013..fcd21554eea7 100644
--- a/src/BlazorWebView/src/Maui/Tizen/WebViewExtensions.cs
+++ b/src/BlazorWebView/src/Maui/Tizen/WebViewExtensions.cs
@@ -7,18 +7,18 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
///
/// WebViewExtension
///
- internal static class WebViewExtensions
- {
- public const string ChromiumEwk = "libchromium-ewk.so";
+ internal static class WebViewExtensions
+ {
+ public const string ChromiumEwk = "libchromium-ewk.so";
- public static void SetInterceptRequestCallback(this TWebView webView, InterceptRequestCallback callback)
- {
+ public static void SetInterceptRequestCallback(this TWebView webView, InterceptRequestCallback callback)
+ {
var context = webView.GetContext();
var handleField = context.GetType().GetField("_handle", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
- var contextHandle = (IntPtr?)handleField?.GetValue(context);
+ var contextHandle = (IntPtr?)handleField?.GetValue(context);
if (contextHandle != null)
ewk_context_intercept_request_callback_set(contextHandle.Value, callback, IntPtr.Zero);
- }
+ }
public static void SetInspectorStart(this TWebView webView, uint port)
{
@@ -30,27 +30,27 @@ public static void SetInspectorStart(this TWebView webView, uint port)
}
public static bool SetInterceptRequestResponse(this TWebView webView, IntPtr request, string header, byte[] body, uint length)
- {
- return ewk_intercept_request_response_set(request, header, body, length);
- }
+ {
+ return ewk_intercept_request_response_set(request, header, body, length);
+ }
public static bool IgnoreInterceptRequest(this TWebView webView, IntPtr request)
- {
- return ewk_intercept_request_ignore(request);
- }
+ {
+ return ewk_intercept_request_ignore(request);
+ }
public static string GetInterceptRequestUrl(this TWebView webView, IntPtr request)
{
return Marshal.PtrToStringAnsi(_ewk_intercept_request_url_get(request)) ?? string.Empty;
- }
+ }
- [DllImport(ChromiumEwk)]
+ [DllImport(ChromiumEwk)]
internal static extern IntPtr ewk_view_context_get(IntPtr obj);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate void InterceptRequestCallback(IntPtr context, IntPtr request, IntPtr userData);
+ public delegate void InterceptRequestCallback(IntPtr context, IntPtr request, IntPtr userData);
- [DllImport(ChromiumEwk)]
+ [DllImport(ChromiumEwk)]
internal static extern void ewk_context_intercept_request_callback_set(IntPtr context, InterceptRequestCallback callback, IntPtr userData);
[DllImport(ChromiumEwk, EntryPoint = "ewk_intercept_request_url_get")]
@@ -62,7 +62,7 @@ public static string GetInterceptRequestUrl(this TWebView webView, IntPtr reques
internal static string ewk_intercept_request_http_method_get(IntPtr request)
{
return Marshal.PtrToStringAnsi(_ewk_intercept_request_http_method_get(request)) ?? string.Empty;
- }
+ }
[DllImport(ChromiumEwk)]
public static extern uint ewk_context_inspector_server_start(IntPtr context, uint port);
diff --git a/src/BlazorWebView/src/Maui/Windows/WinUIWebViewManager.cs b/src/BlazorWebView/src/Maui/Windows/WinUIWebViewManager.cs
index 0572cb838ba5..640d8dac3382 100644
--- a/src/BlazorWebView/src/Maui/Windows/WinUIWebViewManager.cs
+++ b/src/BlazorWebView/src/Maui/Windows/WinUIWebViewManager.cs
@@ -132,7 +132,7 @@ protected override async Task HandleWebResourceRequest(CoreWebView2WebResourceRe
await stream.WriteAsync(memStream.GetWindowsRuntimeBuffer());
}
}
-
+
var hotReloadedContent = Stream.Null;
if (StaticContentHotReloadManager.TryReplaceResponseContent(_contentRootRelativeToAppRoot, requestUri, ref statusCode, ref hotReloadedContent, headers))
{
diff --git a/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs b/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs
index 49a38cb5a9cf..b28f0aa65269 100644
--- a/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs
+++ b/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs
@@ -34,9 +34,12 @@ internal class IOSWebViewManager : WebViewManager
/// Path to the directory containing application content files.
/// Path to the host page within the fileProvider.
- public IOSWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler!!, WKWebView webview!!, IServiceProvider provider, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
+ public IOSWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler, WKWebView webview, IServiceProvider provider, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
: base(provider, dispatcher, BlazorWebViewHandler.AppOriginUri, fileProvider, jsComponents, hostPageRelativePath)
{
+ ArgumentNullException.ThrowIfNull(nameof(blazorMauiWebViewHandler));
+ ArgumentNullException.ThrowIfNull(nameof(webview));
+
if (provider.GetService() is null)
{
throw new InvalidOperationException(
diff --git a/src/BlazorWebView/src/SharedSource/BlazorWebViewDeveloperTools.cs b/src/BlazorWebView/src/SharedSource/BlazorWebViewDeveloperTools.cs
index 0f088fb3d261..424fd1f3d22d 100644
--- a/src/BlazorWebView/src/SharedSource/BlazorWebViewDeveloperTools.cs
+++ b/src/BlazorWebView/src/SharedSource/BlazorWebViewDeveloperTools.cs
@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
#endif
{
internal class BlazorWebViewDeveloperTools
- {
- public bool Enabled { get; set; } = false;
- }
+{
+ public bool Enabled { get; set; } = false;
+}
}
diff --git a/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs b/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs
index 20150d38c056..65765deacd7a 100644
--- a/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs
+++ b/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs
@@ -54,14 +54,14 @@ public static IMauiBlazorWebViewBuilder AddMauiBlazorWebView(this IServiceCollec
#endif
}
- ///
- /// Enables Developer tools on the underlying WebView controls.
- ///
- /// The .
- /// The .
- public static IServiceCollection AddBlazorWebViewDeveloperTools(this IServiceCollection services)
- {
- return services.AddSingleton(new BlazorWebViewDeveloperTools { Enabled = true });
- }
+///
+/// Enables Developer tools on the underlying WebView controls.
+///
+/// The .
+/// The .
+public static IServiceCollection AddBlazorWebViewDeveloperTools(this IServiceCollection services)
+{
+ return services.AddSingleton(new BlazorWebViewDeveloperTools { Enabled = true });
+}
}
}
diff --git a/src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs b/src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs
index 470b4e39dac9..ee2fad5f4dac 100644
--- a/src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs
+++ b/src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs
@@ -86,7 +86,7 @@ internal class WebView2WebViewManager : WebViewManager
/// Callback invoked before the webview is initialized.
/// Callback invoked after the webview is initialized.
internal WebView2WebViewManager(
- WebView2Control webview!!,
+ WebView2Control webview,
IServiceProvider services,
Dispatcher dispatcher,
IFileProvider fileProvider,
@@ -99,6 +99,8 @@ internal WebView2WebViewManager(
: base(services, dispatcher, AppOriginUri, fileProvider, jsComponents, hostPagePathWithinFileProvider)
{
+ ArgumentNullException.ThrowIfNull(webview);
+
#if WEBVIEW2_WINFORMS
if (services.GetService() is null)
{
@@ -143,7 +145,7 @@ internal WebView2WebViewManager(
/// Path to the host page within the .
/// The .
internal WebView2WebViewManager(
- WebView2Control webview!!,
+ WebView2Control webview,
IServiceProvider services,
Dispatcher dispatcher,
IFileProvider fileProvider,
@@ -154,6 +156,8 @@ BlazorWebViewHandler blazorWebViewHandler
)
: base(services, dispatcher, AppOriginUri, fileProvider, jsComponents, hostPagePathWithinFileProvider)
{
+ ArgumentNullException.ThrowIfNull(webview);
+
if (services.GetService() is null)
{
throw new InvalidOperationException(
diff --git a/src/BlazorWebView/src/WindowsForms/PublicAPI.Shipped.txt b/src/BlazorWebView/src/WindowsForms/PublicAPI.Shipped.txt
index 7dc5c58110bf..cd2bf7fbd682 100644
--- a/src/BlazorWebView/src/WindowsForms/PublicAPI.Shipped.txt
+++ b/src/BlazorWebView/src/WindowsForms/PublicAPI.Shipped.txt
@@ -1 +1,51 @@
#nullable enable
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.BlazorWebViewInitializedEventArgs() -> void
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BlazorWebViewInitializingEventArgs() -> void
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.Url.get -> System.Uri!
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.get -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.set -> void
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.CancelLoad = 2 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenExternally = 0 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenInWebView = 1 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.BlazorWebView() -> void
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.BlazorWebViewInitialized -> System.EventHandler?
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.BlazorWebViewInitializing -> System.EventHandler?
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.HostPage.get -> string?
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.HostPage.set -> void
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection!
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.Services.get -> System.IServiceProvider!
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.Services.set -> void
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.UrlLoading -> System.EventHandler?
+Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.WebView.get -> Microsoft.Web.WebView2.WinForms.WebView2!
+Microsoft.AspNetCore.Components.WebView.WindowsForms.IWindowsFormsBlazorWebViewBuilder
+Microsoft.AspNetCore.Components.WebView.WindowsForms.IWindowsFormsBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.ComponentType.get -> System.Type!
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.Parameters.get -> System.Collections.Generic.IDictionary?
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.RootComponent(string! selector, System.Type! componentType, System.Collections.Generic.IDictionary? parameters) -> void
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.Selector.get -> string!
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
+Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection.RootComponentsCollection() -> void
+Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions
+override Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.CreateControlsInstance() -> System.Windows.Forms.Control.ControlCollection!
+override Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.Dispose(bool disposing) -> void
+override Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.OnCreateControl() -> void
+static Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions.Add(this Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection! components, string! selector, System.Collections.Generic.IDictionary? parameters = null) -> void
+static Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions.Remove(this Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection! components, string! selector) -> void
+static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
+static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddWindowsFormsBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.WindowsForms.IWindowsFormsBlazorWebViewBuilder!
+virtual Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.WebView.get -> Microsoft.Web.WebView2.WinForms.WebView2
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.get -> string
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.set -> void
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.get -> Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.set -> void
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.get -> string
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.set -> void
diff --git a/src/BlazorWebView/src/WindowsForms/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/WindowsForms/PublicAPI.Unshipped.txt
index a65d1a9361b1..ab058de62d44 100644
--- a/src/BlazorWebView/src/WindowsForms/PublicAPI.Unshipped.txt
+++ b/src/BlazorWebView/src/WindowsForms/PublicAPI.Unshipped.txt
@@ -1,51 +1 @@
#nullable enable
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.BlazorWebViewInitializedEventArgs() -> void
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BlazorWebViewInitializingEventArgs() -> void
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.Url.get -> System.Uri!
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.get -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.set -> void
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.CancelLoad = 2 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenExternally = 0 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenInWebView = 1 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.BlazorWebView() -> void
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.BlazorWebViewInitialized -> System.EventHandler?
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.BlazorWebViewInitializing -> System.EventHandler?
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.HostPage.get -> string?
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.HostPage.set -> void
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection!
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.Services.get -> System.IServiceProvider!
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.Services.set -> void
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.UrlLoading -> System.EventHandler?
-Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.WebView.get -> Microsoft.Web.WebView2.WinForms.WebView2!
-Microsoft.AspNetCore.Components.WebView.WindowsForms.IWindowsFormsBlazorWebViewBuilder
-Microsoft.AspNetCore.Components.WebView.WindowsForms.IWindowsFormsBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.ComponentType.get -> System.Type!
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.Parameters.get -> System.Collections.Generic.IDictionary?
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.RootComponent(string! selector, System.Type! componentType, System.Collections.Generic.IDictionary? parameters) -> void
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.Selector.get -> string!
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
-Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection.RootComponentsCollection() -> void
-Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions
-override Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.CreateControlsInstance() -> System.Windows.Forms.Control.ControlCollection!
-override Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.Dispose(bool disposing) -> void
-override Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.OnCreateControl() -> void
-static Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions.Add(this Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection! components, string! selector, System.Collections.Generic.IDictionary? parameters = null) -> void
-static Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions.Remove(this Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentsCollection! components, string! selector) -> void
-static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
-static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddWindowsFormsBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.WindowsForms.IWindowsFormsBlazorWebViewBuilder!
-virtual Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.WebView.get -> Microsoft.Web.WebView2.WinForms.WebView2
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.get -> string
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.set -> void
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.get -> Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.set -> void
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.get -> string
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.set -> void
diff --git a/src/BlazorWebView/src/Wpf/PublicAPI.Shipped.txt b/src/BlazorWebView/src/Wpf/PublicAPI.Shipped.txt
index 7dc5c58110bf..bbc3f39f32f3 100644
--- a/src/BlazorWebView/src/Wpf/PublicAPI.Shipped.txt
+++ b/src/BlazorWebView/src/Wpf/PublicAPI.Shipped.txt
@@ -1 +1,61 @@
#nullable enable
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.BlazorWebViewInitializedEventArgs() -> void
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BlazorWebViewInitializingEventArgs() -> void
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.Url.get -> System.Uri!
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.get -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.set -> void
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.CancelLoad = 2 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenExternally = 0 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenInWebView = 1 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebView() -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitialized.get -> System.EventHandler!
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitialized.set -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitializing.get -> System.EventHandler!
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitializing.set -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.DisposeAsync() -> System.Threading.Tasks.ValueTask
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPage.get -> string!
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPage.set -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Wpf.RootComponentsCollection!
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.Services.get -> System.IServiceProvider!
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.Services.set -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.UrlLoading.get -> System.EventHandler!
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.UrlLoading.set -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.WebView.get -> Microsoft.Web.WebView2.Wpf.WebView2!
+Microsoft.AspNetCore.Components.WebView.Wpf.IWpfBlazorWebViewBuilder
+Microsoft.AspNetCore.Components.WebView.Wpf.IWpfBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.ComponentType.get -> System.Type!
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.ComponentType.set -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Parameters.get -> System.Collections.Generic.IDictionary?
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Parameters.set -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.RootComponent() -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Selector.get -> string!
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Selector.set -> void
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponentsCollection
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponentsCollection.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
+Microsoft.AspNetCore.Components.WebView.Wpf.RootComponentsCollection.RootComponentsCollection() -> void
+Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions
+override Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.OnApplyTemplate() -> void
+override Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.OnInitialized(System.EventArgs! e) -> void
+static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
+static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddWpfBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.Wpf.IWpfBlazorWebViewBuilder!
+static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitializedProperty -> System.Windows.DependencyProperty!
+static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitializingProperty -> System.Windows.DependencyProperty!
+static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPageProperty -> System.Windows.DependencyProperty!
+static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.RootComponentsProperty -> System.Windows.DependencyProperty!
+static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.ServicesProperty -> System.Windows.DependencyProperty!
+static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.UrlLoadingProperty -> System.Windows.DependencyProperty!
+virtual Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
+virtual Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.DisposeAsyncCore() -> System.Threading.Tasks.ValueTask
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.WebView.get -> Microsoft.Web.WebView2.Wpf.WebView2
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.get -> string
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.set -> void
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.get -> Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.set -> void
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.get -> string
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.set -> void
diff --git a/src/BlazorWebView/src/Wpf/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Wpf/PublicAPI.Unshipped.txt
index 5feec2cf3564..ab058de62d44 100644
--- a/src/BlazorWebView/src/Wpf/PublicAPI.Unshipped.txt
+++ b/src/BlazorWebView/src/Wpf/PublicAPI.Unshipped.txt
@@ -1,61 +1 @@
#nullable enable
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.BlazorWebViewInitializedEventArgs() -> void
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs
-Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BlazorWebViewInitializingEventArgs() -> void
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.Url.get -> System.Uri!
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.get -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.set -> void
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.CancelLoad = 2 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenExternally = 0 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenInWebView = 1 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebView() -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitialized.get -> System.EventHandler!
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitialized.set -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitializing.get -> System.EventHandler!
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitializing.set -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.DisposeAsync() -> System.Threading.Tasks.ValueTask
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPage.get -> string!
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPage.set -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Wpf.RootComponentsCollection!
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.Services.get -> System.IServiceProvider!
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.Services.set -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.UrlLoading.get -> System.EventHandler!
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.UrlLoading.set -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.WebView.get -> Microsoft.Web.WebView2.Wpf.WebView2!
-Microsoft.AspNetCore.Components.WebView.Wpf.IWpfBlazorWebViewBuilder
-Microsoft.AspNetCore.Components.WebView.Wpf.IWpfBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.ComponentType.get -> System.Type!
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.ComponentType.set -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Parameters.get -> System.Collections.Generic.IDictionary?
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Parameters.set -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.RootComponent() -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Selector.get -> string!
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Selector.set -> void
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponentsCollection
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponentsCollection.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
-Microsoft.AspNetCore.Components.WebView.Wpf.RootComponentsCollection.RootComponentsCollection() -> void
-Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions
-override Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.OnApplyTemplate() -> void
-override Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.OnInitialized(System.EventArgs! e) -> void
-static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
-static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddWpfBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.Wpf.IWpfBlazorWebViewBuilder!
-static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitializedProperty -> System.Windows.DependencyProperty!
-static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebViewInitializingProperty -> System.Windows.DependencyProperty!
-static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPageProperty -> System.Windows.DependencyProperty!
-static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.RootComponentsProperty -> System.Windows.DependencyProperty!
-static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.ServicesProperty -> System.Windows.DependencyProperty!
-static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.UrlLoadingProperty -> System.Windows.DependencyProperty!
-virtual Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
-virtual Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.DisposeAsyncCore() -> System.Threading.Tasks.ValueTask
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.WebView.get -> Microsoft.Web.WebView2.Wpf.WebView2
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.get -> string
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BrowserExecutableFolder.set -> void
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.get -> Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.EnvironmentOptions.set -> void
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.get -> string
-~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.UserDataFolder.set -> void
diff --git a/src/BlazorWebView/tests/MauiDeviceTests/HandlerTestBase.Windows.cs b/src/BlazorWebView/tests/MauiDeviceTests/HandlerTestBase.Windows.cs
index 08d4a8edb172..7d5a5988c169 100644
--- a/src/BlazorWebView/tests/MauiDeviceTests/HandlerTestBase.Windows.cs
+++ b/src/BlazorWebView/tests/MauiDeviceTests/HandlerTestBase.Windows.cs
@@ -7,7 +7,7 @@ namespace Microsoft.Maui.MauiBlazorWebView.DeviceTests
public partial class HandlerTestBase
{
protected bool GetIsAccessibilityElement(IViewHandler viewHandler) =>
- ((AccessibilityView)((DependencyObject)viewHandler.PlatformView).GetValue(NativeAutomationProperties.AccessibilityViewProperty))
+ ((AccessibilityView)((DependencyObject)viewHandler.PlatformView).GetValue(NativeAutomationProperties.AccessibilityViewProperty))
== AccessibilityView.Content;
}
}
diff --git a/src/BlazorWebView/tests/MauiDeviceTests/TestBase.cs b/src/BlazorWebView/tests/MauiDeviceTests/TestBase.cs
index 2e467323944c..dfba5b70da96 100644
--- a/src/BlazorWebView/tests/MauiDeviceTests/TestBase.cs
+++ b/src/BlazorWebView/tests/MauiDeviceTests/TestBase.cs
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
-using Microsoft.Maui.Dispatching;
using Microsoft.Maui.DeviceTests;
+using Microsoft.Maui.Dispatching;
using Microsoft.Maui.TestUtils.DeviceTests.Runners;
namespace Microsoft.Maui.MauiBlazorWebView.DeviceTests
diff --git a/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj b/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj
index 8bc2e5157ad9..64a22cd4ae1c 100644
--- a/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj
+++ b/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj
@@ -29,6 +29,10 @@
android
+
+ True
+
+
diff --git a/src/Compatibility/ControlGallery/src/EmbeddingTestBeds/Embedding.Droid/MainActivity.cs b/src/Compatibility/ControlGallery/src/EmbeddingTestBeds/Embedding.Droid/MainActivity.cs
index 83f7c9699f8e..f437f30f87ec 100644
--- a/src/Compatibility/ControlGallery/src/EmbeddingTestBeds/Embedding.Droid/MainActivity.cs
+++ b/src/Compatibility/ControlGallery/src/EmbeddingTestBeds/Embedding.Droid/MainActivity.cs
@@ -33,8 +33,8 @@ protected override void OnCreate(Bundle bundle)
Forms.Init(this, null);
- SetContentView (Resource.Layout.Main);
-
+ SetContentView(Resource.Layout.Main);
+
var ft = SupportFragmentManager.BeginTransaction();
ft.Replace(Resource.Id.fragment_frame_layout, new MainFragment(), "main");
ft.Commit();
@@ -54,7 +54,7 @@ public void ShowWebView()
{
if (_webview == null)
{
- _webview= new WebViewExample().CreateSupportFragment(this);
+ _webview = new WebViewExample().CreateSupportFragment(this);
}
ShowEmbeddedPageFragment(_webview);
@@ -66,12 +66,12 @@ public void ShowOpenUri()
_openUri = new OpenUri().CreateSupportFragment(this);
}
- ShowEmbeddedPageFragment(_openUri );
+ ShowEmbeddedPageFragment(_openUri);
}
public void ShowAlertsAndActionSheets()
{
- if (_alertsAndActionSheets== null)
+ if (_alertsAndActionSheets == null)
{
_alertsAndActionSheets = new AlertsAndActionSheets().CreateSupportFragment(this);
}
@@ -85,7 +85,7 @@ void ShowEmbeddedPageFragment(Fragment fragment)
ft.AddToBackStack(null);
ft.Replace(Resource.Id.fragment_frame_layout, fragment, "hello");
-
+
ft.Commit();
}
@@ -99,7 +99,7 @@ public class MainFragment : Fragment
{
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
- var view = inflater.Inflate(Resource.Layout.MainFragment, container, false);
+ var view = inflater.Inflate(Resource.Layout.MainFragment, container, false);
var showEmbeddedButton = view.FindViewById
diff --git a/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj b/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj
index 96d74f484746..339b0290e173 100644
--- a/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj
+++ b/src/Compatibility/ControlGallery/test/WinUI.UITests/WinUI.UITests.csproj
@@ -23,7 +23,7 @@
-
+
diff --git a/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj b/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj
index c544d0026d50..4e3d9c8d10cf 100644
--- a/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj
+++ b/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/src/Compatibility/Core.LegacyRenderers/Android/Cells/CellAdapter.cs b/src/Compatibility/Core.LegacyRenderers/Android/Cells/CellAdapter.cs
index de0eef6d87cc..833f81c2ca00 100644
--- a/src/Compatibility/Core.LegacyRenderers/Android/Cells/CellAdapter.cs
+++ b/src/Compatibility/Core.LegacyRenderers/Android/Cells/CellAdapter.cs
@@ -10,7 +10,7 @@
using AListView = Android.Widget.ListView;
using AView = Android.Views.View;
using Microsoft.Maui.Controls.Platform;
-#if NET6_0
+#if NET6_0_OR_GREATER
using AMenu = Android.Views.IMenu;
#else
using AMenu = Android.Views.Menu;
diff --git a/src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs
index e2555e1d95a1..b9d0db7f0448 100644
--- a/src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs
+++ b/src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs
@@ -120,7 +120,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
UpdateTextColor();
else if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
UpdateEnabled();
- else if ( e.PropertyName == FontElement.FontAttributesProperty.PropertyName
+ else if (e.PropertyName == FontElement.FontAttributesProperty.PropertyName
|| e.PropertyName == FontElement.FontAutoScalingEnabledProperty.PropertyName
|| e.PropertyName == FontElement.FontFamilyProperty.PropertyName
|| e.PropertyName == FontElement.FontSizeProperty.PropertyName)
diff --git a/src/Compatibility/Core/src/Android/FastRenderers/ButtonRenderer.cs b/src/Compatibility/Core/src/Android/FastRenderers/ButtonRenderer.cs
index 86ee5683c2b8..290aa9fb9684 100644
--- a/src/Compatibility/Core/src/Android/FastRenderers/ButtonRenderer.cs
+++ b/src/Compatibility/Core/src/Android/FastRenderers/ButtonRenderer.cs
@@ -252,7 +252,7 @@ protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEv
{
UpdateTextColor();
}
- else if ( e.PropertyName == FontElement.FontAttributesProperty.PropertyName
+ else if (e.PropertyName == FontElement.FontAttributesProperty.PropertyName
|| e.PropertyName == FontElement.FontAutoScalingEnabledProperty.PropertyName
|| e.PropertyName == FontElement.FontFamilyProperty.PropertyName
|| e.PropertyName == FontElement.FontSizeProperty.PropertyName)
diff --git a/src/Compatibility/Core/src/Compatibility.csproj b/src/Compatibility/Core/src/Compatibility.csproj
index 635e411fb18a..ddc7532377d0 100644
--- a/src/Compatibility/Core/src/Compatibility.csproj
+++ b/src/Compatibility/Core/src/Compatibility.csproj
@@ -10,6 +10,8 @@
Tizen\
false
true
+ true
+ $(NoWarn);CS1591
diff --git a/src/Compatibility/Core/src/MacOS/Cells/CellNSView.cs b/src/Compatibility/Core/src/MacOS/Cells/CellNSView.cs
index 11b0736342e4..b0b0eca02832 100644
--- a/src/Compatibility/Core/src/MacOS/Cells/CellNSView.cs
+++ b/src/Compatibility/Core/src/MacOS/Cells/CellNSView.cs
@@ -168,8 +168,10 @@ internal static NSView GetNativeCell(NSTableView tableView, Cell cell, string te
if (string.IsNullOrEmpty(nativeCell.Identifier))
nativeCell.Identifier = templateId;
- if (!isHeader) return nativeCell;
- if (nativeCell.Layer != null) nativeCell.Layer.BackgroundColor = ColorExtensions.GroupedBackground.CGColor;
+ if (!isHeader)
+ return nativeCell;
+ if (nativeCell.Layer != null)
+ nativeCell.Layer.BackgroundColor = ColorExtensions.GroupedBackground.CGColor;
return nativeCell;
}
diff --git a/src/Compatibility/Core/src/MacOS/Extensions/BrushExtensions.cs b/src/Compatibility/Core/src/MacOS/Extensions/BrushExtensions.cs
index cf81fa648001..68a95d68bac7 100644
--- a/src/Compatibility/Core/src/MacOS/Extensions/BrushExtensions.cs
+++ b/src/Compatibility/Core/src/MacOS/Extensions/BrushExtensions.cs
@@ -175,6 +175,6 @@ static bool ShouldUseParentView(NSView view)
return false;
}
-
+
}
}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/MacOS/Extensions/FontExtensions.cs b/src/Compatibility/Core/src/MacOS/Extensions/FontExtensions.cs
index 2a148a2d66b9..6d288c4fdbaf 100644
--- a/src/Compatibility/Core/src/MacOS/Extensions/FontExtensions.cs
+++ b/src/Compatibility/Core/src/MacOS/Extensions/FontExtensions.cs
@@ -32,7 +32,7 @@ static NSFont _ToNativeFont(string family, float size, FontAttributes attributes
var cleansedFont = CleanseFontName(family);
font = NSFont.FromFontName(cleansedFont, size);
}
-
+
}
catch
{
@@ -46,7 +46,7 @@ static NSFont _ToNativeFont(string family, float size, FontAttributes attributes
font = defaultFont;
descriptor = defaultFont.FontDescriptor;
}
-
+
if (descriptor == null)
descriptor = defaultFont.FontDescriptor;
@@ -63,7 +63,7 @@ static NSFont _ToNativeFont(string family, float size, FontAttributes attributes
font = NSFont.FromDescription(fontDescriptorWithTraits, size);
}
-
+
return font.ScreenFontWithRenderingMode(NSFontRenderingMode.AntialiasedIntegerAdvancements);
}
diff --git a/src/Compatibility/Core/src/MacOS/Extensions/NSAttributedStringExtensions.cs b/src/Compatibility/Core/src/MacOS/Extensions/NSAttributedStringExtensions.cs
index a2fdd56977eb..773cae7eda77 100644
--- a/src/Compatibility/Core/src/MacOS/Extensions/NSAttributedStringExtensions.cs
+++ b/src/Compatibility/Core/src/MacOS/Extensions/NSAttributedStringExtensions.cs
@@ -3,51 +3,51 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS
{
- internal static class NSAttributedStringExtensions
- {
- internal static NSMutableAttributedString AddCharacterSpacing(this NSMutableAttributedString attributedString, string text, double characterSpacing)
- {
- if (attributedString == null || attributedString.Length == 0)
- {
- attributedString = text == null ? new NSMutableAttributedString() : new NSMutableAttributedString(text);
- }
- else
- {
- attributedString = new NSMutableAttributedString(attributedString);
- }
+ internal static class NSAttributedStringExtensions
+ {
+ internal static NSMutableAttributedString AddCharacterSpacing(this NSMutableAttributedString attributedString, string text, double characterSpacing)
+ {
+ if (attributedString == null || attributedString.Length == 0)
+ {
+ attributedString = text == null ? new NSMutableAttributedString() : new NSMutableAttributedString(text);
+ }
+ else
+ {
+ attributedString = new NSMutableAttributedString(attributedString);
+ }
- AddKerningAdjustment(attributedString, text, characterSpacing);
+ AddKerningAdjustment(attributedString, text, characterSpacing);
- return attributedString;
- }
+ return attributedString;
+ }
- internal static NSMutableAttributedString AddCharacterSpacing(this NSAttributedString attributedString, string text, double characterSpacing)
- {
- NSMutableAttributedString mutableAttributedString;
- if (attributedString == null || attributedString.Length == 0)
- {
- mutableAttributedString = text == null ? new NSMutableAttributedString() : new NSMutableAttributedString(text);
- }
- else
- {
- mutableAttributedString = new NSMutableAttributedString(attributedString);
- }
+ internal static NSMutableAttributedString AddCharacterSpacing(this NSAttributedString attributedString, string text, double characterSpacing)
+ {
+ NSMutableAttributedString mutableAttributedString;
+ if (attributedString == null || attributedString.Length == 0)
+ {
+ mutableAttributedString = text == null ? new NSMutableAttributedString() : new NSMutableAttributedString(text);
+ }
+ else
+ {
+ mutableAttributedString = new NSMutableAttributedString(attributedString);
+ }
- AddKerningAdjustment(mutableAttributedString, text, characterSpacing);
+ AddKerningAdjustment(mutableAttributedString, text, characterSpacing);
- return mutableAttributedString;
- }
+ return mutableAttributedString;
+ }
- internal static void AddKerningAdjustment(NSMutableAttributedString mutableAttributedString, string text, double characterSpacing)
- {
- if (!string.IsNullOrEmpty(text))
- {
- mutableAttributedString.AddAttribute
- (
- NSStringAttributeKey.KerningAdjustment,
- NSObject.FromObject(characterSpacing), new NSRange(0, text.Length - 1)
- );
- }
- }
- }
+ internal static void AddKerningAdjustment(NSMutableAttributedString mutableAttributedString, string text, double characterSpacing)
+ {
+ if (!string.IsNullOrEmpty(text))
+ {
+ mutableAttributedString.AddAttribute
+ (
+ NSStringAttributeKey.KerningAdjustment,
+ NSObject.FromObject(characterSpacing), new NSRange(0, text.Length - 1)
+ );
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/MacOS/FormsApplicationDelegate.cs b/src/Compatibility/Core/src/MacOS/FormsApplicationDelegate.cs
index 901a41717e37..023a21ea30d4 100644
--- a/src/Compatibility/Core/src/MacOS/FormsApplicationDelegate.cs
+++ b/src/Compatibility/Core/src/MacOS/FormsApplicationDelegate.cs
@@ -31,7 +31,7 @@ protected void LoadApplication(Application application)
Application.SetCurrentApplication(application);
_application = application;
- if(NSApplication.SharedApplication.MainMenu != null)
+ if (NSApplication.SharedApplication.MainMenu != null)
_storyboardMainMenuCount = (int)NSApplication.SharedApplication.MainMenu.Count;
application.PropertyChanged += ApplicationOnPropertyChanged;
@@ -56,7 +56,8 @@ public override void DidBecomeActive(Foundation.NSNotification notification)
{
// applicationDidBecomeActive
// execute any OpenGL ES drawing calls
- if (_application == null || !_isSuspended) return;
+ if (_application == null || !_isSuspended)
+ return;
_isSuspended = false;
_application.SendResume();
}
@@ -64,7 +65,8 @@ public override void DidBecomeActive(Foundation.NSNotification notification)
public override void DidResignActive(Foundation.NSNotification notification)
{
// applicationWillResignActive
- if (_application == null) return;
+ if (_application == null)
+ return;
_isSuspended = true;
_application.SendSleep();
}
diff --git a/src/Compatibility/Core/src/MacOS/ImageSourceHandlers.cs b/src/Compatibility/Core/src/MacOS/ImageSourceHandlers.cs
index 87a9a5377c44..08eae3ce7425 100644
--- a/src/Compatibility/Core/src/MacOS/ImageSourceHandlers.cs
+++ b/src/Compatibility/Core/src/MacOS/ImageSourceHandlers.cs
@@ -43,7 +43,8 @@ public async Task LoadImageAsync(ImageSource imagesource,
{
NSImage image = null;
var streamsource = imagesource as StreamImageSource;
- if (streamsource?.Stream == null) return null;
+ if (streamsource?.Stream == null)
+ return null;
using (
var streamImage = await ((IStreamImageSource)streamsource).GetStreamAsync(cancelationToken).ConfigureAwait(false))
{
@@ -81,7 +82,7 @@ public Task LoadImageAsync(
ImageSource imagesource,
CancellationToken cancelationToken = default(CancellationToken),
float scale = 1f)
- {
+ {
NSImage image = null;
var fontsource = imagesource as FontImageSource;
if (fontsource != null)
diff --git a/src/Compatibility/Core/src/MacOS/ModalPageTracker.cs b/src/Compatibility/Core/src/MacOS/ModalPageTracker.cs
index b7e31e119587..1737f459e794 100644
--- a/src/Compatibility/Core/src/MacOS/ModalPageTracker.cs
+++ b/src/Compatibility/Core/src/MacOS/ModalPageTracker.cs
@@ -45,11 +45,11 @@ internal void LayoutSubviews()
{
if (_renderer == null || _renderer.View == null)
return;
-
- foreach(var modal in _modals)
+
+ foreach (var modal in _modals)
{
var modalRenderer = Platform.GetRenderer(modal);
- if(modalRenderer != null)
+ if (modalRenderer != null)
modalRenderer.SetElementSize(new Size(_renderer.View.Bounds.Width, _renderer.View.Bounds.Height));
}
}
@@ -127,7 +127,7 @@ Task HideModalAsync(Page modal, bool animated)
{
modal.DisposeModalAndChildRenderers();
var removingIndex = Array.IndexOf(_renderer.ChildViewControllers, controller);
- if(removingIndex >= 0)
+ if (removingIndex >= 0)
_renderer.RemoveChildViewController(removingIndex);
}, modal);
return task;
diff --git a/src/Compatibility/Core/src/MacOS/NativeToolbarTracker.cs b/src/Compatibility/Core/src/MacOS/NativeToolbarTracker.cs
index 3c12da30707a..81667b1fb2e3 100644
--- a/src/Compatibility/Core/src/MacOS/NativeToolbarTracker.cs
+++ b/src/Compatibility/Core/src/MacOS/NativeToolbarTracker.cs
@@ -122,7 +122,7 @@ public override NSToolbarItem WillInsertItem(NSToolbar toolbar, string itemIdent
group.View = view;
if (itemIdentifier == NavigationGroupIdentifier)
- _navigationGroup = new NativeToolbarGroup(group,BackButtonItemWidth);
+ _navigationGroup = new NativeToolbarGroup(group, BackButtonItemWidth);
else if (itemIdentifier == TitleGroupIdentifier)
_titleGroup = new NativeToolbarGroup(group);
else if (itemIdentifier == TabbedGroupIdentifier)
@@ -231,7 +231,8 @@ void UpdateBarBackgroundColor()
var bgColor = GetBackgroundColor().CGColor;
if (_nsToolbarItemViewer?.Superview?.Superview == null ||
- _nsToolbarItemViewer.Superview.Superview.Superview == null) return;
+ _nsToolbarItemViewer.Superview.Superview.Superview == null)
+ return;
// NSTitlebarView
_nsToolbarItemViewer.Superview.Superview.Superview.WantsLayer = true;
_nsToolbarItemViewer.Superview.Superview.Superview.Layer.BackgroundColor = bgColor;
diff --git a/src/Compatibility/Core/src/MacOS/Platform.cs b/src/Compatibility/Core/src/MacOS/Platform.cs
index 3e883b7ecfe7..02036b4edfa0 100644
--- a/src/Compatibility/Core/src/MacOS/Platform.cs
+++ b/src/Compatibility/Core/src/MacOS/Platform.cs
@@ -45,13 +45,16 @@ internal Platform()
{
int maxScrollHeight = (int)(0.6 * NSScreen.MainScreen.Frame.Height);
NSView extraButtons = GetExtraButton(arguments);
- if (extraButtons.Frame.Height > maxScrollHeight) {
+ if (extraButtons.Frame.Height > maxScrollHeight)
+ {
NSScrollView scrollView = new NSScrollView();
scrollView.Frame = new RectangleF(0, 0, extraButtons.Frame.Width, maxScrollHeight);
scrollView.DocumentView = extraButtons;
scrollView.HasVerticalScroller = true;
alert.AccessoryView = scrollView;
- } else {
+ }
+ else
+ {
alert.AccessoryView = extraButtons;
}
alert.Layout();
@@ -104,7 +107,7 @@ void IDisposable.Dispose()
Page.DisposeModalAndChildRenderers();
//foreach (var modal in _modals)
- //modal.DisposeModalAndChildRenderers();
+ //modal.DisposeModalAndChildRenderers();
_renderer.Dispose();
}
diff --git a/src/Compatibility/Core/src/MacOS/PlatformNavigation.cs b/src/Compatibility/Core/src/MacOS/PlatformNavigation.cs
index 9be3921c8c6f..4c893d7da6e4 100644
--- a/src/Compatibility/Core/src/MacOS/PlatformNavigation.cs
+++ b/src/Compatibility/Core/src/MacOS/PlatformNavigation.cs
@@ -71,7 +71,7 @@ Task INavigation.PopModalAsync()
}
Task INavigation.PushModalAsync(Page modal, bool animated)
- {
+ {
return _modalTracker.PushAsync(modal, _animateModals && animated);
}
diff --git a/src/Compatibility/Core/src/MacOS/Properties/AssemblyInfo.cs b/src/Compatibility/Core/src/MacOS/Properties/AssemblyInfo.cs
index 05ac0b7247a6..e842345ef5de 100644
--- a/src/Compatibility/Core/src/MacOS/Properties/AssemblyInfo.cs
+++ b/src/Compatibility/Core/src/MacOS/Properties/AssemblyInfo.cs
@@ -12,7 +12,8 @@
[assembly: ExportImageSourceHandler(typeof(FontImageSource), typeof(FontImageSourceHandler))]
[assembly: ExportRenderer(typeof(Page), typeof(PageRenderer))]
#pragma warning disable CS0618 // Type or member is obsolete
-[assembly: ExportRenderer(typeof(CarouselPage), typeof(CarouselPageRenderer))][assembly: ExportRenderer(typeof(MasterDetailPage), typeof(MasterDetailPageRenderer))]
+[assembly: ExportRenderer(typeof(CarouselPage), typeof(CarouselPageRenderer))]
+[assembly: ExportRenderer(typeof(MasterDetailPage), typeof(MasterDetailPageRenderer))]
#pragma warning restore CS0618 // Type or member is obsolete
[assembly: ExportRenderer(typeof(FlyoutPage), typeof(FlyoutPageRenderer))]
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/ActivityIndicatorRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/ActivityIndicatorRenderer.cs
index d80d8ac898f1..5943d99baf5f 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/ActivityIndicatorRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/ActivityIndicatorRenderer.cs
@@ -47,7 +47,7 @@ void UpdateColor()
var newColor = Element.Color.ToNSColor();
if (Equals(s_currentColor, newColor))
{
- if(Control.ContentFilters?.FirstOrDefault() != s_currentColorFilter)
+ if (Control.ContentFilters?.FirstOrDefault() != s_currentColorFilter)
{
Control.ContentFilters = new CIFilter[] { s_currentColorFilter };
}
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/BoxViewRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/BoxViewRenderer.cs
index c9ba6d5fef0e..5905c21982f6 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/BoxViewRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/BoxViewRenderer.cs
@@ -27,7 +27,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
if (Control == null)
{
var boxView = new FormsBoxView();
- SetNativeControl (boxView);
+ SetNativeControl(boxView);
}
SetBackgroundColor(Element.Color);
@@ -86,7 +86,7 @@ void SetCornerRadius(CornerRadius cornerRadius)
Control.Layer.MasksToBounds = true;
- (Control as FormsBoxView)?.SetCornerRadius ((float)cornerRadius.TopLeft, (float)cornerRadius.TopRight, (float)cornerRadius.BottomLeft, (float)cornerRadius.BottomRight);
+ (Control as FormsBoxView)?.SetCornerRadius((float)cornerRadius.TopLeft, (float)cornerRadius.TopRight, (float)cornerRadius.BottomLeft, (float)cornerRadius.BottomRight);
}
}
}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/ButtonRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/ButtonRenderer.cs
index f9ce3da3c793..bdf056a8b090 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/ButtonRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/ButtonRenderer.cs
@@ -97,7 +97,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
var btn = new FormsNSButton();
btn.SetButtonType(NSButtonType.MomentaryPushIn);
btn.BezelStyle = NSBezelStyle.TexturedSquare;
-
+
btn.Pressed += HandleButtonPressed;
btn.Released += HandleButtonReleased;
SetNativeControl(btn);
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/CarouselPageRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/CarouselPageRenderer.cs
index 87c2029e5352..794931ccbeeb 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/CarouselPageRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/CarouselPageRenderer.cs
@@ -167,7 +167,7 @@ void UpdateSource()
{
if (Element.LogicalChildren.Count == 0 && ArrangedObjects.Length == 0)
return;
-
+
var pages = new List();
for (var i = 0; i < Element.LogicalChildren.Count; i++)
{
@@ -233,7 +233,8 @@ void UpdateCurrentPage(bool animated = true)
if (animated)
NSAnimationContext.RunAnimation(context => { ((NSPageController)Animator).SelectedIndex = index; },
CompleteTransition);
- else SelectedIndex = index;
+ else
+ SelectedIndex = index;
}
}
}
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/DatePickerRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/DatePickerRenderer.cs
index c95588086e47..0d8c5d5ed0d2 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/DatePickerRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/DatePickerRenderer.cs
@@ -116,7 +116,7 @@ void UpdateDateFromModel()
void UpdateFont()
{
if (Control == null || Element == null)
- return;
+ return;
var newFont = Element.ToNSFont();
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/EditorRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/EditorRenderer.cs
index bc6dfb12e905..72214b3863bc 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/EditorRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/EditorRenderer.cs
@@ -48,7 +48,8 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
};
}
- if (e.NewElement == null) return;
+ if (e.NewElement == null)
+ return;
UpdateText();
UpdateFont();
UpdateTextColor();
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/EntryRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/EntryRenderer.cs
index c3f8e1b025e6..09db9b11ecc1 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/EntryRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/EntryRenderer.cs
@@ -328,7 +328,7 @@ void UpdateText()
if (IsElementOrControlEmpty)
return;
- var text = Element.UpdateFormsText(Element.Text, Element.TextTransform);
+ var text = Element.UpdateFormsText(Element.Text, Element.TextTransform);
// ReSharper disable once RedundantCheckBeforeAssignment
if (Control.StringValue != text)
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/FlyoutPageRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/FlyoutPageRenderer.cs
index c2dc132ebbdc..4d88fdaa3c79 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/FlyoutPageRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/FlyoutPageRenderer.cs
@@ -152,7 +152,7 @@ void UpdateIsPresented()
// Ignore the IsPresented value being set to false for Split mode on desktop
// and allow the master view to be made initially visible
- if (DeviceInfo.Idiom == DeviceIdiom.Desktop && !view.Hidden && FlyoutPage.FlyoutLayoutBehavior != FlyoutLayoutBehavior.Popover)
+ if (DeviceInfo.Idiom == DeviceIdiom.Desktop && !view.Hidden && FlyoutPage.FlyoutLayoutBehavior != FlyoutLayoutBehavior.Popover)
return;
if (FlyoutPage.IsPresented && view.Hidden)
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/NavigationPageRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/NavigationPageRenderer.cs
index 09aa4e284ac5..0481ce102742 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/NavigationPageRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/NavigationPageRenderer.cs
@@ -117,7 +117,7 @@ protected override void Dispose(bool disposing)
_events?.Dispose();
_events = null;
- if(_currentStack != null)
+ if (_currentStack != null)
{
foreach (var childPageWrapper in _currentStack)
{
@@ -394,7 +394,7 @@ async Task AddPage(Page page, bool animated)
var vco = Platform.GetRenderer(oldPage);
AddChildViewController(vc.ViewController);
- var transitionStyle = NavigationPage.OnThisPlatform().GetNavigationTransitionPushStyle();
+ var transitionStyle = NavigationPage.OnThisPlatform().GetNavigationTransitionPushStyle();
return await this.HandleAsyncAnimation(vco.ViewController, vc.ViewController,
ToViewControllerTransitionOptions(transitionStyle), () =>
{
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/PageRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/PageRenderer.cs
index a91ed1b08f5c..b60bd1cea0c3 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/PageRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/PageRenderer.cs
@@ -238,7 +238,7 @@ NSView GetNativeControl(VisualElement visualElement)
void UpdateTabOrder()
{
var tabOrderElements = ((Page)Element).OnThisPlatform().GetTabOrder();
- if(tabOrderElements != null && tabOrderElements.Length > 0)
+ if (tabOrderElements != null && tabOrderElements.Length > 0)
{
var count = tabOrderElements.Length;
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/ProgressBarRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/ProgressBarRenderer.cs
index 54ead01778db..74853b168369 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/ProgressBarRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/ProgressBarRenderer.cs
@@ -12,7 +12,8 @@ public class ProgressBarRenderer : ViewRenderer e)
{
- if (e.NewElement == null) return;
+ if (e.NewElement == null)
+ return;
if (Control == null)
SetNativeControl(new NSProgressIndicator
{
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/ScrollViewRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/ScrollViewRenderer.cs
index 894a740e7408..97ca74056083 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/ScrollViewRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/ScrollViewRenderer.cs
@@ -263,7 +263,7 @@ void UpdateHorizontalScrollBarVisibility()
HasHorizontalScroller = (ScrollView.HorizontalScrollBarVisibility == ScrollBarVisibility.Always);
}
- private bool ResetNativeNonScroll( )
+ private bool ResetNativeNonScroll()
{
if (ContentView == null || ScrollView == null || ScrollView.Content == null)
return false;
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/SliderRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/SliderRenderer.cs
index be330cd08975..bb046059db5d 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/SliderRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/SliderRenderer.cs
@@ -16,7 +16,7 @@ internal class FormsSliderCell : NSSliderCell
public Color ThumbColor { get; set; }
public override void DrawBar(CGRect aRect, bool flipped)
- {
+ {
// Mimick the dimensions of the original slider
var originalHeight = aRect.Height;
aRect.Height = 2.7f;
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/TabbedPageRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/TabbedPageRenderer.cs
index f26e47840c93..2941e78bc861 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/TabbedPageRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/TabbedPageRenderer.cs
@@ -44,7 +44,8 @@ public void SetElement(VisualElement element)
{
oldElement.PropertyChanged -= OnElementPropertyChanged;
var tabbedPage = oldElement as TabbedPage;
- if (tabbedPage != null) tabbedPage.PagesChanged -= OnPagesChanged;
+ if (tabbedPage != null)
+ tabbedPage.PagesChanged -= OnPagesChanged;
}
if (element != null)
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/TableViewDataSource.cs b/src/Compatibility/Core/src/MacOS/Renderers/TableViewDataSource.cs
index 8dd6a9069648..90f1a4813914 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/TableViewDataSource.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/TableViewDataSource.cs
@@ -94,9 +94,9 @@ public override NSView GetViewForItem(NSTableView tableView, NSTableColumn table
protected override void Dispose(bool disposing)
{
- if(disposing)
+ if (disposing)
{
- if(!_disposed)
+ if (!_disposed)
{
_nsTableView = null;
_tableView = null;
diff --git a/src/Compatibility/Core/src/MacOS/Renderers/WebViewRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/WebViewRenderer.cs
index 418a7ab53eed..bae04cf363d0 100644
--- a/src/Compatibility/Core/src/MacOS/Renderers/WebViewRenderer.cs
+++ b/src/Compatibility/Core/src/MacOS/Renderers/WebViewRenderer.cs
@@ -33,7 +33,7 @@ void IWebViewDelegate.LoadUrl(string url)
public void DecidePolicyForNavigation(WebKit.WebView webView, NSDictionary actionInformation, NSUrlRequest request, WebKit.WebFrame frame, WebKit.IWebPolicyDecisionListener decisionToken)
{
var navEvent = WebNavigationEvent.NewPage;
- if(actionInformation.ContainsKey(WebPolicyDelegate.WebActionNavigationTypeKey))
+ if (actionInformation.ContainsKey(WebPolicyDelegate.WebActionNavigationTypeKey))
{
var navigationType = ((WebNavigationType)((NSNumber)actionInformation[WebPolicyDelegate.WebActionNavigationTypeKey]).Int32Value);
switch (navigationType)
@@ -52,7 +52,7 @@ public void DecidePolicyForNavigation(WebKit.WebView webView, NSDictionary actio
break;
}
}
-
+
if (!_sentNavigating)
{
_lastEvent = navEvent;
@@ -66,7 +66,7 @@ public void DecidePolicyForNavigation(WebKit.WebView webView, NSDictionary actio
{
decisionToken.Use();
}
-
+
_sentNavigating = false;
}
}
@@ -84,7 +84,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
AutoresizingMask = NSViewResizingMask.WidthSizable,
AutoresizesSubviews = true
});
-
+
Element.EvalRequested += OnEvalRequested;
Element.EvaluateJavaScriptRequested += OnEvaluateJavaScriptRequested;
Element.GoBackRequested += OnGoBackRequested;
@@ -156,7 +156,8 @@ async Task OnEvaluateJavaScriptRequested(string script)
var tcr = new TaskCompletionSource();
var task = tcr.Task;
- Device.BeginInvokeOnMainThread(() => {
+ Device.BeginInvokeOnMainThread(() =>
+ {
tcr.SetResult(Control?.StringByEvaluatingJavaScriptFromString(script));
});
@@ -201,7 +202,7 @@ internal FormsWebFrameDelegate(WebViewRenderer renderer)
public override void FinishedLoad(WebKit.WebView sender, WebFrame forFrame)
{
Renderer._sentNavigating = false;
-
+
if (Renderer.Control.IsLoading)
return;
@@ -221,7 +222,7 @@ public override void FinishedLoad(WebKit.WebView sender, WebFrame forFrame)
public override void FailedLoadWithError(WebKit.WebView sender, NSError error, WebFrame forFrame)
{
Renderer._sentNavigating = false;
-
+
Renderer._lastEvent = Renderer._lastBackForwardEvent;
Renderer.Element?.SendNavigated(new WebNavigatedEventArgs(Renderer._lastEvent, new UrlWebViewSource { Url = Renderer.Control.MainFrameUrl }, Renderer.Control.MainFrameUrl, WebNavigationResult.Failure));
diff --git a/src/Compatibility/Core/src/RendererToHandlerShim.Tizen.cs b/src/Compatibility/Core/src/RendererToHandlerShim.Tizen.cs
index dab4452aaab2..691b94b57da1 100644
--- a/src/Compatibility/Core/src/RendererToHandlerShim.Tizen.cs
+++ b/src/Compatibility/Core/src/RendererToHandlerShim.Tizen.cs
@@ -1,5 +1,6 @@
#pragma warning disable CS0612 // Type or member is obsolete
using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+using static Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Platform;
#pragma warning disable CS0612 // Type or member is obsolete
using Microsoft.Maui.Graphics;
using Rect = Microsoft.Maui.Graphics.Rect;
@@ -25,8 +26,9 @@ public override Size GetDesiredSize(double widthConstraint, double heightConstra
if (VisualElementRenderer == null)
return Size.Zero;
- // TODO. It is workaroud code, Controls.VisualElement.MeasureOverride implementation is wrong. it does not apply Height/WidthRequest
- return VisualElementRenderer.Element.Measure(widthConstraint, heightConstraint).Request;
+ widthConstraint = widthConstraint < 0 ? double.PositiveInfinity : widthConstraint;
+ heightConstraint = heightConstraint < 0 ? double.PositiveInfinity : heightConstraint;
+ return VisualElementRenderer.GetDesiredSize(widthConstraint, heightConstraint);
}
public override void UpdateValue(string property)
diff --git a/src/Compatibility/Core/src/RendererToHandlerShim.Windows.cs b/src/Compatibility/Core/src/RendererToHandlerShim.Windows.cs
index dbe1572b2f5c..13ec0f44c146 100644
--- a/src/Compatibility/Core/src/RendererToHandlerShim.Windows.cs
+++ b/src/Compatibility/Core/src/RendererToHandlerShim.Windows.cs
@@ -7,8 +7,8 @@
namespace Microsoft.Maui.Controls.Compatibility
{
- public partial class RendererToHandlerShim
- {
+ public partial class RendererToHandlerShim
+ {
protected override PlatformView CreatePlatformView()
{
return VisualElementRenderer.ContainerElement;
diff --git a/src/Compatibility/Core/src/Tizen/Native/CollectionView/ItemTemplateAdaptor.cs b/src/Compatibility/Core/src/Tizen/Native/CollectionView/ItemTemplateAdaptor.cs
index 9c0e8ea7df62..20d73bbb5876 100644
--- a/src/Compatibility/Core/src/Tizen/Native/CollectionView/ItemTemplateAdaptor.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/CollectionView/ItemTemplateAdaptor.cs
@@ -29,7 +29,7 @@ public ItemDefaultTemplateAdaptor(ItemsView itemsView) : base(itemsView)
{
var label = new XLabel
{
- TextColor = XColor.FromRgb(0,0,0),
+ TextColor = XColor.FromRgb(0, 0, 0),
};
label.SetBinding(XLabel.TextProperty, new Binding(".", converter: new ToTextConverter()));
diff --git a/src/Compatibility/Core/src/Tizen/Native/DateChangedEventArgs.cs b/src/Compatibility/Core/src/Tizen/Native/DateChangedEventArgs.cs
index 10401664f4d3..104a7fc16efa 100644
--- a/src/Compatibility/Core/src/Tizen/Native/DateChangedEventArgs.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/DateChangedEventArgs.cs
@@ -3,7 +3,7 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
///
- /// Event arguments for event.
+ /// Event arguments for event.
///
public class DateChangedEventArgs : EventArgs
{
@@ -13,9 +13,8 @@ public class DateChangedEventArgs : EventArgs
public DateTime NewDate { get; }
///
- /// Creates a new object that represents a change from to .
+ /// Creates a new object that represents a change to .
///
- /// Old date of .
/// Current date of .
public DateChangedEventArgs(DateTime newDate)
{
diff --git a/src/Compatibility/Core/src/Tizen/Native/Entry.cs b/src/Compatibility/Core/src/Tizen/Native/Entry.cs
index 27579173d3e3..20f336d71d88 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Entry.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Entry.cs
@@ -28,7 +28,7 @@ public MaterialEntry(EvasObject parent) : base(parent)
public class Entry : EEntry, IMeasurable, IBatchable, IEntry
{
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
/// Parent evas object.
public Entry(EvasObject parent) : base(parent)
diff --git a/src/Compatibility/Core/src/Tizen/Native/FlyoutPage.cs b/src/Compatibility/Core/src/Tizen/Native/FlyoutPage.cs
index ce3841aac857..7f8a732d76a1 100644
--- a/src/Compatibility/Core/src/Tizen/Native/FlyoutPage.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/FlyoutPage.cs
@@ -56,7 +56,7 @@ public class FlyoutPage : Box
EvasObject _detail;
///
- /// The main widget - either or , depending on the mode.
+ /// The main widget - either or , depending on the mode.
///
EvasObject _mainWidget;
diff --git a/src/Compatibility/Core/src/Tizen/Native/ListView.cs b/src/Compatibility/Core/src/Tizen/Native/ListView.cs
index e504d3711b2a..2f373f5bc1f7 100644
--- a/src/Compatibility/Core/src/Tizen/Native/ListView.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/ListView.cs
@@ -10,9 +10,7 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
- ///
- /// Type alias which identifies list of cells whose data model was transformed by Xamarin.
- ///
+ // Type alias which identifies list of cells whose data model was transformed by Xamarin.
using GroupList = TemplatedItemsList, Cell>;
///
diff --git a/src/Compatibility/Core/src/Tizen/Native/TextHelper.cs b/src/Compatibility/Core/src/Tizen/Native/TextHelper.cs
index a2f892a58c06..6093d8ea87d8 100644
--- a/src/Compatibility/Core/src/Tizen/Native/TextHelper.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/TextHelper.cs
@@ -34,8 +34,8 @@ public static ESize GetFormattedTextBlockSize(EvasObject textable)
/// Gets the ELM text part of evas object.
///
/// The with text part.
- /// Throws exception when parameter isn't text-able object or doesn't have ELM text part.
/// Requested instance.
+ /// Throws exception when parameter isn't text-able object or doesn't have ELM text part.
static EdjeTextPartObject GetElmTextPart(EvasObject textable)
{
ELayout widget = textable as ELayout;
diff --git a/src/Compatibility/Core/src/Tizen/NativeBindingService.cs b/src/Compatibility/Core/src/Tizen/NativeBindingService.cs
index a4d7cc87b1ff..c5f4b2cb5fbf 100644
--- a/src/Compatibility/Core/src/Tizen/NativeBindingService.cs
+++ b/src/Compatibility/Core/src/Tizen/NativeBindingService.cs
@@ -7,7 +7,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
class NativeBindingService : INativeBindingService
{
- [UnconditionalSuppressMessage ("Trimming", "IL2075", Justification = TrimmerConstants.NativeBindingService)]
+ [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = TrimmerConstants.NativeBindingService)]
public bool TrySetBinding(object target, string propertyName, BindingBase binding)
{
Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
diff --git a/src/Compatibility/Core/src/Tizen/PopupManager.cs b/src/Compatibility/Core/src/Tizen/PopupManager.cs
index c830f197742a..e726c5f39294 100644
--- a/src/Compatibility/Core/src/Tizen/PopupManager.cs
+++ b/src/Compatibility/Core/src/Tizen/PopupManager.cs
@@ -27,7 +27,7 @@ public PopupManager(ITizenPlatform platform)
MessagingCenter.Subscribe(this, Page.AlertSignalName, OnAlertRequest);
MessagingCenter.Subscribe(this, Page.ActionSheetSignalName, OnActionSheetRequest);
MessagingCenter.Subscribe(this, Page.PromptSignalName, OnPromptRequested);
- }
+ }
public void Dispose()
{
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/CarouselPageRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/CarouselPageRenderer.cs
index e07295000676..e6a64a47c8a5 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/CarouselPageRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/CarouselPageRenderer.cs
@@ -12,10 +12,10 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
- [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
///
/// Renderer of a CarouselPage widget.
///
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
internal class CarouselPageRenderer : VisualElementRenderer
{
const int ItemMaxCount = 20;
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/LayoutRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/LayoutRenderer.cs
index 37e2fce15a67..bb136f7ec7a5 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/LayoutRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/LayoutRenderer.cs
@@ -5,10 +5,10 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
- [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
///
/// Renderer of a Layout.
///
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class LayoutRenderer : ViewRenderer, SkiaSharp.IBackgroundCanvas, ILayoutRenderer
{
bool _layoutUpdatedRegistered = false;
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/ListViewRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/ListViewRenderer.cs
index e0220fff3365..25fc7bb642b3 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/ListViewRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/ListViewRenderer.cs
@@ -8,7 +8,6 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
- [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
///
/// Renderer class for Xamarin ListView class. This provides necessary logic translating
/// Xamarin API to Tizen Native API. This is a derivate of a ViewRenderer base class.
@@ -18,6 +17,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
/// types, and can be accessed with Control property. This represents actual native control
/// which is used to draw control and realize xamarin forms api.
///
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class ListViewRenderer : ViewRenderer
{
IListViewController Controller => Element;
@@ -57,7 +57,7 @@ public ListViewRenderer()
/// Invoked on creation of new ListView renderer. Handles the creation of a native
/// element and initialization of the renderer.
///
- /// .
+ /// .
protected override void OnElementChanged(ElementChangedEventArgs e)
{
if (Control == null)
@@ -226,7 +226,7 @@ void OnScrollToRequested(object sender, ScrollToRequestedEventArgs e)
/// Method will not be invoked for grouping mode, but for example event with
/// action reset will be handled here when switching between group and no-group mode.
///
- /// TemplatedItemsList, Cell>.
+ /// TemplatedItemsList{ItemsView{Cell}, Cell}.
/// NotifyCollectionChangedEventArgs.
void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
@@ -254,7 +254,7 @@ void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
/// Method will be invoked for grouping mode, but some action can be also handled
/// by OnCollectionChanged handler.
///
- /// TemplatedItemsList, Cell>.
+ /// TemplatedItemsList{ItemsView{Cell}, Cell}.
/// NotifyCollectionChangedEventArgs.
void OnGroupedCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/SearchBarRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/SearchBarRenderer.cs
index 0416c05755af..0c6d0a893caa 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/SearchBarRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/SearchBarRenderer.cs
@@ -147,6 +147,7 @@ void PlaceholderPropertyHandler()
/// Rewrites current underlying Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.SearchBar's Text contents to its Xamarin counterpart.
///
/// Sender.
+ /// Event arguments.
void OnTextChanged(object sender, EventArgs e)
{
Element.SetValueFromRenderer(SearchBar.TextProperty, Control.Text);
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/ViewRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/ViewRenderer.cs
index 23385e94490c..2f27c00ec052 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/ViewRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/ViewRenderer.cs
@@ -10,10 +10,10 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
- [Obsolete("Use Microsoft.Maui.Controls.Handlers.Compatibility.ViewRenderer instead")]
///
/// Base class for view renderers.
///
+ [Obsolete("Use Microsoft.Maui.Controls.Handlers.Compatibility.ViewRenderer instead")]
public abstract class ViewRenderer : VisualElementRenderer
where TView : View
where TNativeView : EvasObject
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/VisualElementRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/VisualElementRenderer.cs
index 2ad6d99ff3fb..6fa341d20f64 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/VisualElementRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/VisualElementRenderer.cs
@@ -129,14 +129,14 @@ VisualElement IVisualElementRenderer.Element
protected bool IsDisposed => _flags.HasFlag(VisualElementRendererFlags.Disposed);
///
- /// Releases all resource used by the object.
+ /// Releases all resource used by the object.
///
- /// Call when you are finished using the
- /// . The method
- /// leaves the in an unusable state.
- /// After calling , you must release all references to the
- /// so the garbage collector can reclaim
- /// the memory that the was occupying.
+ /// Call when you are finished using the
+ /// . The method
+ /// leaves the in an unusable state.
+ /// After calling , you must release all references to the
+ /// so the garbage collector can reclaim
+ /// the memory that the was occupying.
public void Dispose()
{
Dispose(true);
diff --git a/src/Compatibility/Core/src/Tizen/Shell/NavigationView.cs b/src/Compatibility/Core/src/Tizen/Shell/NavigationView.cs
index 8690c5361638..5a127dce5749 100644
--- a/src/Compatibility/Core/src/Tizen/Shell/NavigationView.cs
+++ b/src/Compatibility/Core/src/Tizen/Shell/NavigationView.cs
@@ -312,7 +312,7 @@ DataTemplate GetFlyoutItemDataTemplate(BindableObject bo)
{
FontSize = this.GetFlyoutItemFontSize(),
VerticalTextAlignment = TextAlignment.Center,
- TextColor = Graphics.Color.FromRgb(0,0,0).MultiplyAlpha(0.87f),
+ TextColor = Graphics.Color.FromRgb(0, 0, 0).MultiplyAlpha(0.87f),
Margin = new Thickness(this.GetFlyoutMargin(), 0, 0, 0),
};
label.SetBinding(Label.TextProperty, new Binding(textBinding));
diff --git a/src/Compatibility/Core/src/Windows/AccessKeyHelper.cs b/src/Compatibility/Core/src/Windows/AccessKeyHelper.cs
index 796ec62a5a2a..6163c0a393c5 100644
--- a/src/Compatibility/Core/src/Windows/AccessKeyHelper.cs
+++ b/src/Compatibility/Core/src/Windows/AccessKeyHelper.cs
@@ -9,7 +9,8 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
static class AccessKeyHelper
{
- public static void UpdateAccessKey(FrameworkElement control, VisualElement element) {
+ public static void UpdateAccessKey(FrameworkElement control, VisualElement element)
+ {
if (control != null && element is IElementConfiguration elementConfig)
{
diff --git a/src/Compatibility/Core/src/Windows/ActivityIndicatorRenderer.cs b/src/Compatibility/Core/src/Windows/ActivityIndicatorRenderer.cs
index aad2b43e2c05..9ee893f7b399 100644
--- a/src/Compatibility/Core/src/Windows/ActivityIndicatorRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ActivityIndicatorRenderer.cs
@@ -18,7 +18,9 @@ protected override void OnElementChanged(ElementChangedEventArgs
TextBlock _textBlock = null;
FormsButton _button;
- PointerEventHandler _pointerPressedHandler;
+ PointerEventHandler _pointerPressedHandler;
protected override void OnElementChanged(ElementChangedEventArgs e)
{
@@ -118,7 +118,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
{
UpdateTextColor();
}
- else if ( e.PropertyName == FontElement.FontAttributesProperty.PropertyName
+ else if (e.PropertyName == FontElement.FontAttributesProperty.PropertyName
|| e.PropertyName == FontElement.FontAutoScalingEnabledProperty.PropertyName
|| e.PropertyName == FontElement.FontFamilyProperty.PropertyName
|| e.PropertyName == FontElement.FontSizeProperty.PropertyName)
@@ -343,7 +343,7 @@ protected override void Dispose(bool disposing)
{
_button.Click -= OnButtonClick;
_button.RemoveHandler(PointerPressedEvent, _pointerPressedHandler);
- _button.Loaded -= ButtonOnLoaded;
+ _button.Loaded -= ButtonOnLoaded;
_pointerPressedHandler = null;
}
diff --git a/src/Compatibility/Core/src/Windows/CellControl.cs b/src/Compatibility/Core/src/Windows/CellControl.cs
index da97001e0b62..a0c6635c560d 100644
--- a/src/Compatibility/Core/src/Windows/CellControl.cs
+++ b/src/Compatibility/Core/src/Windows/CellControl.cs
@@ -54,7 +54,7 @@ void OnLoaded(object sender, RoutedEventArgs e)
if (Cell == null)
return;
- /// 🚀 subscribe topropertychanged
+ // 🚀 subscribe topropertychanged
// make sure we do not subscribe twice (because this could happen in SetSource(Cell oldCell, Cell newCell))
Cell.PropertyChanged -= _propertyChangedHandler;
Cell.PropertyChanged += _propertyChangedHandler;
@@ -66,7 +66,7 @@ void OnUnloaded(object sender, RoutedEventArgs e)
return;
Cell.SendDisappearing();
- /// 🚀 unsubscribe from propertychanged
+ // 🚀 unsubscribe from propertychanged
Cell.PropertyChanged -= _propertyChangedHandler;
}
diff --git a/src/Compatibility/Core/src/Windows/CheckBoxRenderer.cs b/src/Compatibility/Core/src/Windows/CheckBoxRenderer.cs
index a544047c9466..41df44e104be 100644
--- a/src/Compatibility/Core/src/Windows/CheckBoxRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/CheckBoxRenderer.cs
@@ -69,7 +69,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
{
UpdateFlowDirection();
}
- else if(e.PropertyName == CheckBox.ColorProperty.PropertyName)
+ else if (e.PropertyName == CheckBox.ColorProperty.PropertyName)
{
UpdateTintColor();
}
@@ -97,7 +97,7 @@ void UpdateTintColor()
{
BrushHelpers.UpdateColor(Element.Color, ref _tintDefaultBrush,
() => Control.TintBrush, brush => Control.TintBrush = brush);
-
+
}
}
}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs b/src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs
index 89fcb48ba911..7985061f586e 100644
--- a/src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs
+++ b/src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs
@@ -103,7 +103,7 @@ public Thickness ItemSpacing
get => (Thickness)GetValue(ItemSpacingProperty);
set => SetValue(ItemSpacingProperty, value);
}
-
+
protected override void OnContentChanged(object oldContent, object newContent)
{
base.OnContentChanged(oldContent, newContent);
@@ -165,7 +165,7 @@ internal void Realize()
itemsView?.AddLogicalChild(_visualElement);
}
- void SetNativeStateConsistent(VisualElement visualElement)
+ void SetNativeStateConsistent(VisualElement visualElement)
{
visualElement.IsPlatformStateConsistent = true;
diff --git a/src/Compatibility/Core/src/Windows/CollectionView/ItemsViewRenderer.cs b/src/Compatibility/Core/src/Windows/CollectionView/ItemsViewRenderer.cs
index b769762c3dcc..7e55c5140549 100644
--- a/src/Compatibility/Core/src/Windows/CollectionView/ItemsViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/CollectionView/ItemsViewRenderer.cs
@@ -26,7 +26,7 @@ public abstract class ItemsViewRenderer : ViewRenderer CollectionViewSource.View.Count;
- protected virtual object GetItem(int index)
+ protected virtual object GetItem(int index)
{
return CollectionViewSource.View[index];
}
diff --git a/src/Compatibility/Core/src/Windows/CollectionView/SelectableItemsViewRenderer.cs b/src/Compatibility/Core/src/Windows/CollectionView/SelectableItemsViewRenderer.cs
index 9061ef762170..01238d8eada2 100644
--- a/src/Compatibility/Core/src/Windows/CollectionView/SelectableItemsViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/CollectionView/SelectableItemsViewRenderer.cs
@@ -139,7 +139,7 @@ void NativeSelectionChanged(object sender, UWPSelectionChangedEventArgs args)
{
UpdateFormsSelection();
}
-
+
void UpdateFormsSelection()
{
if (_ignoreNativeSelectionChange || ItemsView == null)
diff --git a/src/Compatibility/Core/src/Windows/DatePickerRenderer.cs b/src/Compatibility/Core/src/Windows/DatePickerRenderer.cs
index f1bd07b0176d..b2766bc3db20 100644
--- a/src/Compatibility/Core/src/Windows/DatePickerRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/DatePickerRenderer.cs
@@ -288,7 +288,7 @@ void UpdateFont()
void UpdateMaximumDate()
{
if (Element != null && Control != null)
- Control.MaxYear = new DateTimeOffset(new DateTime(Element.MaximumDate.Ticks, DateTimeKind.Unspecified));
+ Control.MaxYear = new DateTimeOffset(new DateTime(Element.MaximumDate.Ticks, DateTimeKind.Unspecified));
}
[PortHandler]
diff --git a/src/Compatibility/Core/src/Windows/EditorRenderer.cs b/src/Compatibility/Core/src/Windows/EditorRenderer.cs
index a2066cfcf67c..1f31a2e07085 100644
--- a/src/Compatibility/Core/src/Windows/EditorRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/EditorRenderer.cs
@@ -281,7 +281,7 @@ void UpdateCharacterSpacing()
{
Control.CharacterSpacing = Element.CharacterSpacing.ToEm();
}
-
+
[PortHandler]
void UpdateText()
{
diff --git a/src/Compatibility/Core/src/Windows/EntryRenderer.cs b/src/Compatibility/Core/src/Windows/EntryRenderer.cs
index 0b50be67c295..fed472a6d5d9 100644
--- a/src/Compatibility/Core/src/Windows/EntryRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/EntryRenderer.cs
@@ -506,7 +506,7 @@ public override SizeRequest GetDesiredSize(double widthConstraint, double height
return new SizeRequest();
var constraint = new global::Windows.Foundation.Size(widthConstraint, heightConstraint);
- child.Measure(constraint);
+ child.Measure(constraint);
var result = FormsTextBox.GetCopyOfSize(child, constraint);
return new SizeRequest(result);
}
diff --git a/src/Compatibility/Core/src/Windows/FlyoutPageControl.cs b/src/Compatibility/Core/src/Windows/FlyoutPageControl.cs
index 051b89a9f0f3..42e39b514247 100644
--- a/src/Compatibility/Core/src/Windows/FlyoutPageControl.cs
+++ b/src/Compatibility/Core/src/Windows/FlyoutPageControl.cs
@@ -74,7 +74,7 @@ public bool ShouldShowToolbar
FrameworkElement _flyoutPresenter;
FrameworkElement _detailPresenter;
SplitView _split;
- ToolbarPlacement _toolbarPlacement;
+ ToolbarPlacement _toolbarPlacement;
bool _toolbarDynamicOverflowEnabled = true;
FrameworkElement _titleViewPresenter;
TitleViewManager _titleViewManager;
@@ -212,16 +212,16 @@ public CollapseStyle CollapseStyle
set { SetValue(CollapseStyleProperty, value); }
}
- public ToolbarPlacement ToolbarPlacement
- {
- get { return _toolbarPlacement; }
- set
- {
- _toolbarPlacement = value;
- _toolbarPlacementHelper.UpdateToolbarPlacement();
- }
- }
-
+ public ToolbarPlacement ToolbarPlacement
+ {
+ get { return _toolbarPlacement; }
+ set
+ {
+ _toolbarPlacement = value;
+ _toolbarPlacementHelper.UpdateToolbarPlacement();
+ }
+ }
+
public bool ToolbarDynamicOverflowEnabled
{
get { return _toolbarDynamicOverflowEnabled; }
@@ -299,8 +299,8 @@ protected override void OnApplyTemplate()
_commandBar = GetTemplateChild("CommandBar") as CommandBar;
_toolbarPlacementHelper.Initialize(_commandBar, () => ToolbarPlacement, GetTemplateChild);
UpdateToolbarDynamicOverflowEnabled();
-
- UpdateMode();
+
+ UpdateMode();
if (_commandBarTcs != null)
_commandBarTcs.SetResult(_commandBar);
@@ -378,15 +378,15 @@ Visibility ITitleViewRendererController.TitleViewVisibility
CommandBar ITitleViewRendererController.CommandBar { get => _commandBar; }
- void UpdateToolbarDynamicOverflowEnabled()
- {
- if (_commandBar != null)
- {
- _commandBar.IsDynamicOverflowEnabled = ToolbarDynamicOverflowEnabled;
- }
- }
+ void UpdateToolbarDynamicOverflowEnabled()
+ {
+ if (_commandBar != null)
+ {
+ _commandBar.IsDynamicOverflowEnabled = ToolbarDynamicOverflowEnabled;
+ }
+ }
- }
+ }
public class MasterDetailControl : FlyoutPageControl
{
diff --git a/src/Compatibility/Core/src/Windows/FlyoutPageRenderer.cs b/src/Compatibility/Core/src/Windows/FlyoutPageRenderer.cs
index 2ea0d28d857c..1b7774ac38d5 100644
--- a/src/Compatibility/Core/src/Windows/FlyoutPageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/FlyoutPageRenderer.cs
@@ -188,7 +188,7 @@ protected virtual void OnElementChanged(ElementChangedEventArgs e)
_defaultAutomationPropertiesName = Control.SetAutomationPropertiesName(Element, _defaultAutomationPropertiesName);
_defaultAutomationPropertiesHelpText = Control.SetAutomationPropertiesHelpText(Element, _defaultAutomationPropertiesHelpText);
- _defaultAutomationPropertiesLabeledBy = Control.SetAutomationPropertiesLabeledBy(Element, Element.Handler?.MauiContext ?? Forms.MauiContext, _defaultAutomationPropertiesLabeledBy);
+ _defaultAutomationPropertiesLabeledBy = Control.SetAutomationPropertiesLabeledBy(Element, Element.Handler?.MauiContext ?? Forms.MauiContext, _defaultAutomationPropertiesLabeledBy);
_defaultAutomationPropertiesAccessibilityView = Control.SetAutomationPropertiesAccessibilityView(Element, _defaultAutomationPropertiesAccessibilityView);
}
}
diff --git a/src/Compatibility/Core/src/Windows/FontImageSourceHandler.cs b/src/Compatibility/Core/src/Windows/FontImageSourceHandler.cs
index 6086478126e7..482d863f6a38 100644
--- a/src/Compatibility/Core/src/Windows/FontImageSourceHandler.cs
+++ b/src/Compatibility/Core/src/Windows/FontImageSourceHandler.cs
@@ -114,15 +114,15 @@ string GetFontSource(FontImageSource fontImageSource)
var allFamilies = fontFamily.Source.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
if (allFamilies.Length > 1)
- {
+ {
// There's really no perfect solution to handle font families with fallbacks (comma-separated)
// So if the font family has fallbacks, only one is taken, because CanvasTextFormat
// only supports one font family
string source = fontImageSource.FontFamily;
- foreach(var family in allFamilies)
+ foreach (var family in allFamilies)
{
- if(family.Contains(source, StringComparison.Ordinal))
+ if (family.Contains(source, StringComparison.Ordinal))
{
fontSource = family;
break;
diff --git a/src/Compatibility/Core/src/Windows/FormsButton.cs b/src/Compatibility/Core/src/Windows/FormsButton.cs
index 9cdae3367384..211a23e276b4 100644
--- a/src/Compatibility/Core/src/Windows/FormsButton.cs
+++ b/src/Compatibility/Core/src/Windows/FormsButton.cs
@@ -79,10 +79,10 @@ void UpdateBorderRadius()
{
var radius = BorderRadius == -1 ? 0 : BorderRadius;
var cornerRadius = WinUIHelpers.CreateCornerRadius(radius);
- if (_contentPresenter != null)
- _contentPresenter.CornerRadius = cornerRadius;
-
- if(_rootGrid != null)
+ if (_contentPresenter != null)
+ _contentPresenter.CornerRadius = cornerRadius;
+
+ if (_rootGrid != null)
_rootGrid.CornerRadius = cornerRadius;
}
@@ -94,7 +94,7 @@ public void UpdateCharacterSpacing(int characterSpacing)
_contentPresenter.CharacterSpacing = CharacterSpacing;
var textBlock = GetTextBlock(Content);
-
+
if (textBlock != null)
textBlock.CharacterSpacing = CharacterSpacing;
diff --git a/src/Compatibility/Core/src/Windows/FormsCancelButton.cs b/src/Compatibility/Core/src/Windows/FormsCancelButton.cs
index a13a946daa18..bf140faeaf83 100644
--- a/src/Compatibility/Core/src/Windows/FormsCancelButton.cs
+++ b/src/Compatibility/Core/src/Windows/FormsCancelButton.cs
@@ -10,7 +10,7 @@ internal class FormsCancelButton : Microsoft.UI.Xaml.Controls.Button
TextBlock _cancelButtonGlyph;
WBorder _cancelButtonBackground;
- public WBrush ForegroundBrush
+ public WBrush ForegroundBrush
{
get => _cancelButtonGlyph.Foreground;
set => _cancelButtonGlyph.Foreground = value;
diff --git a/src/Compatibility/Core/src/Windows/FormsCheckBox.cs b/src/Compatibility/Core/src/Windows/FormsCheckBox.cs
index bcedb88c9acc..25d137a1afbb 100644
--- a/src/Compatibility/Core/src/Windows/FormsCheckBox.cs
+++ b/src/Compatibility/Core/src/Windows/FormsCheckBox.cs
@@ -13,9 +13,9 @@ public class FormsCheckBox : WindowsCheckbox
static void OnTintBrushPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
- var checkBox = (FormsCheckBox)d;
+ var checkBox = (FormsCheckBox)d;
- if(checkBox.IsChecked == false)
+ if (checkBox.IsChecked == false)
{
checkBox.DefaultFillBrush = new UI.Xaml.Media.SolidColorBrush(UI.Colors.Transparent);
}
@@ -31,13 +31,13 @@ static void OnTintBrushPropertyChanged(DependencyObject d, DependencyPropertyCha
public FormsCheckBox()
{
-
+
}
public WBrush TintBrush
{
get { return (WBrush)GetValue(TintBrushProperty); }
- set { SetValue(TintBrushProperty, value); }
+ set { SetValue(TintBrushProperty, value); }
}
public WBrush DefaultFillBrush
diff --git a/src/Compatibility/Core/src/Windows/FormsComboBox.cs b/src/Compatibility/Core/src/Windows/FormsComboBox.cs
index ff653b62fa8f..ead13ba1bc4f 100644
--- a/src/Compatibility/Core/src/Windows/FormsComboBox.cs
+++ b/src/Compatibility/Core/src/Windows/FormsComboBox.cs
@@ -34,7 +34,7 @@ void FormsComboBoxSelectionChanged(object sender, Microsoft.UI.Xaml.Controls.Sel
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
-
+
if (DeviceInfo.Idiom == DeviceIdiom.Phone)
{
// If we're running on the phone, we have to give the PickerRenderer hooks
diff --git a/src/Compatibility/Core/src/Windows/FormsCommandBar.cs b/src/Compatibility/Core/src/Windows/FormsCommandBar.cs
index 01534427cf95..5beb59c17fb4 100644
--- a/src/Compatibility/Core/src/Windows/FormsCommandBar.cs
+++ b/src/Compatibility/Core/src/Windows/FormsCommandBar.cs
@@ -67,7 +67,7 @@ void UpdateVisibility()
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
@@ -105,7 +105,7 @@ void UpdateVisibility()
// 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
diff --git a/src/Compatibility/Core/src/Windows/FormsFlyout.xaml.cs b/src/Compatibility/Core/src/Windows/FormsFlyout.xaml.cs
index a13bd6a0e7d6..7c8550afe983 100644
--- a/src/Compatibility/Core/src/Windows/FormsFlyout.xaml.cs
+++ b/src/Compatibility/Core/src/Windows/FormsFlyout.xaml.cs
@@ -59,7 +59,7 @@ public FormsFlyout(ActionSheetArguments sheetOptions)
RightBtn.Visibility = RightBtn.Content == null ? WVisibility.Collapsed : WVisibility.Visible;
}
- void ListItemSelected (object sender, ItemClickEventArgs e)
+ void ListItemSelected(object sender, ItemClickEventArgs e)
{
var selection = (string)e.ClickedItem;
options.SetResult(selection);
diff --git a/src/Compatibility/Core/src/Windows/FormsTextBox.cs b/src/Compatibility/Core/src/Windows/FormsTextBox.cs
index 91f0065c92a5..9b1c2798f08a 100644
--- a/src/Compatibility/Core/src/Windows/FormsTextBox.cs
+++ b/src/Compatibility/Core/src/Windows/FormsTextBox.cs
@@ -80,7 +80,7 @@ void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs depend
public bool ClearButtonVisible
{
get { return (bool)GetValue(ClearButtonVisibleProperty); }
- set { SetValue(ClearButtonVisibleProperty, value);}
+ set { SetValue(ClearButtonVisibleProperty, value); }
}
public WBrush BackgroundFocusBrush
@@ -169,7 +169,7 @@ protected override void OnApplyTemplate()
UpdateClearButtonVisible();
}
- _scrollViewer= GetTemplateChild("ContentElement") as ScrollViewer;
+ _scrollViewer = GetTemplateChild("ContentElement") as ScrollViewer;
}
void OnSizeChanged(object sender, SizeChangedEventArgs e)
@@ -400,7 +400,7 @@ void UpdateClearButtonVisible()
{
if (ClearButtonVisible && !states.Contains(visibleState))
states.Add(visibleState);
- else if(!ClearButtonVisible)
+ else if (!ClearButtonVisible)
states.Remove(visibleState);
}
}
diff --git a/src/Compatibility/Core/src/Windows/ImageElementManager.cs b/src/Compatibility/Core/src/Windows/ImageElementManager.cs
index e10eacead860..75dbb5f39895 100644
--- a/src/Compatibility/Core/src/Windows/ImageElementManager.cs
+++ b/src/Compatibility/Core/src/Windows/ImageElementManager.cs
@@ -158,10 +158,10 @@ public static async Task UpdateSource(IImageVisualElementRenderer renderer)
static internal void RefreshImage(IImageVisualElementRenderer renderer)
{
- if(renderer.Element is IViewController element)
+ if (renderer.Element is IViewController element)
element?.InvalidateMeasure(InvalidationTrigger.RendererReady);
- if(renderer.Element is IImageElement controller)
+ if (renderer.Element is IImageElement controller)
StartStopAnimation(renderer, controller);
}
}
diff --git a/src/Compatibility/Core/src/Windows/IndicatorViewRenderer.cs b/src/Compatibility/Core/src/Windows/IndicatorViewRenderer.cs
index f713c4d5bfe3..7f53219e6630 100644
--- a/src/Compatibility/Core/src/Windows/IndicatorViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/IndicatorViewRenderer.cs
@@ -81,7 +81,7 @@ void UpdateIndicatorsColor()
{
if (!(Control is ItemsControl))
return;
-
+
_fillColor = new WSolidColorBrush(Element.IndicatorColor.ToWindowsColor());
_selectedColor = new WSolidColorBrush(Element.SelectedIndicatorColor.ToWindowsColor());
var position = Element.Position;
diff --git a/src/Compatibility/Core/src/Windows/InterceptVisualStateManager.cs b/src/Compatibility/Core/src/Windows/InterceptVisualStateManager.cs
index d5300d37153d..7c0e8aa3f63e 100644
--- a/src/Compatibility/Core/src/Windows/InterceptVisualStateManager.cs
+++ b/src/Compatibility/Core/src/Windows/InterceptVisualStateManager.cs
@@ -36,7 +36,7 @@ internal static InterceptVisualStateManager Instance
// bug wherein the GoToStateCore override for those controls is never called (Item 10976357 in VSTS)
// So until that's resolved, the FormsTextBox control is doing that work as best it can.
- protected override bool GoToStateCore(Control control, FrameworkElement templateRoot, string stateName,
+ protected override bool GoToStateCore(Control control, FrameworkElement templateRoot, string stateName,
Microsoft.UI.Xaml.VisualStateGroup @group, Microsoft.UI.Xaml.VisualState state, bool useTransitions)
{
// If this custom VSM is in play, it's because the control is using the Forms VSM or the user has disabled
diff --git a/src/Compatibility/Core/src/Windows/ListViewRenderer.cs b/src/Compatibility/Core/src/Windows/ListViewRenderer.cs
index 38fa5308a124..8b5662d9dc62 100644
--- a/src/Compatibility/Core/src/Windows/ListViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ListViewRenderer.cs
@@ -38,7 +38,7 @@ public class ListViewRenderer : ViewRenderer
bool _subscribedToItemClick;
bool _subscribedToTapped;
bool _disposed;
- CollectionViewSource _collectionViewSource;
+ CollectionViewSource _collectionViewSource;
UwpScrollBarVisibility? _defaultHorizontalScrollVisibility;
UwpScrollBarVisibility? _defaultVerticalScrollVisibility;
@@ -142,7 +142,7 @@ void ReloadData()
foreach (var item in Element.ItemsSource)
_collection.Add(item);
}
- else if(!object.ReferenceEquals(_collection, Element.ItemsSource))
+ else if (!object.ReferenceEquals(_collection, Element.ItemsSource))
{
_collection = (IList)Element.ItemsSource;
}
diff --git a/src/Compatibility/Core/src/Windows/NativeBindingService.cs b/src/Compatibility/Core/src/Windows/NativeBindingService.cs
index 4bf901db4a51..ad2bd98941e7 100644
--- a/src/Compatibility/Core/src/Windows/NativeBindingService.cs
+++ b/src/Compatibility/Core/src/Windows/NativeBindingService.cs
@@ -7,36 +7,36 @@
[assembly: Microsoft.Maui.Controls.Dependency(typeof(Microsoft.Maui.Controls.Compatibility.Platform.UWP.NativeBindingService))]
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
- public class NativeBindingService : INativeBindingService
- {
- [UnconditionalSuppressMessage ("Trimming", "IL2075", Justification = TrimmerConstants.NativeBindingService)]
- public bool TrySetBinding(object target, string propertyName, BindingBase binding)
- {
- var view = target as FrameworkElement;
- if (view == null)
- return false;
- if (target.GetType().GetProperty(propertyName)?.GetMethod == null)
- return false;
- view.SetBinding(propertyName, binding);
- return true;
- }
+ public class NativeBindingService : INativeBindingService
+ {
+ [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = TrimmerConstants.NativeBindingService)]
+ public bool TrySetBinding(object target, string propertyName, BindingBase binding)
+ {
+ var view = target as FrameworkElement;
+ if (view == null)
+ return false;
+ if (target.GetType().GetProperty(propertyName)?.GetMethod == null)
+ return false;
+ view.SetBinding(propertyName, binding);
+ return true;
+ }
- public bool TrySetBinding(object target, BindableProperty property, BindingBase binding)
- {
- var view = target as FrameworkElement;
- if (view == null)
- return false;
- view.SetBinding(property, binding);
- return true;
- }
+ public bool TrySetBinding(object target, BindableProperty property, BindingBase binding)
+ {
+ var view = target as FrameworkElement;
+ if (view == null)
+ return false;
+ view.SetBinding(property, binding);
+ return true;
+ }
- public bool TrySetValue(object target, BindableProperty property, object value)
- {
- var view = target as FrameworkElement;
- if (view == null)
- return false;
- view.SetValue(property, value);
- return true;
- }
- }
+ public bool TrySetValue(object target, BindableProperty property, object value)
+ {
+ var view = target as FrameworkElement;
+ if (view == null)
+ return false;
+ view.SetValue(property, value);
+ return true;
+ }
+ }
}
diff --git a/src/Compatibility/Core/src/Windows/NativeEventWrapper.cs b/src/Compatibility/Core/src/Windows/NativeEventWrapper.cs
index 92a3fb75153e..d09e3a9cfd22 100644
--- a/src/Compatibility/Core/src/Windows/NativeEventWrapper.cs
+++ b/src/Compatibility/Core/src/Windows/NativeEventWrapper.cs
@@ -18,7 +18,8 @@ class NativeEventWrapper : INotifyPropertyChanged
public NativeEventWrapper(object target, string targetProperty, string updateSourceEventName)
{
TargetProperty = targetProperty;
- try {
+ try
+ {
var updateSourceEvent = target.GetType().GetRuntimeEvent(updateSourceEventName);
MethodInfo addMethod = updateSourceEvent.AddMethod;
MethodInfo removeMethod = updateSourceEvent.RemoveMethod;
@@ -31,7 +32,8 @@ public NativeEventWrapper(object target, string targetProperty, string updateSou
// TODO WINUI3
//WindowsRuntimeMarshal.AddEventHandler(add, remove, s_handlerinfo);
}
- catch (Exception) {
+ catch (Exception)
+ {
Application.Current?.FindMauiContext()?.CreateLogger()?.LogWarning("Can not attach NativeEventWrapper.");
}
}
diff --git a/src/Compatibility/Core/src/Windows/NativePropertyListener.cs b/src/Compatibility/Core/src/Windows/NativePropertyListener.cs
index e793054caff7..a8c442939623 100644
--- a/src/Compatibility/Core/src/Windows/NativePropertyListener.cs
+++ b/src/Compatibility/Core/src/Windows/NativePropertyListener.cs
@@ -37,6 +37,6 @@ static void OnNativePropertyChanged(object sender, DependencyPropertyChangedEven
{
NativePropertyListener source = (NativePropertyListener)sender;
source?.PropertyChanged?.Invoke(source._target, new PropertyChangedEventArgs(source._targetProperty));
- }
+ }
}
}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/Windows/NativeValueConverterService.cs b/src/Compatibility/Core/src/Windows/NativeValueConverterService.cs
index 0e5796ba8051..1e04eab771a6 100644
--- a/src/Compatibility/Core/src/Windows/NativeValueConverterService.cs
+++ b/src/Compatibility/Core/src/Windows/NativeValueConverterService.cs
@@ -7,17 +7,17 @@
[assembly: Microsoft.Maui.Controls.Dependency(typeof(Microsoft.Maui.Controls.Compatibility.Platform.UWP.NativeValueConverterService))]
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
- public class NativeValueConverterService : INativeValueConverterService
- {
- public bool ConvertTo(object value, Type toType, out object nativeValue)
- {
- nativeValue = null;
- if (typeof(FrameworkElement).IsInstanceOfType(value) && toType.IsAssignableFrom(typeof(View)))
- {
- nativeValue = ((FrameworkElement)value).ToView();
- return true;
- }
- return false;
- }
- }
+ public class NativeValueConverterService : INativeValueConverterService
+ {
+ public bool ConvertTo(object value, Type toType, out object nativeValue)
+ {
+ nativeValue = null;
+ if (typeof(FrameworkElement).IsInstanceOfType(value) && toType.IsAssignableFrom(typeof(View)))
+ {
+ nativeValue = ((FrameworkElement)value).ToView();
+ return true;
+ }
+ return false;
+ }
+ }
}
diff --git a/src/Compatibility/Core/src/Windows/NativeViewWrapper.cs b/src/Compatibility/Core/src/Windows/NativeViewWrapper.cs
index ca54dec6cd61..beb9b7ee8c17 100644
--- a/src/Compatibility/Core/src/Windows/NativeViewWrapper.cs
+++ b/src/Compatibility/Core/src/Windows/NativeViewWrapper.cs
@@ -24,7 +24,7 @@ public NativeViewWrapper(FrameworkElement nativeElement, GetDesiredSizeDelegate
protected override void OnBindingContextChanged()
{
- NativeElement.SetBindingContext(BindingContext, nv => nv.GetChildren());
+ NativeElement.SetBindingContext(BindingContext, nv => nv.GetChildren());
base.OnBindingContextChanged();
}
}
diff --git a/src/Compatibility/Core/src/Windows/NavigationPageRenderer.cs b/src/Compatibility/Core/src/Windows/NavigationPageRenderer.cs
index 08af8db0322d..dd0af6b56038 100644
--- a/src/Compatibility/Core/src/Windows/NavigationPageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/NavigationPageRenderer.cs
@@ -21,7 +21,7 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
[System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
- public class NavigationPageRenderer : IVisualElementRenderer, ITitleProvider, ITitleIconProvider,
+ public class NavigationPageRenderer : IVisualElementRenderer, ITitleProvider, ITitleIconProvider,
ITitleViewProvider, IToolbarProvider, IToolBarForegroundBinder
{
PageControl _container;
@@ -516,7 +516,7 @@ protected virtual void SetupPageTransition(Transition transition, bool isAnimate
{
if (isAnimated && transition == null)
{
- transition = new EntranceThemeTransition();
+ transition = new EntranceThemeTransition();
_transition = (EntranceThemeTransition)transition;
_container.ContentTransitions = new TransitionCollection();
}
@@ -656,7 +656,7 @@ void UpdateToolbarDynamicOverflowEnabled()
_container.ToolbarDynamicOverflowEnabled = Element.OnThisPlatform().GetToolbarDynamicOverflowEnabled();
}
-
+
void UpdateShowTitle()
{
diff --git a/src/Compatibility/Core/src/Windows/PageControl.cs b/src/Compatibility/Core/src/Windows/PageControl.cs
index 71e925179b14..0946936c7cc5 100644
--- a/src/Compatibility/Core/src/Windows/PageControl.cs
+++ b/src/Compatibility/Core/src/Windows/PageControl.cs
@@ -33,7 +33,7 @@ public sealed class PageControl : ContentControl, IToolbarProvider, ITitleViewRe
CommandBar _commandBar;
FrameworkElement _titleViewPresenter;
- ToolbarPlacement _toolbarPlacement;
+ ToolbarPlacement _toolbarPlacement;
bool _toolbarDynamicOverflowEnabled = true;
readonly ToolbarPlacementHelper _toolbarPlacementHelper = new ToolbarPlacementHelper();
@@ -92,15 +92,15 @@ public WBrush ToolbarBackground
set { SetValue(ToolbarBackgroundProperty, value); }
}
- public ToolbarPlacement ToolbarPlacement
- {
- get { return _toolbarPlacement; }
- set
- {
- _toolbarPlacement = value;
- _toolbarPlacementHelper.UpdateToolbarPlacement();
- }
- }
+ public ToolbarPlacement ToolbarPlacement
+ {
+ get { return _toolbarPlacement; }
+ set
+ {
+ _toolbarPlacement = value;
+ _toolbarPlacementHelper.UpdateToolbarPlacement();
+ }
+ }
public bool ToolbarDynamicOverflowEnabled
{
@@ -165,14 +165,14 @@ protected override void OnApplyTemplate()
UpdateToolbarDynamicOverflowEnabled();
TaskCompletionSource tcs = _commandBarTcs;
- tcs?.SetResult(_commandBar);
+ tcs?.SetResult(_commandBar);
}
- static void OnTitleViewPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
- {
- ((PageControl)dependencyObject)._titleViewManager?.OnTitleViewPropertyChanged();
+ static void OnTitleViewPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
+ {
+ ((PageControl)dependencyObject)._titleViewManager?.OnTitleViewPropertyChanged();
}
-
+
void UpdateToolbarDynamicOverflowEnabled()
{
if (_commandBar != null)
diff --git a/src/Compatibility/Core/src/Windows/PageRenderer.cs b/src/Compatibility/Core/src/Windows/PageRenderer.cs
index 836c3e29eab1..7e51203a0a48 100644
--- a/src/Compatibility/Core/src/Windows/PageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/PageRenderer.cs
@@ -10,7 +10,7 @@
namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
{
[System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
- public class PageRenderer :
+ public class PageRenderer :
//Microsoft.UI.Xaml.Controls.Grid, IVisualElementRenderer
VisualElementRenderer
{
diff --git a/src/Compatibility/Core/src/Windows/PickerRenderer.cs b/src/Compatibility/Core/src/Windows/PickerRenderer.cs
index fea3883a7a4d..446413b0667e 100644
--- a/src/Compatibility/Core/src/Windows/PickerRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/PickerRenderer.cs
@@ -84,7 +84,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
else if (e.PropertyName == Picker.HorizontalTextAlignmentProperty.PropertyName || e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
UpdateHorizontalTextAlignment();
else if (e.PropertyName == Picker.VerticalTextAlignmentProperty.PropertyName)
- UpdateVerticalTextAlignment();
+ UpdateVerticalTextAlignment();
}
void ControlOnLoaded(object sender, RoutedEventArgs routedEventArgs)
@@ -246,7 +246,7 @@ void UpdateHorizontalTextAlignment()
{
Control.HorizontalContentAlignment = Element.HorizontalTextAlignment.ToPlatformHorizontalAlignment();
}
- [PortHandler]
+ [PortHandler]
void UpdateVerticalTextAlignment()
{
Control.VerticalContentAlignment = Element.VerticalTextAlignment.ToPlatformVerticalAlignment();
diff --git a/src/Compatibility/Core/src/Windows/Platform.cs b/src/Compatibility/Core/src/Windows/Platform.cs
index 696596ff2aeb..f80eea2f8b0f 100644
--- a/src/Compatibility/Core/src/Windows/Platform.cs
+++ b/src/Compatibility/Core/src/Windows/Platform.cs
@@ -148,7 +148,7 @@ internal Platform(Microsoft.UI.Xaml.Window page)
UpdateBounds();
InitializeStatusBar();
-
+
// https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.window.current?view=winui-3.0
// The currently activated window for UWP apps. Null for Desktop apps.
if (Microsoft.UI.Xaml.Window.Current != null)
diff --git a/src/Compatibility/Core/src/Windows/RefreshViewRenderer.cs b/src/Compatibility/Core/src/Windows/RefreshViewRenderer.cs
index 1fe5ce03d6b1..05023d1c98bb 100644
--- a/src/Compatibility/Core/src/Windows/RefreshViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/RefreshViewRenderer.cs
@@ -146,7 +146,7 @@ void UpdateIsRefreshing()
if (!_isLoaded)
return;
- if (!Element?.IsRefreshing??false)
+ if (!Element?.IsRefreshing ?? false)
{
CompleteRefresh();
}
diff --git a/src/Compatibility/Core/src/Windows/ScrollViewRenderer.cs b/src/Compatibility/Core/src/Windows/ScrollViewRenderer.cs
index d67233bf9fa1..6fb295b83b77 100644
--- a/src/Compatibility/Core/src/Windows/ScrollViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/ScrollViewRenderer.cs
@@ -58,7 +58,7 @@ protected override void Dispose(bool disposing)
var result = new global::Windows.Foundation.Size(width, height);
Control?.Measure(result);
-
+
return result;
}
@@ -199,7 +199,8 @@ async void OnScrollToRequested(object sender, ScrollToRequestedEventArgs e)
void SetInitialRtlPosition(object sender, object e)
{
- if (Control == null) return;
+ if (Control == null)
+ return;
if (Control.ActualWidth <= 0 || _checkedForRtlScroll || Control.Content == null)
return;
diff --git a/src/Compatibility/Core/src/Windows/SearchBarRenderer.cs b/src/Compatibility/Core/src/Windows/SearchBarRenderer.cs
index f9e564d6f711..4e07b428f7f0 100644
--- a/src/Compatibility/Core/src/Windows/SearchBarRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/SearchBarRenderer.cs
@@ -90,9 +90,9 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
UpdateHorizontalTextAlignment();
else if (e.PropertyName == Specifics.IsSpellCheckEnabledProperty.PropertyName)
UpdateIsSpellCheckEnabled();
- else if(e.PropertyName == InputView.MaxLengthProperty.PropertyName)
+ else if (e.PropertyName == InputView.MaxLengthProperty.PropertyName)
UpdateMaxLength();
- else if(e.PropertyName == InputView.IsSpellCheckEnabledProperty.PropertyName)
+ else if (e.PropertyName == InputView.IsSpellCheckEnabledProperty.PropertyName)
UpdateInputScope();
}
@@ -252,10 +252,10 @@ void UpdatePlaceholderColor()
Color placeholderColor = Element.PlaceholderColor;
- BrushHelpers.UpdateColor(placeholderColor, ref _defaultPlaceholderColorBrush,
+ BrushHelpers.UpdateColor(placeholderColor, ref _defaultPlaceholderColorBrush,
() => _queryTextBox.PlaceholderForegroundBrush, brush => _queryTextBox.PlaceholderForegroundBrush = brush);
- BrushHelpers.UpdateColor(placeholderColor, ref _defaultPlaceholderColorFocusBrush,
+ BrushHelpers.UpdateColor(placeholderColor, ref _defaultPlaceholderColorFocusBrush,
() => _queryTextBox.PlaceholderForegroundFocusBrush, brush => _queryTextBox.PlaceholderForegroundFocusBrush = brush);
}
@@ -273,10 +273,10 @@ void UpdateTextColor()
Color textColor = Element.TextColor;
- BrushHelpers.UpdateColor(textColor, ref _defaultTextColorBrush,
+ BrushHelpers.UpdateColor(textColor, ref _defaultTextColorBrush,
() => _queryTextBox.Foreground, brush => _queryTextBox.Foreground = brush);
- BrushHelpers.UpdateColor(textColor, ref _defaultTextColorFocusBrush,
+ BrushHelpers.UpdateColor(textColor, ref _defaultTextColorFocusBrush,
() => _queryTextBox.ForegroundFocusBrush, brush => _queryTextBox.ForegroundFocusBrush = brush);
}
@@ -306,7 +306,7 @@ void UpdateMaxLength()
[PortHandler("Partially ported")]
void UpdateInputScope()
{
- if(_queryTextBox == null)
+ if (_queryTextBox == null)
return;
InputView model = Element;
@@ -335,7 +335,7 @@ protected override void UpdateBackgroundColor()
return;
Color backgroundColor = Element.BackgroundColor;
-
+
if (!backgroundColor.IsDefault())
{
_queryTextBox.Background = backgroundColor.ToPlatform();
diff --git a/src/Compatibility/Core/src/Windows/SliderRenderer.cs b/src/Compatibility/Core/src/Windows/SliderRenderer.cs
index 00c85122bebe..00f6204ffaf2 100644
--- a/src/Compatibility/Core/src/Windows/SliderRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/SliderRenderer.cs
@@ -166,8 +166,8 @@ void UpdateThumbColor()
{
return;
}
-
- BrushHelpers.UpdateColor(Element.ThumbColor, ref _defaultThumbColor,
+
+ BrushHelpers.UpdateColor(Element.ThumbColor, ref _defaultThumbColor,
() => thumb.Background, brush => thumb.Background = brush);
}
diff --git a/src/Compatibility/Core/src/Windows/StepperControl.cs b/src/Compatibility/Core/src/Windows/StepperControl.cs
index 10bc86422abc..20c8c67dcb23 100644
--- a/src/Compatibility/Core/src/Windows/StepperControl.cs
+++ b/src/Compatibility/Core/src/Windows/StepperControl.cs
@@ -27,7 +27,7 @@ public sealed class StepperControl : Control
public static readonly DependencyProperty ButtonBackgroundColorProperty = DependencyProperty.Register(nameof(ButtonBackgroundColor), typeof(Color), typeof(StepperControl), new PropertyMetadata(default(Color), OnButtonBackgroundColorChanged));
public static readonly DependencyProperty ButtonBackgroundProperty = DependencyProperty.Register(nameof(ButtonBackground), typeof(Brush), typeof(StepperControl), new PropertyMetadata(default(Brush), OnButtonBackgroundChanged));
-
+
Microsoft.UI.Xaml.Controls.Button _plus;
Microsoft.UI.Xaml.Controls.Button _minus;
VisualStateCache _plusStateCache;
diff --git a/src/Compatibility/Core/src/Windows/StepperRenderer.cs b/src/Compatibility/Core/src/Windows/StepperRenderer.cs
index a0cec67a4cba..8063c1d82c94 100644
--- a/src/Compatibility/Core/src/Windows/StepperRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/StepperRenderer.cs
@@ -24,7 +24,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
UpdateMaximum();
UpdateMinimum();
UpdateValue();
- UpdateIncrement();
+ UpdateIncrement();
UpdateFlowDirection();
}
}
diff --git a/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs b/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs
index f6a6aeaf2157..59c6f9c4b7ad 100644
--- a/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/TabbedPageRenderer.cs
@@ -410,7 +410,7 @@ void ApplyBarBackground()
if (Brush.IsNullOrEmpty(barBackground))
return;
-
+
var brush = barBackground.ToBrush();
if (brush == controlToolbarBackground)
diff --git a/src/Compatibility/Core/src/Windows/TableViewRenderer.cs b/src/Compatibility/Core/src/Windows/TableViewRenderer.cs
index 7aa5d39f6b00..667434a8f791 100644
--- a/src/Compatibility/Core/src/Windows/TableViewRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/TableViewRenderer.cs
@@ -56,12 +56,12 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
protected override void Dispose(bool disposing)
{
- if(disposing && !_disposed)
+ if (disposing && !_disposed)
{
_disposed = true;
- if(Control != null)
+ if (Control != null)
{
- Control.SelectionChanged -= OnSelectionChanged;
+ Control.SelectionChanged -= OnSelectionChanged;
}
}
base.Dispose(disposing);
diff --git a/src/Compatibility/Core/src/Windows/TimePickerRenderer.cs b/src/Compatibility/Core/src/Windows/TimePickerRenderer.cs
index 1836cc2840a1..a1280fcd69a7 100644
--- a/src/Compatibility/Core/src/Windows/TimePickerRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/TimePickerRenderer.cs
@@ -125,7 +125,7 @@ void UpdateFlowDirection()
{
Control.UpdateFlowDirection(Element);
}
-
+
void PickerOnForceInvalidate(object sender, EventArgs eventArgs)
{
((IVisualElementController)Element)?.InvalidateMeasure(InvalidationTrigger.SizeRequestChanged);
diff --git a/src/Compatibility/Core/src/Windows/ToolbarPlacementHelper.cs b/src/Compatibility/Core/src/Windows/ToolbarPlacementHelper.cs
index 479cab8e76da..0f006b2b9812 100644
--- a/src/Compatibility/Core/src/Windows/ToolbarPlacementHelper.cs
+++ b/src/Compatibility/Core/src/Windows/ToolbarPlacementHelper.cs
@@ -39,7 +39,7 @@ public void Initialize(CommandBar commandBar, Func getToolbarP
public void UpdateToolbarPlacement()
{
if (_commandBar == null || _getToolbarPlacement == null || _bottomCommandBarArea == null ||
- _topCommandBarArea == null)
+ _topCommandBarArea == null)
{
// Template hasn't been applied yet, so we're not ready to update the toolbar placement
return;
diff --git a/src/Compatibility/Core/src/Windows/UriImageSourceHandler.cs b/src/Compatibility/Core/src/Windows/UriImageSourceHandler.cs
index 12b308f53f28..abcd4d3a2252 100644
--- a/src/Compatibility/Core/src/Windows/UriImageSourceHandler.cs
+++ b/src/Compatibility/Core/src/Windows/UriImageSourceHandler.cs
@@ -59,7 +59,7 @@ public Task LoadIconElementAsync(ImageSource imagesource, Cancellat
await image.SetSourceAsync(stream);
return image;
}
- catch (Exception ex)
+ catch (Exception ex)
{
Application.Current?.FindMauiContext()?.CreateLogger()?.LogWarning(ex, "Could not load {uri}", imageLoader.Uri);
diff --git a/src/Compatibility/Core/src/Windows/VisualElementPackager.cs b/src/Compatibility/Core/src/Windows/VisualElementPackager.cs
index 5eb655f7b900..e0e1ac616b92 100644
--- a/src/Compatibility/Core/src/Windows/VisualElementPackager.cs
+++ b/src/Compatibility/Core/src/Windows/VisualElementPackager.cs
@@ -85,7 +85,8 @@ public void Load()
for (var i = 0; i < children.Count; i++)
{
var view = children[i] as VisualElement;
- if (view == null) continue;
+ if (view == null)
+ continue;
SetupVisualElement(view);
}
diff --git a/src/Compatibility/Core/src/Windows/VisualElementRenderer.cs b/src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
index a2d45bb14a12..4d554e73d5e3 100644
--- a/src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
+++ b/src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
@@ -433,7 +433,7 @@ protected void SetNativeControl(TNativeElement control)
control.GotFocus += OnControlGotFocus;
control.LostFocus += OnControlLostFocus;
Children.Add(control);
-
+
UpdateBackgroundColor();
UpdateBackground();
@@ -520,7 +520,8 @@ protected virtual void UpdateBackground()
}
}
- protected void UpdateAccessKey() {
+ protected void UpdateAccessKey()
+ {
var control = Control;
var element = Element as IElementConfiguration;
diff --git a/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs b/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs
index 12b0ec93061d..193e644a9fb5 100644
--- a/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs
+++ b/src/Compatibility/Core/src/iOS/DragAndDropDelegate.cs
@@ -16,7 +16,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS
[SupportedOSPlatform("ios11.0")]
internal class DragAndDropDelegate : NSObject, IUIDragInteractionDelegate, IUIDropInteractionDelegate
{
- #region UIDragInteractionDelegate
+#region UIDragInteractionDelegate
[Export("dragInteraction:session:willEndWithOperation:")]
@@ -39,7 +39,7 @@ public UIDragItem[] GetItemsForBeginningSession(UIDragInteraction interaction, I
return new UIDragItem[0];
}
- #endregion
+#endregion
[Export("dropInteraction:canHandleSession:")]
[Preserve(Conditional = true)]
diff --git a/src/Compatibility/Core/src/iOS/Forms.cs b/src/Compatibility/Core/src/iOS/Forms.cs
index 9cf2c9654021..ca1031f43363 100644
--- a/src/Compatibility/Core/src/iOS/Forms.cs
+++ b/src/Compatibility/Core/src/iOS/Forms.cs
@@ -126,7 +126,7 @@ internal static bool IsMojaveOrNewer
get
{
if (!s_isMojaveOrNewer.HasValue)
- s_isMojaveOrNewer = OperatingSystem.IsMacOSVersionAtLeast (10, 14);
+ s_isMojaveOrNewer = OperatingSystem.IsMacOSVersionAtLeast(10, 14);
return s_isMojaveOrNewer.Value;
}
}
diff --git a/src/Compatibility/Core/src/iOS/Renderers/ButtonRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ButtonRenderer.cs
index 4ce768b083a4..eda73f82a2e4 100644
--- a/src/Compatibility/Core/src/iOS/Renderers/ButtonRenderer.cs
+++ b/src/Compatibility/Core/src/iOS/Renderers/ButtonRenderer.cs
@@ -137,7 +137,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
if (e.PropertyName == Button.TextColorProperty.PropertyName)
UpdateTextColor();
- else if ( e.PropertyName == FontElement.FontAttributesProperty.PropertyName
+ else if (e.PropertyName == FontElement.FontAttributesProperty.PropertyName
|| e.PropertyName == FontElement.FontAutoScalingEnabledProperty.PropertyName
|| e.PropertyName == FontElement.FontFamilyProperty.PropertyName
|| e.PropertyName == FontElement.FontSizeProperty.PropertyName)
diff --git a/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs
index dc162ad40b5b..d6f305cbf33b 100644
--- a/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs
+++ b/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs
@@ -167,6 +167,7 @@ protected override void SetBackgroundColor(Color color)
UpdateCancelButton();
}
+ [PortHandler]
protected override void SetBackground(Brush brush)
{
base.SetBackground(brush);
diff --git a/src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj b/src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj
index c26ecc6d227f..b9672d210287 100644
--- a/src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj
+++ b/src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj
@@ -20,7 +20,7 @@
-
+
\ No newline at end of file
diff --git a/src/Compatibility/Maps/src/iOS/Compatibility.Maps.iOS.csproj b/src/Compatibility/Maps/src/iOS/Compatibility.Maps.iOS.csproj
index 379a69091670..cf3a86b4add7 100644
--- a/src/Compatibility/Maps/src/iOS/Compatibility.Maps.iOS.csproj
+++ b/src/Compatibility/Maps/src/iOS/Compatibility.Maps.iOS.csproj
@@ -16,7 +16,7 @@
-
+
\ No newline at end of file
diff --git a/src/Compatibility/Material/src/iOS/FormsMaterial.cs b/src/Compatibility/Material/src/iOS/FormsMaterial.cs
index 748b1bdd53b5..529a98d219d4 100644
--- a/src/Compatibility/Material/src/iOS/FormsMaterial.cs
+++ b/src/Compatibility/Material/src/iOS/FormsMaterial.cs
@@ -1,14 +1,14 @@
using System;
namespace Microsoft.Maui.Controls
{
- public static class FormsMaterial
- {
- public static void Init()
- {
+ public static class FormsMaterial
+ {
+ public static void Init()
+ {
// my only purpose is to exist so when called
// this dll doesn't get removed
VisualMarker.RegisterMaterial();
- }
- }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Compatibility/Material/src/iOS/MaterialActivityIndicatorRenderer.cs b/src/Compatibility/Material/src/iOS/MaterialActivityIndicatorRenderer.cs
index 7776ecb91691..7f0eded2fc46 100644
--- a/src/Compatibility/Material/src/iOS/MaterialActivityIndicatorRenderer.cs
+++ b/src/Compatibility/Material/src/iOS/MaterialActivityIndicatorRenderer.cs
@@ -78,7 +78,8 @@ public override void LayoutSubviews()
{
base.LayoutSubviews();
- if (Control == null) return;
+ if (Control == null)
+ return;
// try get the radius for this size
var min = NMath.Min(Control.Bounds.Width, Control.Bounds.Height);
var radius = min / 2;
diff --git a/src/Compatibility/Material/src/iOS/MaterialDatePickerRenderer.cs b/src/Compatibility/Material/src/iOS/MaterialDatePickerRenderer.cs
index 2069e1ba93de..7269cfe3f3b5 100644
--- a/src/Compatibility/Material/src/iOS/MaterialDatePickerRenderer.cs
+++ b/src/Compatibility/Material/src/iOS/MaterialDatePickerRenderer.cs
@@ -22,7 +22,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);
- if(e.NewElement != null)
+ if (e.NewElement != null)
UpdatePlaceholder();
}
diff --git a/src/Compatibility/Material/src/iOS/MaterialEditorRenderer.cs b/src/Compatibility/Material/src/iOS/MaterialEditorRenderer.cs
index 87711bfa0031..8afea74338ad 100644
--- a/src/Compatibility/Material/src/iOS/MaterialEditorRenderer.cs
+++ b/src/Compatibility/Material/src/iOS/MaterialEditorRenderer.cs
@@ -24,7 +24,7 @@ protected internal override void UpdateFont()
{
base.UpdateFont();
Control?.ApplyTypographyScheme(Element);
- }
+ }
protected internal override void UpdatePlaceholderText()
{
@@ -59,7 +59,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);
- if(e.NewElement != null)
+ if (e.NewElement != null)
InitialPlaceholderSetupHack();
}
@@ -75,7 +75,7 @@ protected internal override void UpdateAutoSizeOption()
base.UpdateAutoSizeOption();
Control.AutoSizeWithChanges = Element.AutoSize == EditorAutoSizeOption.TextChanges;
- if(!Control.ExpandsOnOverflow)
+ if (!Control.ExpandsOnOverflow)
Control.ExpandsOnOverflow = Element.AutoSize == EditorAutoSizeOption.TextChanges;
}
@@ -85,7 +85,7 @@ void InitialPlaceholderSetupHack()
if (Element == null)
return;
- if(String.IsNullOrWhiteSpace(Element.Text) || String.IsNullOrWhiteSpace(Element.Placeholder))
+ if (String.IsNullOrWhiteSpace(Element.Text) || String.IsNullOrWhiteSpace(Element.Placeholder))
{
_hackHasRan = true;
UpdateText();
diff --git a/src/Compatibility/Material/src/iOS/MaterialFrameRenderer.cs b/src/Compatibility/Material/src/iOS/MaterialFrameRenderer.cs
index 952e836af219..fbdf06b97673 100644
--- a/src/Compatibility/Material/src/iOS/MaterialFrameRenderer.cs
+++ b/src/Compatibility/Material/src/iOS/MaterialFrameRenderer.cs
@@ -251,7 +251,7 @@ void UpdateBorderColor()
SetBorderWidth(borderColor.IsDefault ? 0f : 1f, UIControlState.Normal);
}
}
-
+
void UpdateBackground()
{
if (_cardScheme.ColorScheme is SemanticColorScheme colorScheme)
diff --git a/src/Compatibility/Material/src/iOS/MaterialMultiLineTextField.cs b/src/Compatibility/Material/src/iOS/MaterialMultiLineTextField.cs
index 3f04260889de..3f9cf7aa53e3 100644
--- a/src/Compatibility/Material/src/iOS/MaterialMultiLineTextField.cs
+++ b/src/Compatibility/Material/src/iOS/MaterialMultiLineTextField.cs
@@ -81,7 +81,7 @@ void UpdateIfTextViewShouldStopExpanding()
if (!UpdateIfTextViewShouldCollapse() &&
!AutoSizeWithChanges &&
ExpandsOnOverflow &&
- ShouldRestrainSize())
+ ShouldRestrainSize())
{
ExpandsOnOverflow = false;
}
diff --git a/src/Compatibility/Material/src/iOS/MaterialProgressBarRenderer.cs b/src/Compatibility/Material/src/iOS/MaterialProgressBarRenderer.cs
index 619350bca85d..13fc40d4d0df 100644
--- a/src/Compatibility/Material/src/iOS/MaterialProgressBarRenderer.cs
+++ b/src/Compatibility/Material/src/iOS/MaterialProgressBarRenderer.cs
@@ -119,7 +119,7 @@ void UpdateAllColors()
if (progressColor.IsDefault)
{
- if(backgroundColor.IsDefault)
+ if (backgroundColor.IsDefault)
{
// reset everything to defaults
_colorScheme = CreateSemanticColorScheme();
diff --git a/src/Compatibility/Material/src/iOS/MaterialTextManager.cs b/src/Compatibility/Material/src/iOS/MaterialTextManager.cs
index 38f70602e219..029f83d40610 100644
--- a/src/Compatibility/Material/src/iOS/MaterialTextManager.cs
+++ b/src/Compatibility/Material/src/iOS/MaterialTextManager.cs
@@ -129,7 +129,7 @@ public static void UpdateTextColor(IMaterialTextField textField, IMaterialEntryR
textField.ContainerScheme.ColorScheme.PrimaryColor = uIColor;
}
- static Color AdjustTextColor(IMaterialEntryRenderer element)
+ static Color AdjustTextColor(IMaterialEntryRenderer element)
{
if (Forms.IsiOS14OrNewer)
{
diff --git a/src/Compatibility/Material/src/iOS/MaterialTimePickerRenderer.cs b/src/Compatibility/Material/src/iOS/MaterialTimePickerRenderer.cs
index 8f638bd478dc..75523674cc42 100644
--- a/src/Compatibility/Material/src/iOS/MaterialTimePickerRenderer.cs
+++ b/src/Compatibility/Material/src/iOS/MaterialTimePickerRenderer.cs
@@ -23,7 +23,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);
- if(e.NewElement != null)
+ if (e.NewElement != null)
UpdatePlaceholder();
}
diff --git a/src/Controls/Foldable/src/Controls.Foldable.csproj b/src/Controls/Foldable/src/Controls.Foldable.csproj
index 9787a4fc5f49..5363bb0bc29e 100644
--- a/src/Controls/Foldable/src/Controls.Foldable.csproj
+++ b/src/Controls/Foldable/src/Controls.Foldable.csproj
@@ -1,30 +1,27 @@
- netstandard2.1;netstandard2.0;$(_MauiDotNetTfm);$(MauiPlatforms)
+ $(_MauiDotNetTfm);$(MauiPlatforms)
Microsoft.Maui.Controls.Foldable
Microsoft.Maui.Controls.Foldable
BI1234
false
+
+ true
-
-
-
-
-
+
-
+
-
diff --git a/src/Controls/Foldable/test/TestDeviceInfo.cs b/src/Controls/Foldable/test/TestDeviceInfo.cs
index f7b6b1bb509c..12617f26dd58 100644
--- a/src/Controls/Foldable/test/TestDeviceInfo.cs
+++ b/src/Controls/Foldable/test/TestDeviceInfo.cs
@@ -11,10 +11,10 @@ public TestDeviceInfo()
public override Size PixelScreenSize
{
- get
- {
- if(CurrentOrientation == DeviceOrientation.Landscape)
- return new Size(1000, 2000);
+ get
+ {
+ if (CurrentOrientation == DeviceOrientation.Landscape)
+ return new Size(1000, 2000);
else
return new Size(2000, 1000);
}
diff --git a/src/Controls/Foldable/test/TestDualScreenService.cs b/src/Controls/Foldable/test/TestDualScreenService.cs
index fb02141f8594..102087cbfe00 100644
--- a/src/Controls/Foldable/test/TestDualScreenService.cs
+++ b/src/Controls/Foldable/test/TestDualScreenService.cs
@@ -33,7 +33,7 @@ public Rectangle GetHinge()
if (!IsSpanned)
return Rectangle.Zero;
- if(IsLandscape)
+ if (IsLandscape)
return new Rectangle(0, 490, DeviceInfo.ScaledScreenSize.Width, 20);
return new Rectangle(490, 0, 20, DeviceInfo.ScaledScreenSize.Height);
@@ -53,7 +53,7 @@ public object WatchForChangesOnLayout(VisualElement visualElement, Action action
public void StopWatchingForChangesOnLayout(VisualElement visualElement, object handle)
{
- if(handle is EventHandler> eh)
+ if (handle is EventHandler> eh)
visualElement.BatchCommitted -= eh;
}
diff --git a/src/Controls/Foldable/test/TwoPaneViewNotSpannedTests.cs b/src/Controls/Foldable/test/TwoPaneViewNotSpannedTests.cs
index 81c22d90622d..353082cb5744 100644
--- a/src/Controls/Foldable/test/TwoPaneViewNotSpannedTests.cs
+++ b/src/Controls/Foldable/test/TwoPaneViewNotSpannedTests.cs
@@ -341,7 +341,7 @@ public void Pane1BecomesVisibleAfterOnlyPane2IsVisibleTallMode()
twoPaneView.Layout(new Rectangle(0, 0, 300, 500));
twoPaneView.MinTallModeHeight = 4000;
twoPaneView.PanePriority = TwoPaneViewPriority.Pane2;
-
+
Assert.IsFalse(twoPaneView.Children[0].IsVisible);
Assert.IsTrue(twoPaneView.Children[1].IsVisible);
twoPaneView.MinTallModeHeight = 0;
diff --git a/src/Controls/Foldable/test/TwoPaneViewSpannedTests.cs b/src/Controls/Foldable/test/TwoPaneViewSpannedTests.cs
index d7671a807b95..b68f072c9aad 100644
--- a/src/Controls/Foldable/test/TwoPaneViewSpannedTests.cs
+++ b/src/Controls/Foldable/test/TwoPaneViewSpannedTests.cs
@@ -10,7 +10,7 @@ TwoPaneView CreateTwoPaneView(TestDualScreenService dualScreenService, View pane
pane1 = pane1 ?? new BoxView();
pane2 = pane2 ?? new BoxView();
dualScreenService.IsSpanned = true;
-
+
TwoPaneView view = new TwoPaneView(dualScreenService)
{
IsPlatformEnabled = true,
diff --git a/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs b/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs
index d547bab7f85a..effdbcdb46d7 100644
--- a/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs
@@ -4,6 +4,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
+using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample
{
diff --git a/src/Controls/samples/Controls.Sample.Sandbox/Platforms/Windows/Package.appxmanifest b/src/Controls/samples/Controls.Sample.Sandbox/Platforms/Windows/Package.appxmanifest
index 88ae00d83141..968c04010938 100644
--- a/src/Controls/samples/Controls.Sample.Sandbox/Platforms/Windows/Package.appxmanifest
+++ b/src/Controls/samples/Controls.Sample.Sandbox/Platforms/Windows/Package.appxmanifest
@@ -12,9 +12,9 @@
Version="1.0.0.0" />
- .NET MAUI Controls
+ $placeholder$
.NET Foundation
- appiconStoreLogo.png
+ $placeholder$.png
@@ -31,22 +31,22 @@
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
+ DisplayName="$placeholder$"
+ Description="$placeholder$"
+ Square150x150Logo="$placeholder$.png"
+ Square44x44Logo="$placeholder$.png"
+ BackgroundColor="transparent">
+ Square71x71Logo="$placeholder$.png"
+ Wide310x150Logo="$placeholder$.png"
+ Square310x310Logo="$placeholder$.png">
-
+
diff --git a/src/Controls/samples/Controls.Sample.Sandbox/SandboxShell.xaml b/src/Controls/samples/Controls.Sample.Sandbox/SandboxShell.xaml
new file mode 100644
index 000000000000..98a3bdfff5f6
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample.Sandbox/SandboxShell.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample.Sandbox/SandboxShell.xaml.cs b/src/Controls/samples/Controls.Sample.Sandbox/SandboxShell.xaml.cs
new file mode 100644
index 000000000000..ab352b8faf8d
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample.Sandbox/SandboxShell.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+
+namespace Maui.Controls.Sample
+{
+ public partial class SandboxShell : Shell
+ {
+ public SandboxShell()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.cs b/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.cs
new file mode 100644
index 000000000000..6db16bd63975
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.cs
@@ -0,0 +1,293 @@
+using System;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Shapes;
+using Microsoft.Maui.Graphics;
+using System.Runtime.CompilerServices;
+using Microsoft.Maui;
+
+namespace Maui.Controls.Sample.Controls
+{
+ public class Rate : TemplatedView
+ {
+ const string ElementPanel = "PART_Panel";
+
+ StackLayout _rateLayout;
+
+ public static readonly BindableProperty IconProperty =
+ BindableProperty.Create(nameof(Icon), typeof(Geometry), typeof(Rate), GetDefaultIcon());
+
+ public Geometry Icon
+ {
+ get => (Geometry)GetValue(IconProperty);
+ set => SetValue(IconProperty, value);
+ }
+
+ static Geometry GetDefaultIcon()
+ {
+ Application.Current.Resources.TryGetValue("StarGeometry", out object resource);
+ PathGeometry pathGeometry = (PathGeometry)resource;
+
+ return pathGeometry;
+ }
+
+ public static readonly BindableProperty ItemSizeProperty =
+ BindableProperty.Create(nameof(ItemSize), typeof(double), typeof(Rate), 30.0d);
+
+ public double ItemSize
+ {
+ get => (double)GetValue(ItemSizeProperty);
+ set => SetValue(ItemSizeProperty, value);
+ }
+
+ public static readonly BindableProperty ItemCountProperty =
+ BindableProperty.Create(nameof(ItemCount), typeof(int), typeof(Rate), 5);
+
+ public int ItemCount
+ {
+ get => (int)GetValue(ItemCountProperty);
+ set => SetValue(ItemCountProperty, value);
+ }
+
+ public static readonly BindableProperty SelectedFillProperty =
+ BindableProperty.Create(nameof(SelectedFill), typeof(Color), typeof(Rate), Color.FromArgb("#F6C602"));
+
+ public Color SelectedFill
+ {
+ get => (Color)GetValue(SelectedFillProperty);
+ set => SetValue(SelectedFillProperty, value);
+ }
+
+ public static readonly BindableProperty UnSelectedFillProperty =
+ BindableProperty.Create(nameof(UnSelectedFill), typeof(Color), typeof(Rate), Colors.Transparent);
+
+ public Color UnSelectedFill
+ {
+ get => (Color)GetValue(UnSelectedFillProperty);
+ set => SetValue(UnSelectedFillProperty, value);
+ }
+
+ public static readonly BindableProperty SelectedStrokeProperty =
+ BindableProperty.Create(nameof(SelectedStroke), typeof(Color), typeof(Rate), Color.FromArgb("#F6C602"));
+
+ public Color SelectedStroke
+ {
+ get => (Color)GetValue(SelectedStrokeProperty);
+ set => SetValue(SelectedStrokeProperty, value);
+ }
+
+ public static readonly BindableProperty UnSelectedStrokeProperty =
+ BindableProperty.Create(nameof(UnSelectedStroke), typeof(Color), typeof(Rate), Colors.Black);
+
+ public Color UnSelectedStroke
+ {
+ get => (Color)GetValue(UnSelectedStrokeProperty);
+ set => SetValue(UnSelectedStrokeProperty, value);
+ }
+
+ public static readonly BindableProperty SelectedStrokeWidthProperty =
+ BindableProperty.Create(nameof(SelectedStrokeWidth), typeof(double), typeof(Rate), 1.0d);
+
+ public double SelectedStrokeWidth
+ {
+ get => (double)GetValue(SelectedStrokeWidthProperty);
+ set => SetValue(SelectedStrokeWidthProperty, value);
+ }
+
+ public static readonly BindableProperty UnSelectedStrokeWidthProperty =
+ BindableProperty.Create(nameof(UnSelectedStrokeWidth), typeof(double), typeof(Rate), 1.0d);
+
+ public double UnSelectedStrokeWidth
+ {
+ get => (double)GetValue(UnSelectedStrokeWidthProperty);
+ set => SetValue(UnSelectedStrokeWidthProperty, value);
+ }
+
+ public static readonly BindableProperty TextProperty =
+ BindableProperty.Create(nameof(Text), typeof(string), typeof(Rate), default(string));
+
+ public string Text
+ {
+ get => (string)GetValue(TextProperty);
+ set => SetValue(TextProperty, value);
+ }
+
+ public static readonly BindableProperty ShowTextProperty =
+ BindableProperty.Create(nameof(ShowText), typeof(bool), typeof(Rate), false);
+
+ public bool ShowText
+ {
+ get => (bool)GetValue(ShowTextProperty);
+ set => SetValue(ShowTextProperty, value);
+ }
+
+ public static readonly BindableProperty IsReadOnlyProperty =
+ BindableProperty.Create(nameof(IsReadOnly), typeof(bool), typeof(Rate), false,
+ propertyChanged: OnIsReadOnlyChanged);
+
+ static void OnIsReadOnlyChanged(BindableObject bindable, object oldValue, object newValue)
+ {
+ (bindable as Rate)?.UpdateIsReadOnly();
+ }
+
+ public bool IsReadOnly
+ {
+ get => (bool)GetValue(IsReadOnlyProperty);
+ set => SetValue(IsReadOnlyProperty, value);
+ }
+
+ public static readonly BindableProperty ValueProperty =
+ BindableProperty.Create(nameof(Value), typeof(int), typeof(Rate), default(int));
+
+ public int Value
+ {
+ get => (int)GetValue(ValueProperty);
+ set => SetValue(ValueProperty, value);
+ }
+
+ public event EventHandler ValueChanged;
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _rateLayout = GetTemplateChild(ElementPanel) as StackLayout;
+
+ UpdateRateItems();
+ }
+
+ protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ base.OnPropertyChanged(propertyName);
+
+ if (propertyName == ValueProperty.PropertyName)
+ UpdateValue();
+ else if (propertyName == IconProperty.PropertyName)
+ UpdateIcon();
+ else if (propertyName == ItemCountProperty.PropertyName)
+ UpdateItemCount();
+ else if (propertyName == ItemSizeProperty.PropertyName)
+ UpdateItemSize();
+ else if (propertyName == SelectedFillProperty.PropertyName)
+ UpdateSelectedFill();
+ else if (propertyName == UnSelectedFillProperty.PropertyName)
+ UpdateUnSelectedFill();
+ else if (propertyName == SelectedStrokeProperty.PropertyName)
+ UpdateSelectedStroke();
+ else if (propertyName == UnSelectedStrokeProperty.PropertyName)
+ UpdateUnSelectedStroke();
+ else if (propertyName == SelectedStrokeWidthProperty.PropertyName)
+ UpdateSelectedStrokeWidth();
+ else if (propertyName == UnSelectedStrokeWidthProperty.PropertyName)
+ UpdateUnSelectedStrokeWidth();
+ }
+
+ void UpdateRateItems()
+ {
+ _rateLayout.Children.Clear();
+
+ for (var i = 1; i <= ItemCount; i++)
+ {
+ var rateItem = new RateItem();
+
+ _rateLayout.Children.Add((IView)rateItem);
+ }
+
+ UpdateIsReadOnly();
+ UpdateIcon();
+ UpdateItemSize();
+ UpdateSelectedFill();
+ UpdateUnSelectedFill();
+ UpdateSelectedStroke();
+ UpdateUnSelectedStroke();
+ UpdateSelectedStrokeWidth();
+ UpdateUnSelectedStrokeWidth();
+ }
+
+ void UpdateIsReadOnly()
+ {
+ if (IsReadOnly)
+ {
+ foreach (var rateItem in _rateLayout.Children)
+ (rateItem as View)?.GestureRecognizers.Clear();
+ }
+ else
+ {
+ foreach (var rateItem in _rateLayout.Children)
+ {
+ var tapGestureRecognizer = new TapGestureRecognizer();
+ tapGestureRecognizer.Tapped += OnTapped;
+ (rateItem as View)?.GestureRecognizers.Add(tapGestureRecognizer);
+ }
+ }
+ }
+
+ void UpdateIcon()
+ {
+ foreach (var child in _rateLayout.Children)
+ ((RateItem)child).Icon = Icon;
+ }
+
+ void UpdateItemCount()
+ {
+ UpdateRateItems();
+ }
+
+ void UpdateItemSize()
+ {
+ foreach (var child in _rateLayout.Children)
+ ((RateItem)child).ItemSize = ItemSize;
+ }
+
+ void UpdateSelectedFill()
+ {
+ foreach (var child in _rateLayout.Children)
+ ((RateItem)child).SelectedFill = SelectedFill;
+ }
+
+ void UpdateUnSelectedFill()
+ {
+ foreach (var child in _rateLayout.Children)
+ ((RateItem)child).UnSelectedFill = UnSelectedFill;
+ }
+
+ void UpdateSelectedStroke()
+ {
+ foreach (var child in _rateLayout.Children)
+ ((RateItem)child).SelectedFill = SelectedFill;
+ }
+
+ void UpdateUnSelectedStroke()
+ {
+ foreach (var child in _rateLayout.Children)
+ ((RateItem)child).UnSelectedFill = UnSelectedFill;
+ }
+
+ void UpdateSelectedStrokeWidth()
+ {
+ foreach (var child in _rateLayout.Children)
+ ((RateItem)child).SelectedStrokeWidth = SelectedStrokeWidth;
+ }
+
+ void UpdateUnSelectedStrokeWidth()
+ {
+ foreach (var child in _rateLayout.Children)
+ ((RateItem)child).UnSelectedStrokeWidth = UnSelectedStrokeWidth;
+ }
+
+ void UpdateValue()
+ {
+ for (int i = 0; i < ItemCount; i++)
+ ((RateItem)_rateLayout.Children[i]).IsSelected = i < Value;
+
+ ValueChanged?.Invoke(this, new ValueChangedEventArgs(Value));
+ }
+
+ void OnTapped(object sender, EventArgs e)
+ {
+ var star = (IView)sender;
+ var index = _rateLayout.Children.IndexOf(star);
+
+ Value = index + 1;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.xaml b/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.xaml
new file mode 100644
index 000000000000..6a359ca4b54a
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.xaml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.xaml.cs b/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.xaml.cs
new file mode 100644
index 000000000000..c5076524ddd5
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Controls/Rate/Rate.xaml.cs
@@ -0,0 +1,12 @@
+using Microsoft.Maui.Controls;
+
+namespace Maui.Controls.Sample.Themes
+{
+ public partial class Rate : ResourceDictionary
+ {
+ public Rate()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Controls/Rate/RateItem.cs b/src/Controls/samples/Controls.Sample/Controls/Rate/RateItem.cs
new file mode 100644
index 000000000000..02632d08218c
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Controls/Rate/RateItem.cs
@@ -0,0 +1,111 @@
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Shapes;
+using Microsoft.Maui.Graphics;
+
+namespace Maui.Controls.Sample.Controls
+{
+ public class RateItem : TemplatedView
+ {
+ const string ElementIcon = "PART_Icon";
+
+ View _icon;
+
+ public static readonly BindableProperty ItemSizeProperty =
+ BindableProperty.Create(nameof(ItemSize), typeof(double), typeof(RateItem), 30.0d);
+
+ public double ItemSize
+ {
+ get => (double)GetValue(ItemSizeProperty);
+ set => SetValue(ItemSizeProperty, value);
+ }
+
+ public static readonly BindableProperty SelectedFillProperty =
+ BindableProperty.Create(nameof(SelectedFill), typeof(Color), typeof(RateItem), Color.FromArgb("#F6C602"));
+
+ public Color SelectedFill
+ {
+ get => (Color)GetValue(SelectedFillProperty);
+ set => SetValue(SelectedFillProperty, value);
+ }
+
+ public static readonly BindableProperty UnSelectedFillProperty =
+ BindableProperty.Create(nameof(UnSelectedFill), typeof(Color), typeof(RateItem), Colors.Transparent);
+
+ public Color UnSelectedFill
+ {
+ get => (Color)GetValue(UnSelectedFillProperty);
+ set => SetValue(UnSelectedFillProperty, value);
+ }
+
+ public static readonly BindableProperty SelectedStrokeProperty =
+ BindableProperty.Create(nameof(SelectedStroke), typeof(Color), typeof(RateItem), Color.FromArgb("#F6C602"));
+
+ public Color SelectedStroke
+ {
+ get => (Color)GetValue(SelectedStrokeProperty);
+ set => SetValue(SelectedStrokeProperty, value);
+ }
+
+ public static readonly BindableProperty UnSelectedStrokeProperty =
+ BindableProperty.Create(nameof(UnSelectedStroke), typeof(Color), typeof(RateItem), Colors.Black);
+
+ public Color UnSelectedStroke
+ {
+ get => (Color)GetValue(UnSelectedStrokeProperty);
+ set => SetValue(UnSelectedStrokeProperty, value);
+ }
+
+ public static readonly BindableProperty SelectedStrokeWidthProperty =
+ BindableProperty.Create(nameof(SelectedStrokeWidth), typeof(double), typeof(RateItem), 1.0d);
+
+ public double SelectedStrokeWidth
+ {
+ get => (double)GetValue(SelectedStrokeWidthProperty);
+ set => SetValue(SelectedStrokeWidthProperty, value);
+ }
+
+ public static readonly BindableProperty UnSelectedStrokeWidthProperty =
+ BindableProperty.Create(nameof(UnSelectedStrokeWidth), typeof(double), typeof(RateItem), 1.0d);
+
+ public double UnSelectedStrokeWidth
+ {
+ get => (double)GetValue(UnSelectedStrokeWidthProperty);
+ set => SetValue(UnSelectedStrokeWidthProperty, value);
+ }
+
+ public static readonly BindableProperty IconProperty =
+ BindableProperty.Create(nameof(Icon), typeof(Geometry), typeof(RateItem), null);
+
+ public Geometry Icon
+ {
+ get => (Geometry)GetValue(IconProperty);
+ set => SetValue(IconProperty, value);
+ }
+
+ public static readonly BindableProperty IsReadOnlyProperty =
+ BindableProperty.Create(nameof(IsReadOnly), typeof(bool), typeof(RateItem), false);
+
+ public bool IsReadOnly
+ {
+ get => (bool)GetValue(IsReadOnlyProperty);
+ set => SetValue(IsReadOnlyProperty, value);
+ }
+
+ public static readonly BindableProperty IsSelectedProperty =
+ BindableProperty.Create(nameof(IsSelected), typeof(bool), typeof(RateItem), false);
+
+ public bool IsSelected
+ {
+ get => (bool)GetValue(IsSelectedProperty);
+ set => SetValue(IsSelectedProperty, value);
+ }
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _icon = GetTemplateChild(ElementIcon) as View;
+ _icon.WidthRequest = Width;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Controls/Rate/ValueChangedEventArgs.cs b/src/Controls/samples/Controls.Sample/Controls/Rate/ValueChangedEventArgs.cs
new file mode 100644
index 000000000000..4bff418fa8b6
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Controls/Rate/ValueChangedEventArgs.cs
@@ -0,0 +1,14 @@
+using System;
+
+namespace Maui.Controls.Sample.Controls
+{
+ public class ValueChangedEventArgs : EventArgs
+ {
+ public ValueChangedEventArgs(double value)
+ {
+ Value = value;
+ }
+
+ public double Value { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Models/SectionModel.cs b/src/Controls/samples/Controls.Sample/Models/SectionModel.cs
index 5e865af91044..6d3a95d21c26 100644
--- a/src/Controls/samples/Controls.Sample/Models/SectionModel.cs
+++ b/src/Controls/samples/Controls.Sample/Models/SectionModel.cs
@@ -4,11 +4,12 @@ namespace Maui.Controls.Sample.Models
{
public sealed class SectionModel
{
- public SectionModel(Type type, string title, string description)
+ public SectionModel(Type type, string title, string description, object viewModel = null)
{
Type = type;
Title = title;
Description = description;
+ ViewModel = viewModel;
}
public Type Type { get; }
@@ -16,5 +17,7 @@ public SectionModel(Type type, string title, string description)
public string Title { get; }
public string Description { get; }
+
+ public object ViewModel { get; }
}
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Base/BasePage.cs b/src/Controls/samples/Controls.Sample/Pages/Base/BasePage.cs
index 59a6289e908b..2184f99c6b31 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Base/BasePage.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Base/BasePage.cs
@@ -65,6 +65,11 @@ Page PreparePage(SectionModel model)
var page = (Handler?.MauiContext?.Services?.GetService(model.Type) as Page) ?? (Page)Activator.CreateInstance(model.Type);
page.Title = model.Title;
+ if (model.ViewModel != null)
+ {
+ page.BindingContext = model.ViewModel;
+ }
+
return page;
}
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/CheckBoxPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Controls/CheckBoxPage.xaml
index 881793600f98..d88481351b45 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/CheckBoxPage.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/CheckBoxPage.xaml
@@ -11,6 +11,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewNullGallery.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewNullGallery.xaml.cs
index 5d4c0d453f50..52e2e49ff12d 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewNullGallery.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewNullGallery.xaml.cs
@@ -17,13 +17,16 @@ public EmptyViewNullGallery(bool useOnlyText = true)
InitializeComponent();
string emptyViewText = "Nothing to display.";
CollectionView.EmptyView = useOnlyText ? emptyViewText :
- new Grid { Children = { new Label
+ new Grid
+ {
+ Children = { new Label
{
Text = emptyViewText,
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
FontAttributes = FontAttributes.Bold
- } } };
+ } }
+ };
}
}
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewStringGallery.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewStringGallery.xaml.cs
index 68610c4ac6db..ec35e2ee48f4 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewStringGallery.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/EmptyViewGalleries/EmptyViewStringGallery.xaml.cs
@@ -16,6 +16,17 @@ public EmptyViewStringGallery()
CollectionView.ItemsSource = _demoFilteredItemSource.Items;
+ SearchBar.PropertyChanged += (s, e) =>
+ {
+ if (e.PropertyName == nameof(SearchBar.Text))
+ {
+ if (string.IsNullOrEmpty(SearchBar.Text))
+ {
+ _demoFilteredItemSource.FilterItems(SearchBar.Text);
+ }
+ }
+ };
+
SearchBar.SearchCommand = new Command(() => _demoFilteredItemSource.FilterItems(SearchBar.Text));
}
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/ItemsSourceGenerator.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/ItemsSourceGenerator.cs
index 84e583a5408c..f176cfb33d83 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/ItemsSourceGenerator.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/CollectionViewGalleries/ItemsSourceGenerator.cs
@@ -165,7 +165,7 @@ public void GenerateEmptyObservableCollectionAndAddItemsEverySecond(bool resetBe
Dispatcher.StartTimer(TimeSpan.FromSeconds(1), () =>
{
//this test a issue with events firing out of order on IOS Obs Source
- if(resetBeforeAddItems)
+ if (resetBeforeAddItems)
{
items.Clear();
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/WebViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Controls/WebViewPage.xaml.cs
index bfca26eae92c..69b7749a7932 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Controls/WebViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Controls/WebViewPage.xaml.cs
@@ -3,9 +3,9 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;
using Microsoft.Maui.Devices;
using Microsoft.Maui.Storage;
-using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;
namespace Maui.Controls.Sample.Pages
{
diff --git a/src/Controls/samples/Controls.Sample/Pages/Core/ApplicationControlPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Core/ApplicationControlPage.xaml
index 97312200955c..1be9274b1ba6 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Core/ApplicationControlPage.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Core/ApplicationControlPage.xaml
@@ -4,14 +4,14 @@
x:Class="Maui.Controls.Sample.Pages.ApplicationControlPage"
xmlns:views="clr-namespace:Maui.Controls.Sample.Pages.Base"
Title="App Control">
-
-
-
-
-
+
+
+
-
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Core/BordersPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Core/BordersPage.xaml.cs
index c18bb7fd8fc2..f7b05c3263e7 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Core/BordersPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Core/BordersPage.xaml.cs
@@ -71,7 +71,7 @@ void OnContentBackgroundCheckBoxChanged(object sender, CheckedChangedEventArgs e
{
UpdateContentBackground();
}
-
+
void UpdateBorderShape()
{
CornerRadiusLayout.IsVisible = BorderShapePicker.SelectedIndex == 1;
diff --git a/src/Controls/samples/Controls.Sample/Pages/Core/MenuBarPage.cs b/src/Controls/samples/Controls.Sample/Pages/Core/MenuBarPage.cs
index cfdb976acd2f..c8d7d9f436a9 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Core/MenuBarPage.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Core/MenuBarPage.cs
@@ -19,7 +19,7 @@ void ItemClicked(object sender, EventArgs e)
{
if (sender is MenuFlyoutItem mfi)
{
- menuLabel.Text = $"You clicked on Menu Item: { mfi.Text}";
+ menuLabel.Text = $"You clicked on Menu Item: {mfi.Text}";
}
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/Core/ModalPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Core/ModalPage.xaml
index 1a01c9ced6a0..90872a63f4f2 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Core/ModalPage.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Core/ModalPage.xaml
@@ -5,12 +5,13 @@
x:Class="Maui.Controls.Sample.Pages.ModalPage"
xmlns:views="clr-namespace:Maui.Controls.Sample.Pages.Base">
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/src/Controls/samples/Controls.Sample/Pages/Core/ModalPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Core/ModalPage.xaml.cs
index 2efd6a881836..46185b49f2bc 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Core/ModalPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Core/ModalPage.xaml.cs
@@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
@@ -11,17 +12,38 @@ namespace Maui.Controls.Sample.Pages
public partial class ModalPage
{
static int s_instanceCount = 0;
+ string _previousTitle;
public ModalPage()
{
InitializeComponent();
BackgroundColor = Colors.Purple;
Title = $"Modal Page {s_instanceCount++}";
+ lblModalPageNumber.Text = $"Modal Page {s_instanceCount}";
}
+ protected override void OnNavigatingFrom(NavigatingFromEventArgs args)
+ {
+ _previousTitle = this.Window?.Title;
+ base.OnNavigatingFrom(args);
+ }
+
+ protected override void OnNavigatedTo(NavigatedToEventArgs args)
+ {
+ if (PopModal.IsVisible)
+ {
+ this.Window.Title = "Modal Gallery";
+ }
+ else
+ {
+ this.Window.Title = _previousTitle;
+ }
+ }
+
+
protected override void OnAppearing()
{
base.OnAppearing();
- PushModal.IsVisible = Navigation.ModalStack.Count > 0;
+ PopModal.IsVisible = Navigation.ModalStack.Count > 0;
}
async void PushNavigationModalClicked(object sender, EventArgs e)
@@ -66,7 +88,7 @@ async void PopModalClicked(object sender, EventArgs e)
async void PushFlyoutPageClicked(object sender, EventArgs e)
{
var modalPage = new ModalPage();
- Page newMainPage = new NavigationPage(new ModalPage())
+ Page newMainPage = new NavigationPage(modalPage)
{
BackgroundColor =
(BackgroundColor == Colors.Purple) ? Colors.Pink : Colors.Purple,
@@ -86,4 +108,4 @@ async void PushFlyoutPageClicked(object sender, EventArgs e)
await Navigation.PushModalAsync(flyoutPage);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPage.xaml
index aeaa9729e58b..c416fc3880e9 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPage.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPage.xaml
@@ -2,36 +2,82 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Pages.ScrollViewPage"
+ xmlns:controls="using:Maui.Controls.Sample.Controls"
xmlns:views="clr-namespace:Maui.Controls.Sample.Pages.Base"
+ xmlns:viewmodels="clr-namespace:Maui.Controls.Sample.ViewModels"
Title="ScrollView">
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPage.xaml.cs
index 5b938c3cc66f..119e8bc3e411 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPage.xaml.cs
@@ -9,15 +9,5 @@ public ScrollViewPage()
{
InitializeComponent();
}
-
- async void OnButtonClicked(object sender, EventArgs e)
- {
- await scrollView.ScrollToAsync(finalLabel, ScrollToPosition.End, true);
- }
-
- void OnScrollViewScrolled(object sender, ScrolledEventArgs e)
- {
- Console.WriteLine($"ScrollX: {e.ScrollX}, ScrollY: {e.ScrollY}");
- }
}
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollToEndPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollToEndPage.xaml
new file mode 100644
index 000000000000..5f09b24bd1e1
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollToEndPage.xaml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollToEndPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollToEndPage.xaml.cs
new file mode 100644
index 000000000000..e808dcff89b7
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollToEndPage.xaml.cs
@@ -0,0 +1,23 @@
+using System;
+using Microsoft.Maui.Controls;
+
+namespace Maui.Controls.Sample.Pages.ScrollViewPages
+{
+ public partial class ScrollToEndPage
+ {
+ public ScrollToEndPage()
+ {
+ InitializeComponent();
+ }
+
+ async void OnButtonClicked(object sender, EventArgs e)
+ {
+ await scrollView.ScrollToAsync(finalLabel, ScrollToPosition.End, true);
+ }
+
+ void OnScrollViewScrolled(object sender, ScrolledEventArgs e)
+ {
+ Console.WriteLine($"ScrollX: {e.ScrollX}, ScrollY: {e.ScrollY}");
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollViewTemplatePage.xaml b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollViewTemplatePage.xaml
new file mode 100644
index 000000000000..9fca661bba56
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollViewTemplatePage.xaml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollViewTemplatePage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollViewTemplatePage.xaml.cs
new file mode 100644
index 000000000000..12c580d781f4
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/Pages/Layouts/ScrollViewPages/ScrollViewTemplatePage.xaml.cs
@@ -0,0 +1,38 @@
+using System;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Graphics;
+
+namespace Maui.Controls.Sample.Pages.ScrollViewPages
+{
+ public partial class ScrollViewTemplatePage
+ {
+ int count = 0;
+
+ public ScrollViewTemplatePage()
+ {
+ InitializeComponent();
+ }
+
+ private void OnCounterClicked(object sender, EventArgs e)
+ {
+ count++;
+
+ if (count == 1)
+ CounterBtn.Text = $"Clicked {count} time";
+ else
+ CounterBtn.Text = $"Clicked {count} times";
+ }
+ }
+
+ public class ScrollViewTemplatePageModel
+ {
+ public int Spacing { get; set; } = 25;
+
+ public LayoutOptions VerticalAlignment { get; set; } = LayoutOptions.Center;
+
+ public Thickness ScrollViewPadding { get; set; } = Thickness.Zero;
+
+ public Color ContentBackground { get; set; } = Colors.Transparent;
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Layouts/TemplatedViewPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Layouts/TemplatedViewPage.xaml
index 0949ca931c19..3da5a11f32b9 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Layouts/TemplatedViewPage.xaml
+++ b/src/Controls/samples/Controls.Sample/Pages/Layouts/TemplatedViewPage.xaml
@@ -35,7 +35,11 @@
-
+
+
+
@@ -78,6 +82,22 @@
IconBackgroundColor="SlateGray"
IconImageSource="dotnet_bot.png"
ControlTemplate="{StaticResource CardViewCompressed}" />
+
+
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/Others/GraphicsViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Others/GraphicsViewPage.xaml.cs
index 0ea198e07e0c..3851799303fd 100644
--- a/src/Controls/samples/Controls.Sample/Pages/Others/GraphicsViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/Others/GraphicsViewPage.xaml.cs
@@ -52,14 +52,14 @@ void UpdateInteractions(string name, TouchEventArgs e)
labelInteractions.Text = $"{name}: "
+ string.Join(", ", e.Touches.Select(t => $"[{Math.Round(t.X, 1)},{Math.Round(t.Y, 1)}]"))
+ $" IsInsideBounds: {e.IsInsideBounds}");
-
+
Dispatcher.DispatchAsync(() =>
labelGestures.Text = string.Empty);
}
void UpdateGestures(string name)
{
- Dispatcher.DispatchAsync(() =>
+ Dispatcher.DispatchAsync(() =>
labelGestures.Text = $"{name}");
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidButtonPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidButtonPage.xaml.cs
index 61b694f4af34..311c0a894d75 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidButtonPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidButtonPage.xaml.cs
@@ -2,11 +2,11 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidButtonPage : ContentPage
- {
- public AndroidButtonPage()
- {
- InitializeComponent();
- }
- }
+ public partial class AndroidButtonPage : ContentPage
+ {
+ public AndroidButtonPage()
+ {
+ InitializeComponent();
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidEntryPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidEntryPage.xaml.cs
index d5096a70b4ae..603e809a2423 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidEntryPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidEntryPage.xaml.cs
@@ -5,12 +5,12 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidEntryPage : ContentPage
- {
- public AndroidEntryPage()
- {
- InitializeComponent();
- }
+ public partial class AndroidEntryPage : ContentPage
+ {
+ public AndroidEntryPage()
+ {
+ InitializeComponent();
+ }
void OnSelectedIndexChanged(object sender, EventArgs e)
{
@@ -18,5 +18,5 @@ void OnSelectedIndexChanged(object sender, EventArgs e)
_entry.On().SetImeOptions(flag);
_label.Text = $"ImeOptions: {_entry.On().ImeOptions()}";
}
- }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidListViewFastScrollPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidListViewFastScrollPage.xaml.cs
index 59343e2a0f18..143d814ff2b1 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidListViewFastScrollPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidListViewFastScrollPage.xaml.cs
@@ -1,22 +1,22 @@
using System;
+using Maui.Controls.Sample.ViewModels;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;
-using Maui.Controls.Sample.ViewModels;
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidListViewFastScrollPage : ContentPage
- {
- public AndroidListViewFastScrollPage()
- {
- InitializeComponent();
- BindingContext = new ListViewViewModel();
- }
+ public partial class AndroidListViewFastScrollPage : ContentPage
+ {
+ public AndroidListViewFastScrollPage()
+ {
+ InitializeComponent();
+ BindingContext = new ListViewViewModel();
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- listView.On().SetIsFastScrollEnabled(!listView.On().IsFastScrollEnabled());
- }
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ listView.On().SetIsFastScrollEnabled(!listView.On().IsFastScrollEnabled());
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidNavigationPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidNavigationPage.xaml.cs
index b4c3e344de54..67deb12e9716 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidNavigationPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidNavigationPage.xaml.cs
@@ -2,12 +2,12 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidNavigationPage : NavigationPage
- {
- public AndroidNavigationPage()
- {
- InitializeComponent();
- PushAsync(new AndroidTitleViewPage());
- }
- }
+ public partial class AndroidNavigationPage : NavigationPage
+ {
+ public AndroidNavigationPage()
+ {
+ InitializeComponent();
+ PushAsync(new AndroidTitleViewPage());
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidSwipeViewTransitionModePage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidSwipeViewTransitionModePage.xaml.cs
index 6d9ead893668..4cb3bbce5bcc 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidSwipeViewTransitionModePage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidSwipeViewTransitionModePage.xaml.cs
@@ -7,22 +7,22 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidSwipeViewTransitionModePage : ContentPage
- {
- public AndroidSwipeViewTransitionModePage()
- {
- InitializeComponent();
- }
+ public partial class AndroidSwipeViewTransitionModePage : ContentPage
+ {
+ public AndroidSwipeViewTransitionModePage()
+ {
+ InitializeComponent();
+ }
- void OnSwipeViewTransitionModeChanged(object sender, EventArgs e)
- {
- SwipeTransitionMode transitionMode = (SwipeTransitionMode)(sender as EnumPicker).SelectedItem;
- swipeView.On().SetSwipeTransitionMode(transitionMode);
- }
+ void OnSwipeViewTransitionModeChanged(object sender, EventArgs e)
+ {
+ SwipeTransitionMode transitionMode = (SwipeTransitionMode)(sender as EnumPicker).SelectedItem;
+ swipeView.On().SetSwipeTransitionMode(transitionMode);
+ }
- async void OnDeleteSwipeItemInvoked(object sender, EventArgs e)
- {
- await DisplayAlert("SwipeView", "Delete invoked.", "OK");
- }
- }
+ async void OnDeleteSwipeItemInvoked(object sender, EventArgs e)
+ {
+ await DisplayAlert("SwipeView", "Delete invoked.", "OK");
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidTabbedPageSwipePage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidTabbedPageSwipePage.xaml.cs
index c5f9ec2fd29b..4c634ade6916 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidTabbedPageSwipePage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidTabbedPageSwipePage.xaml.cs
@@ -6,35 +6,35 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidTabbedPageSwipePage : Microsoft.Maui.Controls.TabbedPage
- {
- ICommand _returnToPlatformSpecificsPage;
+ public partial class AndroidTabbedPageSwipePage : Microsoft.Maui.Controls.TabbedPage
+ {
+ ICommand _returnToPlatformSpecificsPage;
- public AndroidTabbedPageSwipePage()
- {
- InitializeComponent();
- }
+ public AndroidTabbedPageSwipePage()
+ {
+ InitializeComponent();
+ }
- public AndroidTabbedPageSwipePage(ICommand restore)
- {
- InitializeComponent();
+ public AndroidTabbedPageSwipePage(ICommand restore)
+ {
+ InitializeComponent();
- _returnToPlatformSpecificsPage = restore;
- }
+ _returnToPlatformSpecificsPage = restore;
+ }
- void OnSwipePagingButtonClicked(object sender, EventArgs e)
- {
- On().SetIsSwipePagingEnabled(!On().IsSwipePagingEnabled());
- }
+ void OnSwipePagingButtonClicked(object sender, EventArgs e)
+ {
+ On().SetIsSwipePagingEnabled(!On().IsSwipePagingEnabled());
+ }
- void OnSmoothScrollButtonClicked(object sender, EventArgs e)
- {
- On().SetIsSmoothScrollEnabled(!On().IsSmoothScrollEnabled());
- }
+ void OnSmoothScrollButtonClicked(object sender, EventArgs e)
+ {
+ On().SetIsSmoothScrollEnabled(!On().IsSmoothScrollEnabled());
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- _returnToPlatformSpecificsPage?.Execute(null);
- }
- }
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ _returnToPlatformSpecificsPage?.Execute(null);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidTitleViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidTitleViewPage.xaml.cs
index 1e005c9274df..7be968c3d953 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidTitleViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidTitleViewPage.xaml.cs
@@ -1,30 +1,30 @@
-using Microsoft.Maui.Controls;
-using System;
+using System;
using System.Windows.Input;
+using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidTitleViewPage : ContentPage
- {
- readonly ICommand _returnToPlatformSpecificsPage;
+ public partial class AndroidTitleViewPage : ContentPage
+ {
+ readonly ICommand _returnToPlatformSpecificsPage;
- public AndroidTitleViewPage()
- {
- InitializeComponent();
- }
+ public AndroidTitleViewPage()
+ {
+ InitializeComponent();
+ }
- public AndroidTitleViewPage(ICommand restore)
- {
- InitializeComponent();
- _returnToPlatformSpecificsPage = restore;
- }
+ public AndroidTitleViewPage(ICommand restore)
+ {
+ InitializeComponent();
+ _returnToPlatformSpecificsPage = restore;
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- if (_returnToPlatformSpecificsPage == null)
- return;
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ if (_returnToPlatformSpecificsPage == null)
+ return;
- _returnToPlatformSpecificsPage.Execute(null);
- }
- }
+ _returnToPlatformSpecificsPage.Execute(null);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidWebViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidWebViewPage.xaml.cs
index e6d20e151926..7a7d540e8491 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidWebViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidWebViewPage.xaml.cs
@@ -2,11 +2,11 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidWebViewPage : ContentPage
- {
- public AndroidWebViewPage()
- {
- InitializeComponent();
- }
- }
+ public partial class AndroidWebViewPage : ContentPage
+ {
+ public AndroidWebViewPage()
+ {
+ InitializeComponent();
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidWebViewZoomPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidWebViewZoomPage.xaml.cs
index 287cd4db3af1..cfff7dc8dcbd 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidWebViewZoomPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Android/AndroidWebViewZoomPage.xaml.cs
@@ -2,11 +2,11 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class AndroidWebViewZoomPage : ContentPage
- {
- public AndroidWebViewZoomPage()
- {
- InitializeComponent();
- }
- }
+ public partial class AndroidWebViewZoomPage : ContentPage
+ {
+ public AndroidWebViewZoomPage()
+ {
+ InitializeComponent();
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/ContentPageTwo.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/ContentPageTwo.xaml.cs
index da384ba3f90d..752be7d298b6 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/ContentPageTwo.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/ContentPageTwo.xaml.cs
@@ -1,22 +1,22 @@
-using System.Windows.Input;
-using System;
+using System;
+using System.Windows.Input;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.Pages
{
- public partial class ContentPageTwo : ContentPage
- {
- ICommand _returnToPlatformSpecificsPage;
+ public partial class ContentPageTwo : ContentPage
+ {
+ ICommand _returnToPlatformSpecificsPage;
- public ContentPageTwo(ICommand restore)
- {
- InitializeComponent();
- _returnToPlatformSpecificsPage = restore;
- }
+ public ContentPageTwo(ICommand restore)
+ {
+ InitializeComponent();
+ _returnToPlatformSpecificsPage = restore;
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- _returnToPlatformSpecificsPage.Execute(null);
- }
- }
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ _returnToPlatformSpecificsPage.Execute(null);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsAddRemoveToolbarItemsPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsAddRemoveToolbarItemsPage.xaml.cs
index ae0beb31ae6c..275b5591b7cf 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsAddRemoveToolbarItemsPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsAddRemoveToolbarItemsPage.xaml.cs
@@ -4,21 +4,21 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class WindowsAddRemoveToolbarItemsPage : ContentPage
- {
- public static readonly BindableProperty ParentPageProperty = BindableProperty.Create("ParentPage", typeof(Page), typeof(WindowsAddRemoveToolbarItemsPage), null);
+ public partial class WindowsAddRemoveToolbarItemsPage : ContentPage
+ {
+ public static readonly BindableProperty ParentPageProperty = BindableProperty.Create("ParentPage", typeof(Page), typeof(WindowsAddRemoveToolbarItemsPage), null);
- public Page ParentPage
- {
- get { return (Page)GetValue(ParentPageProperty); }
- set { SetValue(ParentPageProperty, value); }
- }
+ public Page ParentPage
+ {
+ get { return (Page)GetValue(ParentPageProperty); }
+ set { SetValue(ParentPageProperty, value); }
+ }
readonly Action _action;
- public WindowsAddRemoveToolbarItemsPage()
- {
- InitializeComponent();
+ public WindowsAddRemoveToolbarItemsPage()
+ {
+ InitializeComponent();
#if WINDOWS
_action = () => ParentPage.DisplayAlert(WindowsPlatformSpecificsHelpers.Title, WindowsPlatformSpecificsHelpers.Message, WindowsPlatformSpecificsHelpers.Dismiss);
#else
@@ -27,23 +27,23 @@ public WindowsAddRemoveToolbarItemsPage()
}
void OnAddPrimaryButtonClicked(object sender, EventArgs e)
- {
- int index = ParentPage.ToolbarItems.Count(item => item.Order == ToolbarItemOrder.Primary) + 1;
- ParentPage.ToolbarItems.Add(new ToolbarItem(string.Format("Primary {0}", index), "calculator.png", _action, ToolbarItemOrder.Primary));
- }
+ {
+ int index = ParentPage.ToolbarItems.Count(item => item.Order == ToolbarItemOrder.Primary) + 1;
+ ParentPage.ToolbarItems.Add(new ToolbarItem(string.Format("Primary {0}", index), "calculator.png", _action, ToolbarItemOrder.Primary));
+ }
- void OnAddSecondaryButtonClicked(object sender, EventArgs e)
- {
- int index = ParentPage.ToolbarItems.Count(item => item.Order == ToolbarItemOrder.Secondary) + 1;
- ParentPage.ToolbarItems.Add(new ToolbarItem(string.Format("Secondary {0}", index), "calculator.png", _action, ToolbarItemOrder.Secondary));
- }
+ void OnAddSecondaryButtonClicked(object sender, EventArgs e)
+ {
+ int index = ParentPage.ToolbarItems.Count(item => item.Order == ToolbarItemOrder.Secondary) + 1;
+ ParentPage.ToolbarItems.Add(new ToolbarItem(string.Format("Secondary {0}", index), "calculator.png", _action, ToolbarItemOrder.Secondary));
+ }
- void OnRemoveButtonClicked(object sender, EventArgs e)
- {
- if (ParentPage.ToolbarItems.Any())
- {
- ParentPage.ToolbarItems.RemoveAt(0);
- }
- }
- }
+ void OnRemoveButtonClicked(object sender, EventArgs e)
+ {
+ if (ParentPage.ToolbarItems.Any())
+ {
+ ParentPage.ToolbarItems.RemoveAt(0);
+ }
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsCollapseStyleChangerPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsCollapseStyleChangerPage.xaml.cs
index 496131558bc4..b14cdddaaeeb 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsCollapseStyleChangerPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsCollapseStyleChangerPage.xaml.cs
@@ -4,45 +4,45 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class WindowsCollapseStyleChangerPage : ContentPage
- {
- public static readonly BindableProperty ParentPageProperty = BindableProperty.Create("ParentPage", typeof(Microsoft.Maui.Controls.FlyoutPage), typeof(WindowsCollapseStyleChangerPage), null, propertyChanged:OnParentPagePropertyChanged);
+ public partial class WindowsCollapseStyleChangerPage : ContentPage
+ {
+ public static readonly BindableProperty ParentPageProperty = BindableProperty.Create("ParentPage", typeof(Microsoft.Maui.Controls.FlyoutPage), typeof(WindowsCollapseStyleChangerPage), null, propertyChanged: OnParentPagePropertyChanged);
- public Microsoft.Maui.Controls.FlyoutPage ParentPage
- {
- get { return (Microsoft.Maui.Controls.FlyoutPage)GetValue(ParentPageProperty); }
- set { SetValue(ParentPageProperty, value); }
- }
+ public Microsoft.Maui.Controls.FlyoutPage ParentPage
+ {
+ get { return (Microsoft.Maui.Controls.FlyoutPage)GetValue(ParentPageProperty); }
+ set { SetValue(ParentPageProperty, value); }
+ }
- public WindowsCollapseStyleChangerPage()
- {
- InitializeComponent();
- PopulatePicker();
- }
+ public WindowsCollapseStyleChangerPage()
+ {
+ InitializeComponent();
+ PopulatePicker();
+ }
- void PopulatePicker()
- {
- var enumType = typeof(CollapseStyle);
- var collapseOptions = Enum.GetNames(enumType);
- foreach (string option in collapseOptions)
- {
- picker.Items.Add(option);
- }
- }
+ void PopulatePicker()
+ {
+ var enumType = typeof(CollapseStyle);
+ var collapseOptions = Enum.GetNames(enumType);
+ foreach (string option in collapseOptions)
+ {
+ picker.Items.Add(option);
+ }
+ }
- void OnPickerSelectedIndexChanged(object sender, EventArgs e)
- {
- ParentPage.On().SetCollapseStyle((CollapseStyle)Enum.Parse(typeof(CollapseStyle), picker.Items[picker.SelectedIndex]));
- }
+ void OnPickerSelectedIndexChanged(object sender, EventArgs e)
+ {
+ ParentPage.On().SetCollapseStyle((CollapseStyle)Enum.Parse(typeof(CollapseStyle), picker.Items[picker.SelectedIndex]));
+ }
- static void OnParentPagePropertyChanged(BindableObject element, object oldValue, object newValue)
- {
- if (newValue != null)
- {
- var enumType = typeof(CollapseStyle);
- var instance = element as WindowsCollapseStyleChangerPage;
- instance.picker.SelectedIndex = Array.IndexOf(Enum.GetNames(enumType), Enum.GetName(enumType, instance.ParentPage.On().GetCollapseStyle()));
- }
- }
- }
+ static void OnParentPagePropertyChanged(BindableObject element, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var enumType = typeof(CollapseStyle);
+ var instance = element as WindowsCollapseStyleChangerPage;
+ instance.picker.SelectedIndex = Array.IndexOf(Enum.GetNames(enumType), Enum.GetName(enumType, instance.ParentPage.On().GetCollapseStyle()));
+ }
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsCollapseWidthAdjusterPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsCollapseWidthAdjusterPage.xaml.cs
index 358ee0154b82..ad335f2cfa84 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsCollapseWidthAdjusterPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsCollapseWidthAdjusterPage.xaml.cs
@@ -4,37 +4,37 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class WindowsCollapseWidthAdjusterPage : ContentPage
- {
- public static readonly BindableProperty ParentPageProperty = BindableProperty.Create("ParentPage", typeof(Microsoft.Maui.Controls.FlyoutPage), typeof(WindowsCollapseWidthAdjusterPage), null, propertyChanged:OnParentPagePropertyChanged);
+ public partial class WindowsCollapseWidthAdjusterPage : ContentPage
+ {
+ public static readonly BindableProperty ParentPageProperty = BindableProperty.Create("ParentPage", typeof(Microsoft.Maui.Controls.FlyoutPage), typeof(WindowsCollapseWidthAdjusterPage), null, propertyChanged: OnParentPagePropertyChanged);
- public Microsoft.Maui.Controls.FlyoutPage ParentPage
- {
- get { return (Microsoft.Maui.Controls.FlyoutPage)GetValue(ParentPageProperty); }
- set { SetValue(ParentPageProperty, value); }
- }
+ public Microsoft.Maui.Controls.FlyoutPage ParentPage
+ {
+ get { return (Microsoft.Maui.Controls.FlyoutPage)GetValue(ParentPageProperty); }
+ set { SetValue(ParentPageProperty, value); }
+ }
- public WindowsCollapseWidthAdjusterPage()
- {
- InitializeComponent();
- }
+ public WindowsCollapseWidthAdjusterPage()
+ {
+ InitializeComponent();
+ }
- void OnChangeButtonClicked(object sender, EventArgs e)
- {
- double width;
- if (double.TryParse(entry.Text, out width))
- {
- ParentPage.On().CollapsedPaneWidth(width);
- }
- }
+ void OnChangeButtonClicked(object sender, EventArgs e)
+ {
+ double width;
+ if (double.TryParse(entry.Text, out width))
+ {
+ ParentPage.On().CollapsedPaneWidth(width);
+ }
+ }
- static void OnParentPagePropertyChanged(BindableObject element, object oldValue, object newValue)
- {
- if (newValue != null)
- {
- var instance = element as WindowsCollapseWidthAdjusterPage;
- instance.entry.Text = instance.ParentPage.On().CollapsedPaneWidth().ToString();
- }
- }
- }
+ static void OnParentPagePropertyChanged(BindableObject element, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var instance = element as WindowsCollapseWidthAdjusterPage;
+ instance.entry.Text = instance.ParentPage.On().CollapsedPaneWidth().ToString();
+ }
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsListViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsListViewPage.xaml.cs
index 89248a7e59f5..17af82351717 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsListViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsListViewPage.xaml.cs
@@ -1,46 +1,46 @@
using System;
+using Maui.Controls.Sample.ViewModels;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
-using Maui.Controls.Sample.ViewModels;
namespace Maui.Controls.Sample.Pages
{
- public partial class WindowsListViewPage : ContentPage
- {
- public WindowsListViewPage()
- {
- InitializeComponent();
+ public partial class WindowsListViewPage : ContentPage
+ {
+ public WindowsListViewPage()
+ {
+ InitializeComponent();
BindingContext = new ListViewViewModel();
- UpdateLabel();
- }
+ UpdateLabel();
+ }
- async void OnListViewItemTapped(object sender, ItemTappedEventArgs e)
- {
- await DisplayAlert("Item Tapped", "ItemTapped event fired.", "OK");
- }
+ async void OnListViewItemTapped(object sender, ItemTappedEventArgs e)
+ {
+ await DisplayAlert("Item Tapped", "ItemTapped event fired.", "OK");
+ }
- async void TapGestureRecognizer_Tapped(object sender, EventArgs e)
- {
- await DisplayAlert("Tap Gesture Recognizer", "Tapped event fired.", "OK");
- }
+ async void TapGestureRecognizer_Tapped(object sender, EventArgs e)
+ {
+ await DisplayAlert("Tap Gesture Recognizer", "Tapped event fired.", "OK");
+ }
- void OnToggleButtonClicked(object sender, EventArgs e)
- {
- switch (_listView.On().GetSelectionMode())
- {
- case Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListViewSelectionMode.Accessible:
- _listView.On().SetSelectionMode(Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListViewSelectionMode.Inaccessible);
- break;
- case Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListViewSelectionMode.Inaccessible:
- _listView.On().SetSelectionMode(Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListViewSelectionMode.Accessible);
- break;
- }
- UpdateLabel();
- }
+ void OnToggleButtonClicked(object sender, EventArgs e)
+ {
+ switch (_listView.On().GetSelectionMode())
+ {
+ case Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListViewSelectionMode.Accessible:
+ _listView.On().SetSelectionMode(Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListViewSelectionMode.Inaccessible);
+ break;
+ case Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListViewSelectionMode.Inaccessible:
+ _listView.On().SetSelectionMode(Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.ListViewSelectionMode.Accessible);
+ break;
+ }
+ UpdateLabel();
+ }
- void UpdateLabel()
- {
- _label.Text = $"ListView SelectionMode: {_listView.On().GetSelectionMode()}";
- }
- }
+ void UpdateLabel()
+ {
+ _label.Text = $"ListView SelectionMode: {_listView.On().GetSelectionMode()}";
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsRefreshViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsRefreshViewPage.xaml.cs
index d971e27787e8..97c49302154e 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsRefreshViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsRefreshViewPage.xaml.cs
@@ -7,16 +7,16 @@ namespace Maui.Controls.Sample.Pages
{
public partial class WindowsRefreshViewPage : ContentPage
{
- public WindowsRefreshViewPage ()
+ public WindowsRefreshViewPage()
{
- InitializeComponent ();
- enumPicker.EnumType = typeof(Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.RefreshView.RefreshPullDirection);
- enumPicker.SelectedIndex = 0;
+ InitializeComponent();
+ enumPicker.EnumType = typeof(Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.RefreshView.RefreshPullDirection);
+ enumPicker.SelectedIndex = 0;
}
- void OnSelectedIndexChanged(object sender, EventArgs e)
- {
- refreshView.On().SetRefreshPullDirection((RefreshPullDirection)enumPicker.SelectedItem);
- }
- }
+ void OnSelectedIndexChanged(object sender, EventArgs e)
+ {
+ refreshView.On().SetRefreshPullDirection((RefreshPullDirection)enumPicker.SelectedItem);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsSearchBarPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsSearchBarPage.xaml.cs
index 416188bbb933..1383b020313d 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsSearchBarPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsSearchBarPage.xaml.cs
@@ -4,16 +4,16 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class WindowsSearchBarPage : ContentPage
- {
- public WindowsSearchBarPage()
- {
- InitializeComponent();
- }
+ public partial class WindowsSearchBarPage : ContentPage
+ {
+ public WindowsSearchBarPage()
+ {
+ InitializeComponent();
+ }
- void OnToggleButtonClicked(object sender, EventArgs e)
+ void OnToggleButtonClicked(object sender, EventArgs e)
{
_searchBar.On().SetIsSpellCheckEnabled(!_searchBar.On().GetIsSpellCheckEnabled());
}
- }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsToolbarPlacementChangerPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsToolbarPlacementChangerPage.xaml.cs
index 476d7bf70def..cf4a10b7855a 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsToolbarPlacementChangerPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsToolbarPlacementChangerPage.xaml.cs
@@ -4,46 +4,46 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class WindowsToolbarPlacementChangerPage : ContentPage
- {
- public static readonly BindableProperty ParentPageProperty = BindableProperty.Create("ParentPage", typeof(Microsoft.Maui.Controls.Page), typeof(WindowsToolbarPlacementChangerPage), null, propertyChanged:OnParentPagePropertyChanged);
+ public partial class WindowsToolbarPlacementChangerPage : ContentPage
+ {
+ public static readonly BindableProperty ParentPageProperty = BindableProperty.Create("ParentPage", typeof(Microsoft.Maui.Controls.Page), typeof(WindowsToolbarPlacementChangerPage), null, propertyChanged: OnParentPagePropertyChanged);
- public Microsoft.Maui.Controls.Page ParentPage
- {
- get { return (Microsoft.Maui.Controls.Page)GetValue(ParentPageProperty); }
- set { SetValue(ParentPageProperty, value); }
- }
+ public Microsoft.Maui.Controls.Page ParentPage
+ {
+ get { return (Microsoft.Maui.Controls.Page)GetValue(ParentPageProperty); }
+ set { SetValue(ParentPageProperty, value); }
+ }
- public WindowsToolbarPlacementChangerPage()
- {
- InitializeComponent();
- PopulatePicker();
- }
+ public WindowsToolbarPlacementChangerPage()
+ {
+ InitializeComponent();
+ PopulatePicker();
+ }
- void PopulatePicker()
- {
- var enumType = typeof(ToolbarPlacement);
- var placementOptions = Enum.GetNames(enumType);
- foreach (string option in placementOptions)
- {
- picker.Items.Add(option);
- }
- }
+ void PopulatePicker()
+ {
+ var enumType = typeof(ToolbarPlacement);
+ var placementOptions = Enum.GetNames(enumType);
+ foreach (string option in placementOptions)
+ {
+ picker.Items.Add(option);
+ }
+ }
- void OnPickerSelectedIndexChanged(object sender, EventArgs e)
- {
- ParentPage.On().SetToolbarPlacement((ToolbarPlacement)Enum.Parse(typeof(ToolbarPlacement), picker.Items[picker.SelectedIndex]));
- }
+ void OnPickerSelectedIndexChanged(object sender, EventArgs e)
+ {
+ ParentPage.On().SetToolbarPlacement((ToolbarPlacement)Enum.Parse(typeof(ToolbarPlacement), picker.Items[picker.SelectedIndex]));
+ }
- static void OnParentPagePropertyChanged(BindableObject element, object oldValue, object newValue)
- {
- if (newValue != null)
- {
- var enumType = typeof(ToolbarPlacement);
- var instance = element as WindowsToolbarPlacementChangerPage;
- instance.picker.SelectedIndex = Array.IndexOf(Enum.GetNames(enumType), Enum.GetName(enumType, instance.ParentPage.On().GetToolbarPlacement()));
- }
- }
- }
+ static void OnParentPagePropertyChanged(BindableObject element, object oldValue, object newValue)
+ {
+ if (newValue != null)
+ {
+ var enumType = typeof(ToolbarPlacement);
+ var instance = element as WindowsToolbarPlacementChangerPage;
+ instance.picker.SelectedIndex = Array.IndexOf(Enum.GetNames(enumType), Enum.GetName(enumType, instance.ParentPage.On().GetToolbarPlacement()));
+ }
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsVisualElementAccessKeysPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsVisualElementAccessKeysPage.xaml.cs
index ce9bae7dcaca..1643f04445ee 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsVisualElementAccessKeysPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsVisualElementAccessKeysPage.xaml.cs
@@ -1,5 +1,5 @@
-using System.Windows.Input;
-using System;
+using System;
+using System.Windows.Input;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.Pages
@@ -8,7 +8,7 @@ public partial class WindowsVisualElementAccessKeysPage : TabbedPage
{
public WindowsVisualElementAccessKeysPage()
{
- InitializeComponent ();
+ InitializeComponent();
}
async void OnButtonClicked(object sender, EventArgs e)
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsWebViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsWebViewPage.xaml.cs
index 94c27a11c554..2d19ac6d435e 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsWebViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/Windows/WindowsWebViewPage.xaml.cs
@@ -4,21 +4,21 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class WindowsWebViewPage : ContentPage
- {
- public WindowsWebViewPage()
- {
- InitializeComponent();
+ public partial class WindowsWebViewPage : ContentPage
+ {
+ public WindowsWebViewPage()
+ {
+ InitializeComponent();
- _webView.Source = new HtmlWebViewSource
- {
- Html = @"Click Me"
- };
- }
+ _webView.Source = new HtmlWebViewSource
+ {
+ Html = @"Click Me"
+ };
+ }
- void OnToggleButtonClicked(object sender, EventArgs e)
- {
- _webView.On().SetIsJavaScriptAlertEnabled(!_webView.On().IsJavaScriptAlertEnabled());
- }
- }
+ void OnToggleButtonClicked(object sender, EventArgs e)
+ {
+ _webView.On().SetIsJavaScriptAlertEnabled(!_webView.On().IsJavaScriptAlertEnabled());
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSBlurEffectPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSBlurEffectPage.xaml.cs
index 6faf7fce5921..eac76a9c67f1 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSBlurEffectPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSBlurEffectPage.xaml.cs
@@ -5,31 +5,31 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSBlurEffectPage : ContentPage
- {
- public iOSBlurEffectPage()
- {
- InitializeComponent();
- }
+ public partial class iOSBlurEffectPage : ContentPage
+ {
+ public iOSBlurEffectPage()
+ {
+ InitializeComponent();
+ }
- void OnNoBlurButtonClicked(object sender, EventArgs e)
- {
- image.On().UseBlurEffect(BlurEffectStyle.None);
- }
+ void OnNoBlurButtonClicked(object sender, EventArgs e)
+ {
+ image.On().UseBlurEffect(BlurEffectStyle.None);
+ }
- void OnExtraLightBlurButtonClicked(object sender, EventArgs e)
- {
- image.On().UseBlurEffect(BlurEffectStyle.ExtraLight);
- }
+ void OnExtraLightBlurButtonClicked(object sender, EventArgs e)
+ {
+ image.On().UseBlurEffect(BlurEffectStyle.ExtraLight);
+ }
- void OnLightBlurButtonClicked(object sender, EventArgs e)
- {
- image.On().UseBlurEffect(BlurEffectStyle.Light);
- }
+ void OnLightBlurButtonClicked(object sender, EventArgs e)
+ {
+ image.On().UseBlurEffect(BlurEffectStyle.Light);
+ }
- void OnDarkBlurButtonClicked(object sender, EventArgs e)
- {
- image.On().UseBlurEffect(BlurEffectStyle.Dark);
- }
- }
+ void OnDarkBlurButtonClicked(object sender, EventArgs e)
+ {
+ image.On().UseBlurEffect(BlurEffectStyle.Dark);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSDatePickerPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSDatePickerPage.xaml.cs
index 135035a1233e..299ceac5faed 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSDatePickerPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSDatePickerPage.xaml.cs
@@ -5,25 +5,25 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSDatePickerPage : ContentPage
- {
- public iOSDatePickerPage()
- {
- InitializeComponent();
- }
+ public partial class iOSDatePickerPage : ContentPage
+ {
+ public iOSDatePickerPage()
+ {
+ InitializeComponent();
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- switch (datePicker.On().UpdateMode())
- {
- case UpdateMode.Immediately:
- datePicker.On().SetUpdateMode(UpdateMode.WhenFinished);
- break;
- case UpdateMode.WhenFinished:
- datePicker.On().SetUpdateMode(UpdateMode.Immediately);
- break;
- }
- }
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ switch (datePicker.On().UpdateMode())
+ {
+ case UpdateMode.Immediately:
+ datePicker.On().SetUpdateMode(UpdateMode.WhenFinished);
+ break;
+ case UpdateMode.WhenFinished:
+ datePicker.On().SetUpdateMode(UpdateMode.Immediately);
+ break;
+ }
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSFirstResponderPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSFirstResponderPage.xaml.cs
index 9def04074b60..867aecc935a3 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSFirstResponderPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSFirstResponderPage.xaml.cs
@@ -2,11 +2,11 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSFirstResponderPage : ContentPage
- {
- public iOSFirstResponderPage()
- {
- InitializeComponent();
- }
- }
+ public partial class iOSFirstResponderPage : ContentPage
+ {
+ public iOSFirstResponderPage()
+ {
+ InitializeComponent();
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSFlyoutPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSFlyoutPage.xaml.cs
index 215f92e2612f..deeafe64c817 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSFlyoutPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSFlyoutPage.xaml.cs
@@ -5,24 +5,24 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSFlyoutPage : Microsoft.Maui.Controls.FlyoutPage
- {
- ICommand returnToPlatformSpecificsPage;
+ public partial class iOSFlyoutPage : Microsoft.Maui.Controls.FlyoutPage
+ {
+ ICommand returnToPlatformSpecificsPage;
- public iOSFlyoutPage(ICommand restore)
- {
- InitializeComponent();
- returnToPlatformSpecificsPage = restore;
- }
+ public iOSFlyoutPage(ICommand restore)
+ {
+ InitializeComponent();
+ returnToPlatformSpecificsPage = restore;
+ }
- void OnShadowButtonClicked(object sender, EventArgs e)
- {
- On().SetApplyShadow(!On().GetApplyShadow());
- }
+ void OnShadowButtonClicked(object sender, EventArgs e)
+ {
+ On().SetApplyShadow(!On().GetApplyShadow());
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- returnToPlatformSpecificsPage.Execute(null);
- }
- }
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ returnToPlatformSpecificsPage.Execute(null);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSHideHomeIndicatorPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSHideHomeIndicatorPage.xaml.cs
index 852584ed3584..e8714bcf249f 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSHideHomeIndicatorPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSHideHomeIndicatorPage.xaml.cs
@@ -5,16 +5,16 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSHideHomeIndicatorPage : ContentPage
- {
- public iOSHideHomeIndicatorPage()
- {
- InitializeComponent();
- }
+ public partial class iOSHideHomeIndicatorPage : ContentPage
+ {
+ public iOSHideHomeIndicatorPage()
+ {
+ InitializeComponent();
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- On().SetPrefersHomeIndicatorAutoHidden(!On().PrefersHomeIndicatorAutoHidden());
- }
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ On().SetPrefersHomeIndicatorAutoHidden(!On().PrefersHomeIndicatorAutoHidden());
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSLargeTitlePage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSLargeTitlePage.xaml.cs
index 26741261ccb4..1f0abc03c9ff 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSLargeTitlePage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSLargeTitlePage.xaml.cs
@@ -6,35 +6,35 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSLargeTitlePage : ContentPage
- {
- ICommand _returnToPlatformSpecificsPage;
+ public partial class iOSLargeTitlePage : ContentPage
+ {
+ ICommand _returnToPlatformSpecificsPage;
- public iOSLargeTitlePage(ICommand restore)
- {
- InitializeComponent();
- _returnToPlatformSpecificsPage = restore;
- }
+ public iOSLargeTitlePage(ICommand restore)
+ {
+ InitializeComponent();
+ _returnToPlatformSpecificsPage = restore;
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- switch (On().LargeTitleDisplay())
- {
- case LargeTitleDisplayMode.Always:
- On().SetLargeTitleDisplay(LargeTitleDisplayMode.Automatic);
- break;
- case LargeTitleDisplayMode.Automatic:
- On().SetLargeTitleDisplay(LargeTitleDisplayMode.Never);
- break;
- case LargeTitleDisplayMode.Never:
- On().SetLargeTitleDisplay(LargeTitleDisplayMode.Always);
- break;
- }
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ switch (On().LargeTitleDisplay())
+ {
+ case LargeTitleDisplayMode.Always:
+ On().SetLargeTitleDisplay(LargeTitleDisplayMode.Automatic);
+ break;
+ case LargeTitleDisplayMode.Automatic:
+ On().SetLargeTitleDisplay(LargeTitleDisplayMode.Never);
+ break;
+ case LargeTitleDisplayMode.Never:
+ On().SetLargeTitleDisplay(LargeTitleDisplayMode.Always);
+ break;
+ }
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- _returnToPlatformSpecificsPage.Execute(null);
- }
- }
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ _returnToPlatformSpecificsPage.Execute(null);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSListViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSListViewPage.xaml.cs
index ae4e75679dab..6a92ee7b3089 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSListViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSListViewPage.xaml.cs
@@ -1,14 +1,14 @@
-using Microsoft.Maui.Controls;
-using Maui.Controls.Sample.ViewModels;
+using Maui.Controls.Sample.ViewModels;
+using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSListViewPage : ContentPage
- {
- public iOSListViewPage()
- {
- InitializeComponent();
+ public partial class iOSListViewPage : ContentPage
+ {
+ public iOSListViewPage()
+ {
+ InitializeComponent();
BindingContext = new ListViewViewModel();
- }
- }
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSListViewWithCellPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSListViewWithCellPage.xaml.cs
index a189d22cac8c..31230a3120f5 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSListViewWithCellPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSListViewWithCellPage.xaml.cs
@@ -1,14 +1,14 @@
-using Microsoft.Maui.Controls;
-using Maui.Controls.Sample.ViewModels;
+using Maui.Controls.Sample.ViewModels;
+using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSListViewWithCellPage : ContentPage
- {
- public iOSListViewWithCellPage()
- {
- InitializeComponent();
- BindingContext = new ListViewViewModel(20);
- }
- }
+ public partial class iOSListViewWithCellPage : ContentPage
+ {
+ public iOSListViewWithCellPage()
+ {
+ InitializeComponent();
+ BindingContext = new ListViewViewModel(20);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSModalPagePresentationStyle.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSModalPagePresentationStyle.xaml.cs
index 261f01e32f4f..bc6f994ad82c 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSModalPagePresentationStyle.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSModalPagePresentationStyle.xaml.cs
@@ -3,16 +3,16 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSModalPagePresentationStyle : ContentPage
- {
- public iOSModalPagePresentationStyle()
- {
- InitializeComponent();
- }
+ public partial class iOSModalPagePresentationStyle : ContentPage
+ {
+ public iOSModalPagePresentationStyle()
+ {
+ InitializeComponent();
+ }
- async void OnReturnButtonClicked(object sender, EventArgs e)
- {
- await Navigation.PopModalAsync();
- }
- }
+ async void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ await Navigation.PopModalAsync();
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSNavigationPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSNavigationPage.xaml.cs
index b5a095f4d666..0b10b1c33b7c 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSNavigationPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSNavigationPage.xaml.cs
@@ -2,12 +2,12 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSNavigationPage : NavigationPage
- {
- public iOSNavigationPage(Page page)
- {
- InitializeComponent();
- PushAsync(page);
- }
- }
+ public partial class iOSNavigationPage : NavigationPage
+ {
+ public iOSNavigationPage(Page page)
+ {
+ InitializeComponent();
+ PushAsync(page);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSPanGestureRecognizerPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSPanGestureRecognizerPage.xaml.cs
index a687df6a7c27..e6d8c25250e6 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSPanGestureRecognizerPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSPanGestureRecognizerPage.xaml.cs
@@ -1,8 +1,8 @@
using System;
+using Maui.Controls.Sample.ViewModels;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
-using Maui.Controls.Sample.ViewModels;
namespace Maui.Controls.Sample.Pages
{
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSPickerPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSPickerPage.xaml.cs
index f585fd2b50c1..f9fc27b458cf 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSPickerPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSPickerPage.xaml.cs
@@ -5,24 +5,24 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSPickerPage : ContentPage
- {
- public iOSPickerPage()
- {
- InitializeComponent();
- }
+ public partial class iOSPickerPage : ContentPage
+ {
+ public iOSPickerPage()
+ {
+ InitializeComponent();
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- switch (picker.On().UpdateMode())
- {
- case UpdateMode.Immediately:
- picker.On().SetUpdateMode(UpdateMode.WhenFinished);
- break;
- case UpdateMode.WhenFinished:
- picker.On().SetUpdateMode(UpdateMode.Immediately);
- break;
- }
- }
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ switch (picker.On().UpdateMode())
+ {
+ case UpdateMode.Immediately:
+ picker.On().SetUpdateMode(UpdateMode.WhenFinished);
+ break;
+ case UpdateMode.WhenFinished:
+ picker.On().SetUpdateMode(UpdateMode.Immediately);
+ break;
+ }
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSafeAreaPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSafeAreaPage.xaml.cs
index 0217fcd9e0d1..ed46616274bc 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSafeAreaPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSafeAreaPage.xaml.cs
@@ -5,17 +5,17 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSSafeAreaPage : ContentPage
- {
- public iOSSafeAreaPage()
- {
- InitializeComponent();
- }
+ public partial class iOSSafeAreaPage : ContentPage
+ {
+ public iOSSafeAreaPage()
+ {
+ InitializeComponent();
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- On().SetUseSafeArea(false);
- (sender as Button).IsEnabled = false;
- }
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ On().SetUseSafeArea(false);
+ (sender as Button).IsEnabled = false;
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSScrollViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSScrollViewPage.xaml.cs
index 9c4c6f00c9d1..0e8c1d513ac5 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSScrollViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSScrollViewPage.xaml.cs
@@ -5,24 +5,24 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSScrollViewPage : Microsoft.Maui.Controls.FlyoutPage
- {
- ICommand _returnToPlatformSpecificsPage;
+ public partial class iOSScrollViewPage : Microsoft.Maui.Controls.FlyoutPage
+ {
+ ICommand _returnToPlatformSpecificsPage;
- public iOSScrollViewPage(ICommand restore)
- {
- InitializeComponent();
- _returnToPlatformSpecificsPage = restore;
- }
+ public iOSScrollViewPage(ICommand restore)
+ {
+ InitializeComponent();
+ _returnToPlatformSpecificsPage = restore;
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- scrollView.On().SetShouldDelayContentTouches(!scrollView.On().ShouldDelayContentTouches());
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ scrollView.On().SetShouldDelayContentTouches(!scrollView.On().ShouldDelayContentTouches());
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- _returnToPlatformSpecificsPage.Execute(null);
- }
- }
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ _returnToPlatformSpecificsPage.Execute(null);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSearchBarPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSearchBarPage.xaml.cs
index 963a18096413..1a437d23a633 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSearchBarPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSearchBarPage.xaml.cs
@@ -6,32 +6,32 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSSearchBarPage : ContentPage
- {
- public iOSSearchBarPage()
- {
- InitializeComponent();
- }
+ public partial class iOSSearchBarPage : ContentPage
+ {
+ public iOSSearchBarPage()
+ {
+ InitializeComponent();
+ }
- void OnSearchBarStyleButtonClicked(object sender, EventArgs e)
- {
- switch (searchBar.On().GetSearchBarStyle())
- {
- case UISearchBarStyle.Default:
- searchBar.On().SetSearchBarStyle(UISearchBarStyle.Minimal);
- break;
- case UISearchBarStyle.Minimal:
- searchBar.On().SetSearchBarStyle(UISearchBarStyle.Prominent);
- break;
- case UISearchBarStyle.Prominent:
- searchBar.On().SetSearchBarStyle(UISearchBarStyle.Default);
- break;
- }
- }
+ void OnSearchBarStyleButtonClicked(object sender, EventArgs e)
+ {
+ switch (searchBar.On().GetSearchBarStyle())
+ {
+ case UISearchBarStyle.Default:
+ searchBar.On().SetSearchBarStyle(UISearchBarStyle.Minimal);
+ break;
+ case UISearchBarStyle.Minimal:
+ searchBar.On().SetSearchBarStyle(UISearchBarStyle.Prominent);
+ break;
+ case UISearchBarStyle.Prominent:
+ searchBar.On().SetSearchBarStyle(UISearchBarStyle.Default);
+ break;
+ }
+ }
- void OnToggleBackgroundButtonClicked(object sender, EventArgs e)
- {
- searchBar.BackgroundColor = (searchBar.BackgroundColor == Colors.Teal) ? Colors.Black : Colors.Teal;
- }
- }
+ void OnToggleBackgroundButtonClicked(object sender, EventArgs e)
+ {
+ searchBar.BackgroundColor = (searchBar.BackgroundColor == Colors.Teal) ? Colors.Black : Colors.Teal;
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSliderUpdateOnTapPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSliderUpdateOnTapPage.xaml.cs
index 4c4a050a2e73..5058ac207e91 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSliderUpdateOnTapPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSliderUpdateOnTapPage.xaml.cs
@@ -5,16 +5,16 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSSliderUpdateOnTapPage : ContentPage
- {
- public iOSSliderUpdateOnTapPage()
- {
- InitializeComponent();
- }
+ public partial class iOSSliderUpdateOnTapPage : ContentPage
+ {
+ public iOSSliderUpdateOnTapPage()
+ {
+ InitializeComponent();
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- _slider.On().SetUpdateOnTap(!_slider.On().GetUpdateOnTap());
- }
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ _slider.On().SetUpdateOnTap(!_slider.On().GetUpdateOnTap());
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSwipeViewTransitionModePage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSwipeViewTransitionModePage.xaml.cs
index 9e6d5601decd..6bb1cf36d82b 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSwipeViewTransitionModePage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSwipeViewTransitionModePage.xaml.cs
@@ -7,22 +7,22 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSSwipeViewTransitionModePage : ContentPage
- {
- public iOSSwipeViewTransitionModePage()
- {
- InitializeComponent();
- }
+ public partial class iOSSwipeViewTransitionModePage : ContentPage
+ {
+ public iOSSwipeViewTransitionModePage()
+ {
+ InitializeComponent();
+ }
- void OnSwipeViewTransitionModeChanged(object sender, EventArgs e)
- {
- SwipeTransitionMode transitionMode = (SwipeTransitionMode)(sender as EnumPicker).SelectedItem;
- swipeView.On().SetSwipeTransitionMode(transitionMode);
- }
+ void OnSwipeViewTransitionModeChanged(object sender, EventArgs e)
+ {
+ SwipeTransitionMode transitionMode = (SwipeTransitionMode)(sender as EnumPicker).SelectedItem;
+ swipeView.On().SetSwipeTransitionMode(transitionMode);
+ }
- async void OnDeleteSwipeItemInvoked(object sender, EventArgs e)
- {
- await DisplayAlert("SwipeView", "Delete invoked.", "OK");
- }
- }
+ async void OnDeleteSwipeItemInvoked(object sender, EventArgs e)
+ {
+ await DisplayAlert("SwipeView", "Delete invoked.", "OK");
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTimePickerPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTimePickerPage.xaml.cs
index 05861c4a629b..53070066d656 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTimePickerPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTimePickerPage.xaml.cs
@@ -5,24 +5,24 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSTimePickerPage : ContentPage
- {
- public iOSTimePickerPage()
- {
- InitializeComponent();
- }
+ public partial class iOSTimePickerPage : ContentPage
+ {
+ public iOSTimePickerPage()
+ {
+ InitializeComponent();
+ }
- void OnButtonClicked(object sender, EventArgs e)
- {
- switch (timePicker.On().UpdateMode())
- {
- case UpdateMode.Immediately:
- timePicker.On().SetUpdateMode(UpdateMode.WhenFinished);
- break;
- case UpdateMode.WhenFinished:
- timePicker.On().SetUpdateMode(UpdateMode.Immediately);
- break;
- }
- }
- }
+ void OnButtonClicked(object sender, EventArgs e)
+ {
+ switch (timePicker.On().UpdateMode())
+ {
+ case UpdateMode.Immediately:
+ timePicker.On().SetUpdateMode(UpdateMode.WhenFinished);
+ break;
+ case UpdateMode.WhenFinished:
+ timePicker.On().SetUpdateMode(UpdateMode.Immediately);
+ break;
+ }
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTitleViewNavigationPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTitleViewNavigationPage.xaml.cs
index d5da385ff581..4b60d14c9206 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTitleViewNavigationPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTitleViewNavigationPage.xaml.cs
@@ -2,12 +2,12 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSTitleViewNavigationPage : NavigationPage
- {
- public iOSTitleViewNavigationPage(Page page)
- {
- InitializeComponent();
- PushAsync(page);
- }
- }
+ public partial class iOSTitleViewNavigationPage : NavigationPage
+ {
+ public iOSTitleViewNavigationPage(Page page)
+ {
+ InitializeComponent();
+ PushAsync(page);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTitleViewPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTitleViewPage.xaml.cs
index cece6f9316e6..8f1990190b63 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTitleViewPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTitleViewPage.xaml.cs
@@ -1,24 +1,24 @@
-using System.Windows.Input;
-using System;
+using System;
+using System.Windows.Input;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSTitleViewPage : ContentPage
- {
- ICommand _returnToPlatformSpecificsPage;
+ public partial class iOSTitleViewPage : ContentPage
+ {
+ ICommand _returnToPlatformSpecificsPage;
- public iOSTitleViewPage(ICommand restore)
- {
- InitializeComponent();
+ public iOSTitleViewPage(ICommand restore)
+ {
+ InitializeComponent();
- _returnToPlatformSpecificsPage = restore;
- _searchBar.Effects.Add(Effect.Resolve("XamarinDocs.SearchBarEffect"));
- }
+ _returnToPlatformSpecificsPage = restore;
+ _searchBar.Effects.Add(Effect.Resolve("XamarinDocs.SearchBarEffect"));
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- _returnToPlatformSpecificsPage.Execute(null);
- }
- }
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ _returnToPlatformSpecificsPage.Execute(null);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTranslucentNavigationBarPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTranslucentNavigationBarPage.xaml.cs
index edc4c13f635e..29dceefbb34a 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTranslucentNavigationBarPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTranslucentNavigationBarPage.xaml.cs
@@ -1,29 +1,29 @@
-using System.Windows.Input;
-using System;
+using System;
+using System.Windows.Input;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSTranslucentNavigationBarPage : ContentPage
- {
- ICommand _returnToPlatformSpecificsPage;
+ public partial class iOSTranslucentNavigationBarPage : ContentPage
+ {
+ ICommand _returnToPlatformSpecificsPage;
- public iOSTranslucentNavigationBarPage(ICommand restore)
- {
- InitializeComponent();
- _returnToPlatformSpecificsPage = restore;
- }
+ public iOSTranslucentNavigationBarPage(ICommand restore)
+ {
+ InitializeComponent();
+ _returnToPlatformSpecificsPage = restore;
+ }
- void OnTranslucentNavigationBarButtonClicked(object sender, EventArgs e)
- {
- (Microsoft.Maui.Controls.Application.Current.MainPage as Microsoft.Maui.Controls.NavigationPage).On().SetIsNavigationBarTranslucent(!(Microsoft.Maui.Controls.Application.Current.MainPage as Microsoft.Maui.Controls.NavigationPage).On().IsNavigationBarTranslucent());
- }
+ void OnTranslucentNavigationBarButtonClicked(object sender, EventArgs e)
+ {
+ (Microsoft.Maui.Controls.Application.Current.MainPage as Microsoft.Maui.Controls.NavigationPage).On().SetIsNavigationBarTranslucent(!(Microsoft.Maui.Controls.Application.Current.MainPage as Microsoft.Maui.Controls.NavigationPage).On().IsNavigationBarTranslucent());
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- _returnToPlatformSpecificsPage.Execute(null);
- }
- }
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ _returnToPlatformSpecificsPage.Execute(null);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTranslucentTabbedPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTranslucentTabbedPage.xaml.cs
index 2c8cae398358..d3aecf4a0e21 100644
--- a/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTranslucentTabbedPage.xaml.cs
+++ b/src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSTranslucentTabbedPage.xaml.cs
@@ -5,35 +5,35 @@
namespace Maui.Controls.Sample.Pages
{
- public partial class iOSTranslucentTabbedPage : Microsoft.Maui.Controls.TabbedPage
- {
- ICommand returnToPlatformSpecificsPage;
+ public partial class iOSTranslucentTabbedPage : Microsoft.Maui.Controls.TabbedPage
+ {
+ ICommand returnToPlatformSpecificsPage;
- public iOSTranslucentTabbedPage(ICommand restore)
- {
- InitializeComponent();
- returnToPlatformSpecificsPage = restore;
- }
+ public iOSTranslucentTabbedPage(ICommand restore)
+ {
+ InitializeComponent();
+ returnToPlatformSpecificsPage = restore;
+ }
- void OnToggleButtonClicked(object sender, EventArgs e)
- {
- switch (On().GetTranslucencyMode())
- {
- case TranslucencyMode.Default:
- On().SetTranslucencyMode(TranslucencyMode.Translucent);
- break;
- case TranslucencyMode.Translucent:
- On().SetTranslucencyMode(TranslucencyMode.Opaque);
- break;
- case TranslucencyMode.Opaque:
- On().SetTranslucencyMode(TranslucencyMode.Default);
- break;
- }
- }
+ void OnToggleButtonClicked(object sender, EventArgs e)
+ {
+ switch (On().GetTranslucencyMode())
+ {
+ case TranslucencyMode.Default:
+ On().SetTranslucencyMode(TranslucencyMode.Translucent);
+ break;
+ case TranslucencyMode.Translucent:
+ On().SetTranslucencyMode(TranslucencyMode.Opaque);
+ break;
+ case TranslucencyMode.Opaque:
+ On().SetTranslucencyMode(TranslucencyMode.Default);
+ break;
+ }
+ }
- void OnReturnButtonClicked(object sender, EventArgs e)
- {
- returnToPlatformSpecificsPage.Execute(null);
- }
- }
+ void OnReturnButtonClicked(object sender, EventArgs e)
+ {
+ returnToPlatformSpecificsPage.Execute(null);
+ }
+ }
}
diff --git a/src/Controls/samples/Controls.Sample/Platforms/MacCatalyst/AppDelegate.cs b/src/Controls/samples/Controls.Sample/Platforms/MacCatalyst/AppDelegate.cs
index 397b7a9c006b..5495d4e0df26 100644
--- a/src/Controls/samples/Controls.Sample/Platforms/MacCatalyst/AppDelegate.cs
+++ b/src/Controls/samples/Controls.Sample/Platforms/MacCatalyst/AppDelegate.cs
@@ -1,10 +1,10 @@
using Foundation;
-using ObjCRuntime;
-using UIKit;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
+using ObjCRuntime;
+using UIKit;
-#if !NET6_0
+#if !NET6_0_OR_GREATER
using Microsoft.Maui.Controls;
#endif
diff --git a/src/Controls/samples/Controls.Sample/ViewModels/AndroidViewCellPageViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/AndroidViewCellPageViewModel.cs
index 79d726509d37..dde5e3959bb9 100644
--- a/src/Controls/samples/Controls.Sample/ViewModels/AndroidViewCellPageViewModel.cs
+++ b/src/Controls/samples/Controls.Sample/ViewModels/AndroidViewCellPageViewModel.cs
@@ -2,8 +2,8 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Input;
-using Microsoft.Maui.Controls;
using Maui.Controls.Sample.Models;
+using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.ViewModels
{
diff --git a/src/Controls/samples/Controls.Sample/ViewModels/ControlsViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/ControlsViewModel.cs
index 93d82246cbb0..16991e982b54 100644
--- a/src/Controls/samples/Controls.Sample/ViewModels/ControlsViewModel.cs
+++ b/src/Controls/samples/Controls.Sample/ViewModels/ControlsViewModel.cs
@@ -11,7 +11,7 @@ protected override IEnumerable CreateItems() => new[]
{
new SectionModel(typeof(ActivityIndicatorPage), "ActivityIndicator",
"Displays an animation to show that the application is engaged in a lengthy activity."),
-
+
new SectionModel(typeof(BordersPage), "Border",
"Draws a border around a View."),
diff --git a/src/Controls/samples/Controls.Sample/ViewModels/ListViewViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/ListViewViewModel.cs
index aa54f6c11a52..08c4edd86663 100644
--- a/src/Controls/samples/Controls.Sample/ViewModels/ListViewViewModel.cs
+++ b/src/Controls/samples/Controls.Sample/ViewModels/ListViewViewModel.cs
@@ -15,7 +15,7 @@ public ListViewViewModel(int num = 2000)
var rnd = new Random();
var employees = new List();
- for(int i = 0; i < num; i++)
+ for (int i = 0; i < num; i++)
{
employees.Add(new Person($"Name {i + 1}", rnd.Next(18, 65), $"Location {i + 1}"));
}
diff --git a/src/Controls/samples/Controls.Sample/ViewModels/OthersViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/OthersViewModel.cs
index c041b690ed01..9c2798e06a94 100644
--- a/src/Controls/samples/Controls.Sample/ViewModels/OthersViewModel.cs
+++ b/src/Controls/samples/Controls.Sample/ViewModels/OthersViewModel.cs
@@ -11,19 +11,19 @@ protected override IEnumerable CreateItems() => new[]
{
new SectionModel(typeof(GraphicsViewPage), "GraphicsView",
"Allow to draw directly in a Canvas. You can combine a canvas and native Views on the same page."),
-
+
new SectionModel(typeof(LargeTitlesPageiOS), "Large Titles - iOS",
"This iOS platform-specific is used to display the page title as a large title on the navigation bar of a NavigationPage, for devices that use iOS 11 or greater."),
-
+
new SectionModel(typeof(StyleSheetsPage), "StyleSheets",
"Demonstrates the usage of CSS in XAML."),
-
+
new SectionModel(typeof(TwoPaneViewPage), "Foldable",
"Demonstrates the usage of TwoPaneView and hinge sensor."),
-
+
new SectionModel(typeof(RenderViewPage), "Render Views",
"Demonstrates rendering views as images."),
-
+
new SectionModel(typeof(HitTestingPage), "Hit Testing",
"Demonstrates VisualTreeElementExtensions hit testing methods"),
};
diff --git a/src/Controls/samples/Controls.Sample/ViewModels/PlatformSpecificsViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/PlatformSpecificsViewModel.cs
index 55668e3aca95..4efb4bfc8e02 100644
--- a/src/Controls/samples/Controls.Sample/ViewModels/PlatformSpecificsViewModel.cs
+++ b/src/Controls/samples/Controls.Sample/ViewModels/PlatformSpecificsViewModel.cs
@@ -45,72 +45,72 @@ protected override IEnumerable CreateItems()
#elif IOS || MACCATALYST
return new[]
{
- new SectionModel(typeof(iOSBlurEffectPage), "Blur Effect",
+ new SectionModel(typeof(iOSBlurEffectPage), "Blur Effect",
"This iOS platform-specific is used to blur the content layered beneath it, and can be applied to any VisualElement."),
-
- new SectionModel(typeof(iOSDatePickerPage), "DatePicker UpdateMode",
+
+ new SectionModel(typeof(iOSDatePickerPage), "DatePicker UpdateMode",
"This iOS platform-specific controls when item selection occurs in a DatePicker, allowing the user to specify that item selection occurs when browsing items in the control, or only once the Done button is pressed."),
-
- new SectionModel(typeof(iOSEntryPage), "AdjustsFontSizeToFitWidth",
+
+ new SectionModel(typeof(iOSEntryPage), "AdjustsFontSizeToFitWidth",
"This iOS platform-specific is used to scale the font size of an Entry to ensure that the inputted text fits in the control."),
-
- new SectionModel(typeof(iOSFirstResponderPage), "VisualElement first responder",
+
+ new SectionModel(typeof(iOSFirstResponderPage), "VisualElement first responder",
"This iOS platform-specific enables a VisualElement object to become the first responder to touch events, rather than the page containing the element."),
-
- new SectionModel(typeof(iOSFlyoutPage), "FlyoutPage Shadow",
+
+ new SectionModel(typeof(iOSFlyoutPage), "FlyoutPage Shadow",
"This platform-specific controls whether the detail page of a FlyoutPage has shadow applied to it, when revealing the flyout page."),
-
- new SectionModel(typeof(iOSHideHomeIndicatorPage), "Hide Home Indicator",
+
+ new SectionModel(typeof(iOSHideHomeIndicatorPage), "Hide Home Indicator",
"This iOS platform-specific sets the visibility of the home indicator on a Page."),
-
- new SectionModel(typeof(iOSLargeTitlePage), "Large Title",
+
+ new SectionModel(typeof(iOSLargeTitlePage), "Large Title",
"This iOS platform-specific is used to display the page title as a large title on the navigation bar of a NavigationPage, for devices that use iOS 11 or greater."),
-
- new SectionModel(typeof(iOSListViewPage), "ListView Platform-Specifics",
+
+ new SectionModel(typeof(iOSListViewPage), "ListView Platform-Specifics",
"This iOS platform-specific controls whether the separator between cells in a ListView uses the full width of the ListView."),
- new SectionModel(typeof(iOSListViewWithCellPage), "ListView/Cell Platform-Specifics",
+ new SectionModel(typeof(iOSListViewWithCellPage), "ListView/Cell Platform-Specifics",
"This iOS platform-specific controls whether ListView header cells float during scrolling."),
- new SectionModel(typeof(iOSModalPagePresentationStyle), "Modal FormSheet Page",
+ new SectionModel(typeof(iOSModalPagePresentationStyle), "Modal FormSheet Page",
"This iOS platform-specific is used to set the presentation style of a modal page, and in addition can be used to display modal pages that have transparent backgrounds."),
- new SectionModel(typeof(iOSNavigationPage), "NavigationPage Platform-Specifics",
+ new SectionModel(typeof(iOSNavigationPage), "NavigationPage Platform-Specifics",
"This iOS platform-specific hides the separator line and shadow that is at the bottom of the navigation bar on a NavigationPage"),
- new SectionModel(typeof(iOSPanGestureRecognizerPage), "Pan Gesture Recognizer Platform-Specific",
+ new SectionModel(typeof(iOSPanGestureRecognizerPage), "Pan Gesture Recognizer Platform-Specific",
"This iOS platform-specific enables a PanGestureRecognizer in a scrolling view to capture and share the pan gesture with the scrolling view."),
- new SectionModel(typeof(iOSPickerPage), "Picker UpdateMode",
+ new SectionModel(typeof(iOSPickerPage), "Picker UpdateMode",
"This iOS platform-specific controls when item selection occurs in a Picker, allowing the user to specify that item selection occurs when browsing items in the control, or only once the Done button is pressed."),
- new SectionModel(typeof(iOSSafeAreaPage), "Safe Area",
+ new SectionModel(typeof(iOSSafeAreaPage), "Safe Area",
"This iOS platform-specific is used to ensure that page content is positioned on an area of the screen that is safe for all devices that use iOS 11 and greater."),
- new SectionModel(typeof(iOSScrollViewPage), "ScrollView Content Touches",
+ new SectionModel(typeof(iOSScrollViewPage), "ScrollView Content Touches",
"This platform-specific controls whether a ScrollView handles a touch gesture or passes it to its content."),
- new SectionModel(typeof(iOSSearchBarPage), "SearchBar Style",
- "This iOS platform-specific controls whether a SearchBar has a background."),
-
- new SectionModel(typeof(iOSSliderUpdateOnTapPage), "Slider Update on Tap",
+ new SectionModel(typeof(iOSSearchBarPage), "SearchBar Style",
+ "This iOS platform-specific controls whether a SearchBar has a background."),
+
+ new SectionModel(typeof(iOSSliderUpdateOnTapPage), "Slider Update on Tap",
"This iOS platform-specific enables the Slider.Value property to be set by tapping on a position on the Slider bar, rather than by having to drag the Slider thumb."),
- new SectionModel(typeof(iOSStatusBarPage), "Hide Status Bar",
+ new SectionModel(typeof(iOSStatusBarPage), "Hide Status Bar",
"This iOS platform-specific is used to set the visibility of the status bar on a Page, and it includes the ability to control how the status bar enters or leaves the Page."),
- new SectionModel(typeof(iOSSwipeViewTransitionModePage), "SwipeView SwipeTransitionMode",
+ new SectionModel(typeof(iOSSwipeViewTransitionModePage), "SwipeView SwipeTransitionMode",
"This iOS platform-specific controls the transition that's used when opening a SwipeView."),
- new SectionModel(typeof(iOSTimePickerPage), "TimePicker UpdateMode",
+ new SectionModel(typeof(iOSTimePickerPage), "TimePicker UpdateMode",
"This iOS platform-specific controls when item selection occurs in a TimePicker, allowing the user to specify that item selection occurs when browsing items in the control, or only once the Done button is pressed."),
- new SectionModel(typeof(iOSTranslucentNavigationBarPage), "NavigationPage Translucent TabBar",
+ new SectionModel(typeof(iOSTranslucentNavigationBarPage), "NavigationPage Translucent TabBar",
"This iOS platform-specific is used to set the translucency mode of the tab bar on a NavigationPage."),
- new SectionModel(typeof(MainPage), "TabbedPage Translucent TabBar",
+ new SectionModel(typeof(MainPage), "TabbedPage Translucent TabBar",
"This iOS platform-specific is used to set the translucency mode of the tab bar on a TabbedPage."),
- };
+ };
#elif WINDOWS
return new[]
{
diff --git a/src/Controls/samples/Controls.Sample/ViewModels/ScrollViewOptionsModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/ScrollViewOptionsModel.cs
new file mode 100644
index 000000000000..918d75bcc165
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample/ViewModels/ScrollViewOptionsModel.cs
@@ -0,0 +1,41 @@
+using System.Collections.Generic;
+using Maui.Controls.Sample.Models;
+using Maui.Controls.Sample.ViewModels.Base;
+using Maui.Controls.Sample.Pages.ScrollViewPages;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui;
+
+namespace Maui.Controls.Sample.ViewModels
+{
+ public class ScrollViewOptionsModel : BaseGalleryViewModel
+ {
+ protected override IEnumerable CreateItems() => new[]
+ {
+ new SectionModel(typeof(ScrollToEndPage), "Scroll To End",
+ "ScrollView is capable of scrolling its contents."),
+
+ new SectionModel(typeof(ScrollViewTemplatePage), "Default Template",
+ "Default Template", new ScrollViewTemplatePageModel()),
+
+ new SectionModel(typeof(ScrollViewTemplatePage), "Align Start",
+ "Vertical Align Start", new ScrollViewTemplatePageModel{ VerticalAlignment = LayoutOptions.Start }),
+
+ new SectionModel(typeof(ScrollViewTemplatePage), "Align End",
+ "Vertical Align End", new ScrollViewTemplatePageModel{ VerticalAlignment = LayoutOptions.End }),
+
+ new SectionModel(typeof(ScrollViewTemplatePage), "Align Fill",
+ "Vertical Align Fill", new ScrollViewTemplatePageModel{ VerticalAlignment = LayoutOptions.Fill }),
+
+ new SectionModel(typeof(ScrollViewTemplatePage), "Large Item Spacing",
+ "Default Template with Large Item Spacing", new ScrollViewTemplatePageModel{ Spacing = 200 }),
+
+ new SectionModel(typeof(ScrollViewTemplatePage), "Large Item Spacing, ScrollView Padding",
+ "Default Template with Large Item Spacing and ScrollView Padding",
+ new ScrollViewTemplatePageModel{ Spacing = 200, ScrollViewPadding = new Thickness(25),
+ ContentBackground = Colors.LightBlue, VerticalAlignment = LayoutOptions.Fill }),
+
+
+ };
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample/XamlApp.xaml b/src/Controls/samples/Controls.Sample/XamlApp.xaml
index 5ce66addea29..564f3cc1f1cd 100644
--- a/src/Controls/samples/Controls.Sample/XamlApp.xaml
+++ b/src/Controls/samples/Controls.Sample/XamlApp.xaml
@@ -9,6 +9,7 @@
+
diff --git a/src/Controls/src/Build.Tasks/CompiledConverters/EnumTypeConverter.cs b/src/Controls/src/Build.Tasks/CompiledConverters/EnumTypeConverter.cs
index 59525c4f46da..db7cb02f9912 100644
--- a/src/Controls/src/Build.Tasks/CompiledConverters/EnumTypeConverter.cs
+++ b/src/Controls/src/Build.Tasks/CompiledConverters/EnumTypeConverter.cs
@@ -6,7 +6,7 @@
namespace Microsoft.Maui.Controls.XamlC
{
- class EnumTypeConverter : ICompiledTypeConverter where TEnum: struct
+ class EnumTypeConverter : ICompiledTypeConverter where TEnum : struct
{
public IEnumerable ConvertFromString(string value, ILContext context, BaseNode node)
{
diff --git a/src/Controls/src/Build.Tasks/NodeILExtensions.cs b/src/Controls/src/Build.Tasks/NodeILExtensions.cs
index c66919fa3df0..b600360623ce 100644
--- a/src/Controls/src/Build.Tasks/NodeILExtensions.cs
+++ b/src/Controls/src/Build.Tasks/NodeILExtensions.cs
@@ -163,7 +163,6 @@ public static IEnumerable PushConvertedValue(this ValueNode node, I
{ module.ImportReference(("Microsoft.Maui", "Microsoft.Maui.Converters", "FlexAlignSelfTypeConverter")), typeof(EnumTypeConverter) },
{ module.ImportReference(("Microsoft.Maui", "Microsoft.Maui.Converters", "FlexWrapTypeConverter")), typeof(EnumTypeConverter) },
{ module.ImportReference(("Microsoft.Maui", "Microsoft.Maui.Converters", "FlexBasisTypeConverter")), typeof(FlexBasisTypeConverter) },
- { module.ImportReference(("Microsoft.Maui", "Microsoft.Maui.Converters", "FlowDirectionTypeConverter")), typeof(EnumTypeConverter) },
};
}
@@ -171,7 +170,7 @@ public static IEnumerable PushConvertedValue(this ValueNode node, I
var str = (string)node.Value;
//If the TypeConverter has a ProvideCompiledAttribute that can be resolved, shortcut this
Type compiledConverterType;
- if ( typeConverter?.GetCustomAttribute(module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "ProvideCompiledAttribute"))?.ConstructorArguments?.First().Value is string compiledConverterName
+ if (typeConverter?.GetCustomAttribute(module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "ProvideCompiledAttribute"))?.ConstructorArguments?.First().Value is string compiledConverterName
&& (compiledConverterType = Type.GetType(compiledConverterName)) != null
|| (typeConverter != null && KnownCompiledTypeConverters.TryGetValue(typeConverter, out compiledConverterType)))
{
diff --git a/src/Controls/src/Core.Design/AttributeTableBuilder.cs b/src/Controls/src/Core.Design/AttributeTableBuilder.cs
index c99f8bb1f8a5..05ef30106e8a 100644
--- a/src/Controls/src/Core.Design/AttributeTableBuilder.cs
+++ b/src/Controls/src/Core.Design/AttributeTableBuilder.cs
@@ -30,7 +30,7 @@ public AttributeTableBuilder()
AddMemberAttributes("Microsoft.Maui.Controls.VisualElement", "Visual",
new TypeConverterAttribute(typeof(VisualDesignTypeConverter)));
- AddTypeAttributes("Microsoft.Maui.FlowDirection",
+ AddMemberAttributes("Microsoft.Maui.Controls.VisualElement", "FlowDirection",
new TypeConverterAttribute(typeof(FlowDirectionDesignTypeConverter)));
AddMemberAttributes("Microsoft.Maui.Controls.ItemsView", "ItemsLayout",
@@ -51,14 +51,14 @@ public AttributeTableBuilder()
// though, since its visibility in the markup is controlled by the EditorBrowsableAttribute.
// Make OnPlatform/OnIdiom visible for intellisense, and set as markup extension.
AddTypeAttributes("Microsoft.Maui.Controls.OnPlatform<>",
- new EditorBrowsableAttribute (EditorBrowsableState.Always)
- //new System.ComponentModel.TypeConverterAttribute(typeof(AnythingConverter)),
- //new System.Windows.Markup.MarkupExtensionReturnTypeAttribute (),
+ new EditorBrowsableAttribute(EditorBrowsableState.Always)
+ //new System.ComponentModel.TypeConverterAttribute(typeof(AnythingConverter)),
+ //new System.Windows.Markup.MarkupExtensionReturnTypeAttribute (),
);
AddTypeAttributes("Microsoft.Maui.Controls.OnIdiom<>",
new EditorBrowsableAttribute(EditorBrowsableState.Always)
- //new System.ComponentModel.TypeConverterAttribute(typeof(AnythingConverter)),
- //new System.Windows.Markup.MarkupExtensionReturnTypeAttribute (),
+ //new System.ComponentModel.TypeConverterAttribute(typeof(AnythingConverter)),
+ //new System.Windows.Markup.MarkupExtensionReturnTypeAttribute (),
);
AddTypeAttributes("Microsoft.Maui.Graphics.Color", new TypeConverterAttribute(typeof(ColorDesignTypeConverter)));
diff --git a/src/Controls/src/Core.Design/Controls.Core.Design.csproj b/src/Controls/src/Core.Design/Controls.Core.Design.csproj
index 07dbac3e3671..7800ead16910 100644
--- a/src/Controls/src/Core.Design/Controls.Core.Design.csproj
+++ b/src/Controls/src/Core.Design/Controls.Core.Design.csproj
@@ -4,7 +4,7 @@
Microsoft.Maui.Controls.DesignTools
False
False
- <_MauiDesignDllBuild Condition=" '$(OS)' != 'Unix' And '$(MSBuildRuntimeType)' == 'Full'">True
+ <_MauiDesignDllBuild Condition=" '$(OS)' != 'Unix' ">True
diff --git a/src/Controls/src/Core.Design/FlexEnumDesignTypeConverters.cs b/src/Controls/src/Core.Design/FlexEnumDesignTypeConverters.cs
index e4819e288f46..46d01120ae4d 100644
--- a/src/Controls/src/Core.Design/FlexEnumDesignTypeConverters.cs
+++ b/src/Controls/src/Core.Design/FlexEnumDesignTypeConverters.cs
@@ -99,14 +99,14 @@ public class FlexBasisDesignTypeConverter : KnownValuesDesignTypeConverter
{
protected override string[] KnownValues
=> new[] {
- "Auto",
+ "Auto",
};
public override bool IsValid(ITypeDescriptorContext context, object value)
{
if (KnownValues.Any(v => value?.ToString()?.Equals(v, StringComparison.Ordinal) ?? false))
return true;
-
+
var strValue = value?.ToString().Trim();
if (strValue is null)
@@ -114,7 +114,7 @@ public override bool IsValid(ITypeDescriptorContext context, object value)
if (strValue.EndsWith("%", StringComparison.OrdinalIgnoreCase) && float.TryParse(strValue.Substring(0, strValue.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out float relflex))
return true;
-
+
if (float.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out float flex))
return true;
diff --git a/src/Controls/src/Core.Design/FlowDirectionDesignTypeConverter.cs b/src/Controls/src/Core.Design/FlowDirectionDesignTypeConverter.cs
index d9bfa0bd1b44..0d0229932796 100644
--- a/src/Controls/src/Core.Design/FlowDirectionDesignTypeConverter.cs
+++ b/src/Controls/src/Core.Design/FlowDirectionDesignTypeConverter.cs
@@ -16,7 +16,7 @@ protected override string[] KnownValues
=> new[]
{
"MatchParent",
- "LeftToRight",
+ "LeftToRight",
"RightToLeft"
};
}
diff --git a/src/Controls/src/Core.Design/ItemsLayoutDesignTypeConverter.cs b/src/Controls/src/Core.Design/ItemsLayoutDesignTypeConverter.cs
index b8de236e2e7c..c1ac725ac11c 100644
--- a/src/Controls/src/Core.Design/ItemsLayoutDesignTypeConverter.cs
+++ b/src/Controls/src/Core.Design/ItemsLayoutDesignTypeConverter.cs
@@ -7,6 +7,6 @@ public ItemsLayoutDesignTypeConverter()
}
protected override string[] KnownValues
- => new [] { "VerticalList", "HorizontalList", "VerticalGrid", "HorizontalGrid" };
+ => new[] { "VerticalList", "HorizontalList", "VerticalGrid", "HorizontalGrid" };
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/AppThemeBinding.cs b/src/Controls/src/Core/AppThemeBinding.cs
index 171a61e21d86..fb2cc0a0ce6a 100644
--- a/src/Controls/src/Core/AppThemeBinding.cs
+++ b/src/Controls/src/Core/AppThemeBinding.cs
@@ -1,6 +1,5 @@
using System;
using Microsoft.Maui.ApplicationModel;
-using Microsoft.Maui.Devices;
namespace Microsoft.Maui.Controls
{
@@ -9,8 +8,6 @@ class AppThemeBinding : BindingBase
WeakReference _weakTarget;
BindableProperty _targetProperty;
- public AppThemeBinding() => Application.Current.RequestedThemeChanged += (o, e) => ApplyCore(true);
-
internal override BindingBase Clone() => new AppThemeBinding
{
Light = Light,
@@ -24,6 +21,8 @@ internal override void Apply(bool fromTarget)
{
base.Apply(fromTarget);
ApplyCore();
+
+ AttachEvents();
}
internal override void Apply(object context, BindableObject bindObj, BindableProperty targetProperty, bool fromBindingContextChanged = false)
@@ -32,19 +31,29 @@ internal override void Apply(object context, BindableObject bindObj, BindablePro
_targetProperty = targetProperty;
base.Apply(context, bindObj, targetProperty, fromBindingContextChanged);
ApplyCore();
+
+ AttachEvents();
}
internal override void Unapply(bool fromBindingContextChanged = false)
{
+ DetachEvents();
+
base.Unapply(fromBindingContextChanged);
_weakTarget = null;
_targetProperty = null;
}
+ void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e)
+ => ApplyCore(true);
+
void ApplyCore(bool dispatch = false)
{
if (_weakTarget == null || !_weakTarget.TryGetTarget(out var target))
+ {
+ DetachEvents();
return;
+ }
if (dispatch)
target.Dispatcher.DispatchIfRequired(Set);
@@ -81,11 +90,51 @@ public object Dark
public object Default { get; set; }
+ // Ideally this will get reworked to not use `Application.Current` at all
+ // https://github.com/dotnet/maui/issues/8713
+ // But I'm going with a simple nudge for now so that we can get our
+ // device tests back to a working state and address issues
+ // of the more crashing variety
object GetValue()
- => Application.Current.RequestedTheme switch
- {
- AppTheme.Dark => _isDarkSet ? Dark : Default,
- _ => _isLightSet ? Light : Default,
- };
+ {
+ Application app;
+
+ if (_weakTarget?.TryGetTarget(out var target) == true &&
+ target is VisualElement ve &&
+ ve?.Window?.Parent is Application a)
+ {
+ app = a;
+ }
+ else
+ {
+ app = Application.Current;
+ }
+
+ AppTheme appTheme;
+ if (app == null)
+ appTheme = AppInfo.RequestedTheme;
+ else
+ appTheme = app.RequestedTheme;
+
+ return appTheme switch
+ {
+ AppTheme.Dark => _isDarkSet ? Dark : Default,
+ _ => _isLightSet ? Light : Default,
+ };
+ }
+
+ void AttachEvents()
+ {
+ DetachEvents();
+
+ if (Application.Current != null)
+ Application.Current.RequestedThemeChanged += OnRequestedThemeChanged;
+ }
+
+ void DetachEvents()
+ {
+ if (Application.Current != null)
+ Application.Current.RequestedThemeChanged -= OnRequestedThemeChanged;
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/BindableObject.cs b/src/Controls/src/Core/BindableObject.cs
index 467c325da33a..94d4ba04dc01 100644
--- a/src/Controls/src/Core/BindableObject.cs
+++ b/src/Controls/src/Core/BindableObject.cs
@@ -446,7 +446,7 @@ internal void SetValueCore(BindableProperty property, object value, SetValueFlag
// else omitted on purpose
//if we're updating a dynamic resource from style, set the default backup value
- if ( (context.Attributes & (BindableContextAttributes.IsDynamicResource | BindableContextAttributes.IsSetFromStyle)) != 0
+ if ((context.Attributes & (BindableContextAttributes.IsDynamicResource | BindableContextAttributes.IsSetFromStyle)) != 0
&& (attributes & SetValueFlags.ClearDynamicResource) == 0)
SetBackupStyleValue(property, value);
diff --git a/src/Controls/src/Core/Border.cs b/src/Controls/src/Core/Border.cs
index f468bad8bd76..ccc32a2c7683 100644
--- a/src/Controls/src/Core/Border.cs
+++ b/src/Controls/src/Core/Border.cs
@@ -36,29 +36,29 @@ public Thickness Padding
}
public static readonly BindableProperty StrokeShapeProperty =
- BindableProperty.Create(nameof(StrokeShape), typeof(IShape), typeof(Layout), null);
+ BindableProperty.Create(nameof(StrokeShape), typeof(IShape), typeof(Border), null);
public static readonly BindableProperty StrokeProperty =
- BindableProperty.Create(nameof(Stroke), typeof(Brush), typeof(Layout), null);
+ BindableProperty.Create(nameof(Stroke), typeof(Brush), typeof(Border), null);
public static readonly BindableProperty StrokeThicknessProperty =
- BindableProperty.Create(nameof(StrokeThickness), typeof(double), typeof(Layout), 1.0, propertyChanged: StrokeThicknessChanged);
+ BindableProperty.Create(nameof(StrokeThickness), typeof(double), typeof(Border), 1.0, propertyChanged: StrokeThicknessChanged);
public static readonly BindableProperty StrokeDashArrayProperty =
- BindableProperty.Create(nameof(StrokeDashArray), typeof(DoubleCollection), typeof(Layout), null,
+ BindableProperty.Create(nameof(StrokeDashArray), typeof(DoubleCollection), typeof(Border), null,
defaultValueCreator: bindable => new DoubleCollection());
public static readonly BindableProperty StrokeDashOffsetProperty =
- BindableProperty.Create(nameof(StrokeDashOffset), typeof(double), typeof(Layout), 0.0);
+ BindableProperty.Create(nameof(StrokeDashOffset), typeof(double), typeof(Border), 0.0);
public static readonly BindableProperty StrokeLineCapProperty =
- BindableProperty.Create(nameof(StrokeLineCap), typeof(PenLineCap), typeof(Layout), PenLineCap.Flat);
+ BindableProperty.Create(nameof(StrokeLineCap), typeof(PenLineCap), typeof(Border), PenLineCap.Flat);
public static readonly BindableProperty StrokeLineJoinProperty =
- BindableProperty.Create(nameof(StrokeLineJoin), typeof(PenLineJoin), typeof(Layout), PenLineJoin.Miter);
+ BindableProperty.Create(nameof(StrokeLineJoin), typeof(PenLineJoin), typeof(Border), PenLineJoin.Miter);
public static readonly BindableProperty StrokeMiterLimitProperty =
- BindableProperty.Create(nameof(StrokeMiterLimit), typeof(double), typeof(Layout), 10.0);
+ BindableProperty.Create(nameof(StrokeMiterLimit), typeof(double), typeof(Border), 10.0);
[System.ComponentModel.TypeConverter(typeof(StrokeShapeTypeConverter))]
public IShape? StrokeShape
diff --git a/src/Controls/src/Core/Compatibility/Android/FontNamedSizeService.cs b/src/Controls/src/Core/Compatibility/Android/FontNamedSizeService.cs
index 40a195b40c13..a37f4d5f5aea 100644
--- a/src/Controls/src/Core/Compatibility/Android/FontNamedSizeService.cs
+++ b/src/Controls/src/Core/Compatibility/Android/FontNamedSizeService.cs
@@ -62,7 +62,7 @@ public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSi
case NamedSize.Caption:
return 12;
case NamedSize.Header:
- return 96;
+ return 14;
case NamedSize.Subtitle:
return 16;
case NamedSize.Title:
@@ -94,7 +94,7 @@ public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSi
case NamedSize.Caption:
return 12;
case NamedSize.Header:
- return 96;
+ return 14;
case NamedSize.Subtitle:
return 16;
case NamedSize.Title:
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Android/FrameRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Android/FrameRenderer.cs
index 8321b9ddb7b6..5502e4fd1fba 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Android/FrameRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Android/FrameRenderer.cs
@@ -122,7 +122,7 @@ protected virtual void OnElementChanged(ElementChangedEventArgs e)
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
- if (Element?.Handler is IPlatformViewHandler pvh &&
+ if (Element?.Handler is IPlatformViewHandler pvh &&
Element is IContentView cv)
{
var size = pvh.MeasureVirtualView(widthMeasureSpec, heightMeasureSpec, cv.CrossPlatformMeasure);
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Android/ViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Android/ViewRenderer.cs
index 7230f0ce1079..329d20940976 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Android/ViewRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Android/ViewRenderer.cs
@@ -20,8 +20,19 @@ public abstract partial class ViewRenderer : VisualElem
TPlatformView? _platformView;
AViewGroup? _container;
- public TPlatformView? Control => ((IElementHandler)this).PlatformView as TPlatformView ?? _platformView;
- object? IElementHandler.PlatformView => _platformView;
+ public TPlatformView? Control
+ {
+ get
+ {
+ var value = ((IElementHandler)this).PlatformView as TPlatformView;
+ if (value != this && value != null)
+ return value;
+
+ return _platformView;
+ }
+ }
+
+ object? IElementHandler.PlatformView => (_platformView as object) ?? this;
public ViewRenderer(Context context) : this(context, VisualElementRendererMapper, VisualElementRendererCommandMapper)
{
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Android/VisualElementRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Android/VisualElementRenderer.cs
index 80ae9137cec3..aaa7b9752edb 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Android/VisualElementRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Android/VisualElementRenderer.cs
@@ -12,7 +12,10 @@ namespace Microsoft.Maui.Controls.Handlers.Compatibility
public abstract partial class VisualElementRenderer : AViewGroup, IPlatformViewHandler
where TElement : Element, IView
{
- object? IElementHandler.PlatformView => ChildCount > 0 ? GetChildAt(0) : null;
+ object? IElementHandler.PlatformView
+ {
+ get => ChildCount > 0 ? GetChildAt(0) : this;
+ }
static partial void ProcessAutoPackage(Maui.IElement element)
{
diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/CellAdapter.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/CellAdapter.cs
index 9b939ad5f3ed..6ce6d62f2294 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/CellAdapter.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/CellAdapter.cs
@@ -10,7 +10,7 @@
using AListView = Android.Widget.ListView;
using AView = Android.Views.View;
using Microsoft.Maui.Controls.Platform;
-#if NET6_0
+#if NET6_0_OR_GREATER
using AMenu = Android.Views.IMenu;
#else
using AMenu = Android.Views.Menu;
diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/CellRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/CellRenderer.cs
index 46b43b7d780f..39803357e2bc 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/CellRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/CellRenderer.cs
@@ -63,7 +63,7 @@ public AView GetCell(Cell item, AView convertView, ViewGroup parent, Context con
if (Cell != oldCell)
{
- oldCell.Handler.DisconnectHandler();
+ oldCell.Handler?.DisconnectHandler();
}
}
}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewAdapter.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewAdapter.cs
index d57f07d1d6c6..5b8d2492ec84 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewAdapter.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewAdapter.cs
@@ -88,6 +88,7 @@ public override int Count
_listCount = count;
}
+
return _listCount;
}
}
@@ -252,6 +253,8 @@ public override AView GetView(int position, AView convertView, ViewGroup parent)
{
cellIsBeingReused = true;
convertView = layout.GetChildAt(0);
+
+ _layoutsCreated[position] = layout;
}
else
{
@@ -267,6 +270,10 @@ public override AView GetView(int position, AView convertView, ViewGroup parent)
else
{
layout = new ConditionalFocusLayout(_context) { Orientation = Orientation.Vertical };
+
+ if (_layoutsCreated.TryGetValue(position, out ConditionalFocusLayout value))
+ DisposeOfConditionalFocusLayout(value);
+
_layoutsCreated[position] = layout;
}
}
@@ -541,6 +548,10 @@ void DisposeOfConditionalFocusLayout(ConditionalFocusLayout layout)
var element = (renderedView as INativeElementView)?.Element;
var view = (element as ViewCell)?.View;
+
+ if (renderedView is ViewGroup vg && view?.Handler?.PlatformView is AView aView)
+ vg.RemoveView(aView);
+
view?.Handler?.DisconnectHandler();
}
@@ -772,4 +783,4 @@ protected virtual void InvalidateCount()
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewRenderer.cs
index 6b223261ce70..10a779addbc1 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewRenderer.cs
@@ -17,7 +17,7 @@ namespace Microsoft.Maui.Controls.Handlers.Compatibility
{
public class ListViewRenderer : ViewRenderer
{
- public static PropertyMapper Mapper =
+ public static PropertyMapper Mapper =
new PropertyMapper(VisualElementRendererMapper);
public static CommandMapper CommandMapper =
@@ -29,6 +29,7 @@ public class ListViewRenderer : ViewRenderer
Container _headerView;
Container _footerView;
bool _isAttached;
+ bool _reattached;
ScrollToRequestedEventArgs _pendingScrollTo;
SwipeRefreshLayout _refresh;
@@ -61,6 +62,22 @@ protected override void OnAttachedToWindow()
_isAttached = true;
_adapter.IsAttachedToWindow = _isAttached;
UpdateIsRefreshing(isInitialValue: true);
+
+ // There might be a better way to go about doing this but from what I can tell
+ // once you detach and then reattach a ListView the cells become unselectable
+ // and the Android.ListView in general is left in an odd state.
+ // We didn't have to do this in XF because in XF there's an extra measure call that happens
+ // when the listview is reattached that essentially does the exact same thing.
+ // You can see this by adding back the legacy renderers and setting a breakpoint on the
+ // adapter.GetView call. In MAUI this never gets called when navigating back vs XF it does
+ if (!_reattached)
+ {
+ _reattached = true;
+ }
+ else
+ {
+ Control?.InvalidateViews();
+ }
}
protected override void OnDetachedFromWindow()
@@ -255,11 +272,7 @@ public override SizeRequest GetDesiredSize(double widthConstraint, double height
// that in as the convert view so that GetView doesn't create
// an additional ConditionalFocusLayout
// We're basically faking re-use to the GetView call
- AView currentParent = null;
- if (cell.Handler?.PlatformView is AView aView)
- currentParent = aView.Parent as AView;
-
- currentParent ??= _adapter.GetConvertViewForMeasuringInfiniteHeight(i);
+ AView currentParent = _adapter.GetConvertViewForMeasuringInfiniteHeight(i);
AView listItem = _adapter.GetView(i, currentParent, Control);
int widthSpec;
diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ViewCellRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ViewCellRenderer.cs
index 15ee232766cd..16d36e59f056 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ViewCellRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ViewCellRenderer.cs
@@ -58,6 +58,13 @@ protected override AView GetCellCore(Cell item, AView convertView, ViewGroup par
return c;
}
+ protected override void DisconnectHandler(AView platformView)
+ {
+ base.DisconnectHandler(platformView);
+ ViewCellContainer c = platformView.GetParentOfType();
+ c?.DisconnectHandler();
+ }
+
internal class ViewCellContainer : ViewGroup, INativeElementView
{
readonly View _parent;
@@ -69,6 +76,7 @@ internal class ViewCellContainer : ViewGroup, INativeElementView
GestureDetector _longPressGestureDetector;
ListViewRenderer _listViewRenderer;
bool _watchForLongPress;
+ AView _currentView;
ListViewRenderer ListViewRenderer
{
@@ -198,7 +206,24 @@ public void Update(ViewCell cell)
_viewCell = cell;
Performance.Start(reference, "Reuse.SetElement");
- _viewHandler.SetVirtualView(cell.View);
+
+ if (_viewHandler != cell.View.Handler)
+ {
+ if (cell.View.Handler?.PlatformView is AView oldCellView &&
+ oldCellView.GetParentOfType() is ViewCellContainer vc)
+ {
+ vc.DisconnectHandler();
+ }
+
+ var oldView = _currentView ?? _viewHandler.PlatformView;
+ if (oldView != null)
+ RemoveView(oldView);
+
+ cell.View.Handler?.DisconnectHandler();
+ _viewHandler.SetVirtualView(cell.View);
+ AddView(_viewHandler.PlatformView);
+ }
+
Performance.Stop(reference, "Reuse.SetElement");
Invalidate();
@@ -208,7 +233,7 @@ public void Update(ViewCell cell)
return;
}
- RemoveView(_viewHandler.PlatformView);
+ RemoveView(_currentView ?? _viewHandler.PlatformView);
_viewCell.View.Handler?.DisconnectHandler();
_viewCell.View.IsPlatformEnabled = false;
@@ -231,6 +256,30 @@ public void UpdateIsEnabled()
Enabled = _parent.IsEnabled && _viewCell.IsEnabled;
}
+ public void DisconnectHandler()
+ {
+ var oldView = _currentView ?? _viewHandler.PlatformView;
+ if (oldView != null)
+ RemoveView(oldView);
+
+ _viewCell?.View?.Handler?.DisconnectHandler();
+
+ }
+
+ public override void AddView(AView child)
+ {
+ if (child.Parent is WrapperView wrapperView)
+ {
+ base.AddView(wrapperView);
+ _currentView = wrapperView;
+ }
+ else
+ {
+ base.AddView(child);
+ _currentView = child;
+ }
+ }
+
protected override void OnLayout(bool changed, int l, int t, int r, int b)
{
if (_viewHandler.PlatformView == null || Context == null)
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ContainerView.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ContainerView.cs
index a260b8c8dc67..baddc9b3649a 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ContainerView.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ContainerView.cs
@@ -3,16 +3,20 @@
using Android.Runtime;
using Android.Util;
using Android.Views;
+using Microsoft.Maui.Platform;
using AView = Android.Views.View;
namespace Microsoft.Maui.Controls.Platform.Compatibility
{
public class ContainerView : ViewGroup
{
+ int _parentTopPadding;
View _view;
ShellViewRenderer _shellContentView;
readonly IMauiContext _mauiContext;
- AView PlatformView => _view?.Handler?.PlatformView as AView;
+ internal AView PlatformView => _view?.Handler?.PlatformView as AView;
+ internal Graphics.Size DesiredSize { get; private set; }
+ internal Graphics.Size MinimumSize { get; private set; }
public ContainerView(Context context, View view, IMauiContext mauiContext) : base(context)
{
@@ -60,6 +64,28 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b)
((IPlatformViewHandler)View.Handler).LayoutVirtualView(l, t, r, b);
}
+ // This indicates the amount of top padding the parent wants this control to have. This
+ // allows us to adjust the height measured so that the parent container maintains a constant height.
+ //
+ // This is mainly used with ShellHeaderFlyoutBehavior.CollapseOnScroll
+ // The container added to the AppBarLayout needs to maintain a constant height otherwise the
+ // OnOffsetChanged value passed in to IOnOffsetChangedListener will just infinitely change as the
+ // header size keeps changing. So in order to make the collapse work we just have to resize the xplat view
+ // and then shift it down in the container.
+ //
+ // In theory we could call `IView.Arrange` with the desired position in the parent but then that sets the xplat `Frame`
+ // to values that don't really make any sense from an xplat perspective. This just causes implementation details
+ // to leak up into the abstraction. It'll just be confusing that the headers position is "0,300" even though it looks
+ // like it's "0,0"
+ internal void SetParentTopPadding(int v)
+ {
+ if (_parentTopPadding == v)
+ return;
+
+ _parentTopPadding = v;
+ this.MaybeRequestLayout();
+ }
+
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
if (View == null)
@@ -77,8 +103,8 @@ protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
var width = widthMeasureSpec.GetSize();
var height = heightMeasureSpec.GetSize();
- var measureWidth = width > 0 ? width : MeasureSpecMode.Unspecified.MakeMeasureSpec(0);
- var measureHeight = height > 0 ? height : MeasureSpecMode.Unspecified.MakeMeasureSpec(0);
+ var measureWidth = width > 0 ? MeasureSpecMode.Exactly.MakeMeasureSpec(width) : MeasureSpecMode.Unspecified.MakeMeasureSpec(0);
+ var measureHeight = height > 0 ? MeasureSpecMode.Exactly.MakeMeasureSpec(height) : MeasureSpecMode.Unspecified.MakeMeasureSpec(0);
double? maxHeight = null;
@@ -97,6 +123,54 @@ protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
}
var size = _shellContentView.Measure(measureWidth, measureHeight, null, (int?)maxHeight);
+
+ if (size.Height < this.MinimumHeight)
+ size = new Graphics.Size(size.Width, this.MinimumHeight);
+
+ DesiredSize = size;
+ var newHeight = size.Height;
+
+ if (_parentTopPadding > 0)
+ {
+ newHeight -= _parentTopPadding;
+ }
+
+ if (newHeight != size.Height)
+ {
+ // Android treats zero as unspecified so we need to set the height to at least 1.
+ // If there's a view that's able to squish/stretch then passing in zero will give it's stretched size
+ // but what we want here is the squished size.
+ var minHeightMeasureSpec = 1;
+
+ if (MinimumHeight > 0)
+ minHeightMeasureSpec = MinimumHeight;
+
+ if (newHeight <= 0)
+ {
+ newHeight = minHeightMeasureSpec;
+ }
+
+ // For collapse on scroll we need to know the minimum size the view can reach so we can set the minimum size
+ // on the headers container. This is the only way to get the AppBarLayout collapse behavior to stop producing
+ // offset changes once the header has reached the minimum size it can get to
+ MinimumSize = _shellContentView.Measure(measureWidth, MeasureSpecMode.Exactly.MakeMeasureSpec(minHeightMeasureSpec), null, (int?)maxHeight);
+
+ // If the offset of the appbar layout hasn't reached the minimum size then
+ // we use the new collapsed size to remeasure so everything is the correct size
+ if (newHeight > minHeightMeasureSpec)
+ {
+ size = _shellContentView.Measure(measureWidth, MeasureSpecMode.Exactly.MakeMeasureSpec((int)newHeight), null, (int?)maxHeight);
+ }
+ else
+ {
+ size = MinimumSize;
+ }
+ }
+ else
+ {
+ this.MinimumSize = new Graphics.Size((int)size.Width, this.MinimumHeight);
+ }
+
SetMeasuredDimension((int)size.Width, (int)size.Height);
}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellContentView.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellContentView.cs
index 384aed12a732..8ecdfc136dd8 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellContentView.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellContentView.cs
@@ -6,6 +6,7 @@
using Google.Android.Material.AppBar;
using Microsoft.Maui.Controls.Platform.Compatibility;
using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Platform;
using AView = Android.Views.View;
using LP = Android.Views.ViewGroup.LayoutParams;
@@ -15,7 +16,7 @@ namespace Microsoft.Maui.Controls.Platform.Compatibility
internal class ShellViewRenderer
{
public IViewHandler Handler { get; private set; }
- View _view;
+ IView _view;
WeakReference _context;
readonly IMauiContext _mauiContext;
IView MauiView => View;
@@ -38,7 +39,7 @@ public ShellViewRenderer(Context context, View view, IMauiContext mauiContext)
View = view;
}
- public View View
+ public IView View
{
get { return _view; }
set
@@ -49,6 +50,7 @@ public View View
public void TearDown()
{
+ MauiView?.Handler?.DisconnectHandler();
View = null;
Handler = null;
_view = null;
@@ -89,15 +91,19 @@ public Graphics.Size Measure(int widthMeasureSpec, int heightMeasureSpec, int? m
heightMeasureSpec = MeasureSpecMode.Unspecified.MakeMeasureSpec(0);
PlatformView.LayoutParameters = layoutParams;
+
return ((IPlatformViewHandler)_view.Handler).MeasureVirtualView(widthMeasureSpec, heightMeasureSpec);
}
- public virtual void OnViewSet(View view)
+ public virtual void OnViewSet(IView view)
{
- if (View != null)
+ if (view == View)
+ return;
+
+ if (View != null && PlatformView.IsAlive())
{
PlatformView.RemoveFromParent();
- View.Handler = null;
+ View.Handler?.DisconnectHandler();
}
_view = view;
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cs
index c777e5d51dd2..a9159aea6c67 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cs
@@ -16,7 +16,7 @@ namespace Microsoft.Maui.Controls.Platform.Compatibility
{
public class ShellFlyoutRecyclerAdapter : RecyclerView.Adapter
{
- readonly IShellContext _shellContext;
+ IShellContext _shellContext;
List _listItems;
List> _flyoutGroupings;
Action _selectedCallback;
@@ -203,15 +203,22 @@ protected override void Dispose(bool disposing)
if (disposing)
{
- ((IShellController)Shell).FlyoutItemsChanged -= OnFlyoutItemsChanged;
-
- _listItems = null;
- _selectedCallback = null;
+ Disconnect();
}
base.Dispose(disposing);
}
+ internal void Disconnect()
+ {
+ if (Shell is IShellController scc)
+ scc.FlyoutItemsChanged -= OnFlyoutItemsChanged;
+
+ _listItems = null;
+ _selectedCallback = null;
+ _shellContext = null;
+ }
+
public class AdapterListItem
{
// This ensures that we have a stable id for each element
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRenderer.cs
index 70469336b847..6575d8fc845a 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRenderer.cs
@@ -118,13 +118,13 @@ void IFlyoutBehaviorObserver.OnFlyoutBehaviorChanged(FlyoutBehavior behavior)
#endregion IFlyoutBehaviorObserver
const uint DefaultScrimColor = 0x99000000;
- readonly IShellContext _shellContext;
+ IShellContext _shellContext;
AView _content;
IShellFlyoutContentRenderer _flyoutContent;
int _flyoutWidthDefault;
double _flyoutWidth = -1;
double _flyoutHeight;
- bool _flyoutFirstDrawPassFinished;
+ internal bool FlyoutFirstDrawPassFinished { get; private set; }
int _currentLockMode;
bool _disposed;
Brush _scrimBrush;
@@ -182,10 +182,10 @@ protected override bool DrawChild(Canvas canvas, AView child, long drawingTime)
canvas.DrawRect(0, 0, Width, Height, _scrimPaint);
}
- if (!_flyoutFirstDrawPassFinished && _flyoutContent != null)
+ if (!FlyoutFirstDrawPassFinished && _flyoutContent != null)
{
if (child == _flyoutContent?.AndroidView)
- _flyoutFirstDrawPassFinished = true;
+ FlyoutFirstDrawPassFinished = true;
if (this.IsDrawerOpen(_flyoutContent.AndroidView) != _shellContext.Shell.FlyoutIsPresented)
{
@@ -261,7 +261,7 @@ protected virtual void OnShellPropertyChanged(object sender, PropertyChangedEven
if (e.PropertyName == Shell.FlyoutIsPresentedProperty.PropertyName)
{
- if (!_flyoutFirstDrawPassFinished)
+ if (!FlyoutFirstDrawPassFinished)
{
// if the first draw pass hasn't happened yet
// then calling close/open drawer really confuses
@@ -391,24 +391,41 @@ void UpdateScrim(Brush backdrop)
}
}
- protected override void Dispose(bool disposing)
+ internal void Disconnect()
{
- if (_disposed)
- return;
+ ShellController?.RemoveAppearanceObserver(this);
- _disposed = true;
-
- if (disposing)
- {
- ShellController.RemoveAppearanceObserver(this);
+ if (Shell != null)
Shell.PropertyChanged -= OnShellPropertyChanged;
+ if (this.IsAlive())
+ {
this.DrawerClosed -= OnDrawerClosed;
this.DrawerSlide -= OnDrawerSlide;
this.DrawerOpened -= OnDrawerOpened;
this.DrawerStateChanged -= OnDrawerStateChanged;
+ }
+
+ ShellController?.RemoveFlyoutBehaviorObserver(this);
+
+ if (_flyoutContent is ShellFlyoutTemplatedContentRenderer flyoutTemplatedContentRenderer)
+ {
+ flyoutTemplatedContentRenderer.Disconnect();
+ }
+
+ _shellContext = null;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (_disposed)
+ return;
+
+ _disposed = true;
- ((IShellController)_shellContext.Shell).RemoveFlyoutBehaviorObserver(this);
+ if (disposing)
+ {
+ Disconnect();
RemoveView(_content);
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cs
index c1ced1007fda..525c0a328a84 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cs
@@ -3,6 +3,7 @@
using System.Threading.Tasks;
using Android.Content;
using Android.Graphics.Drawables;
+using Android.Hardware.Lights;
using Android.Runtime;
using Android.Util;
using Android.Views;
@@ -16,6 +17,7 @@
using Microsoft.Maui.Controls.Platform.Compatibility;
using AView = Android.Views.View;
using LP = Android.Views.ViewGroup.LayoutParams;
+using Microsoft.Maui.Layouts;
namespace Microsoft.Maui.Controls.Platform.Compatibility
{
@@ -31,6 +33,7 @@ public class ShellFlyoutTemplatedContentRenderer : Java.Lang.Object, IShellFlyou
IShellContext _shellContext;
bool _disposed;
HeaderContainer _headerView;
+ FrameLayout _headerFrameLayout;
ViewGroup _rootView;
Drawable _defaultBackgroundColor;
ImageView _bgImage;
@@ -38,7 +41,7 @@ public class ShellFlyoutTemplatedContentRenderer : Java.Lang.Object, IShellFlyou
AView _flyoutContentView;
ShellViewRenderer _contentView;
View _flyoutHeader;
- ShellViewRenderer _footerView;
+ ContainerView _footerView;
int _actionBarHeight;
int _flyoutHeight;
int _flyoutWidth;
@@ -76,11 +79,15 @@ protected virtual void LoadView(IShellContext shellContext)
_appBar = coordinator.FindViewById(Controls.Resource.Id.flyoutcontent_appbar);
+ (_appBar.LayoutParameters as CoordinatorLayout.LayoutParams)
+ .Behavior = new AppBarLayout.Behavior();
+
_rootView = coordinator as ViewGroup;
_appBar.AddOnOffsetChangedListener(this);
_actionBarHeight = context.GetActionBarHeight();
+
UpdateFlyoutHeader();
var metrics = context.Resources.DisplayMetrics;
@@ -105,10 +112,34 @@ protected virtual void LoadView(IShellContext shellContext)
UpdateFlyoutFooter();
if (FlyoutView.FlyoutBehavior == FlyoutBehavior.Locked)
- OnFlyoutViewLayoutChanged();
+ OnFlyoutViewLayoutChanging();
if (View is ShellFlyoutLayout sfl)
- sfl.LayoutChanging += OnFlyoutViewLayoutChanged;
+ {
+ // The purpose of this code is to load the flyout content after
+ // the details content is visible.
+ // Loading the Recycler View the first time is expensive
+ // so we want to delay loading to the latest possible point in time so
+ // it doesn't delay initial startup.
+ GenericGlobalLayoutListener ggll = null;
+ ggll = new GenericGlobalLayoutListener(InitialLoad);
+ sfl.ViewTreeObserver.AddOnGlobalLayoutListener(ggll);
+
+ void InitialLoad()
+ {
+ OnFlyoutViewLayoutChanging();
+
+ if (_flyoutContentView == null || ggll == null)
+ return;
+
+ var listener = ggll;
+ ggll = null;
+
+ // Once initial load has finished let's just attach to Layout Changing
+ sfl.ViewTreeObserver.RemoveOnGlobalLayoutListener(listener);
+ sfl.LayoutChanging += OnFlyoutViewLayoutChanging;
+ }
+ }
}
void OnFlyoutHeaderMeasureInvalidated(object sender, EventArgs e)
@@ -165,7 +196,18 @@ protected virtual void UpdateFlyoutContent()
return;
_rootView.AddView(_flyoutContentView, index);
- UpdateContentLayout();
+ UpdateContentPadding();
+ }
+
+
+ void DisconnectRecyclerView()
+ {
+ if (_flyoutContentView.IsAlive() &&
+ _flyoutContentView is RecyclerViewContainer rvc &&
+ rvc.GetAdapter() is ShellFlyoutRecyclerAdapter sfra)
+ {
+ sfra.Disconnect();
+ }
}
AView CreateFlyoutContent(ViewGroup rootView)
@@ -175,9 +217,11 @@ AView CreateFlyoutContent(ViewGroup rootView)
{
var oldContentView = _contentView;
_contentView = null;
- oldContentView.TearDown();
+ oldContentView.View = null;
}
+ DisconnectRecyclerView();
+
var content = ((IShellController)ShellContext.Shell).FlyoutContent;
if (content == null)
{
@@ -211,7 +255,8 @@ protected virtual void UpdateFlyoutHeader()
_headerView.LayoutChange -= OnHeaderViewLayoutChange;
var oldHeaderView = _headerView;
_headerView = null;
- _appBar.RemoveView(oldHeaderView);
+ _appBar.RemoveView(_headerFrameLayout);
+ _headerFrameLayout.RemoveView(oldHeaderView);
oldHeaderView.Dispose();
}
@@ -222,32 +267,37 @@ protected virtual void UpdateFlyoutHeader()
_flyoutHeader = ((IShellController)_shellContext.Shell).FlyoutHeader;
if (_flyoutHeader != null)
+ {
_flyoutHeader.MeasureInvalidated += OnFlyoutHeaderMeasureInvalidated;
- _headerView = new HeaderContainer(_shellContext.AndroidContext, _flyoutHeader, MauiContext)
- {
- MatchWidth = true
- };
+ _headerFrameLayout ??= new FrameLayout(_rootView.Context);
- _headerView.LayoutChange += OnHeaderViewLayoutChange;
+ _headerView = new HeaderContainer(_rootView.Context, _flyoutHeader, MauiContext)
+ {
+ MatchWidth = true
+ };
- _headerView.SetMinimumHeight(_actionBarHeight);
- _headerView.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, LP.WrapContent)
- {
- ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll
- };
- _appBar.AddView(_headerView);
- UpdateFlyoutHeaderBehavior();
+ _headerView.LayoutChange += OnHeaderViewLayoutChange;
+
+ _headerFrameLayout.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, LP.WrapContent)
+ {
+ ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll
+ };
+
+ _headerFrameLayout.AddView(_headerView);
+ _appBar.AddView(_headerFrameLayout);
+
+ UpdateFlyoutHeaderBehavior();
+ }
- UpdateContentLayout();
+ UpdateContentPadding();
}
void OnHeaderViewLayoutChange(object sender, AView.LayoutChangeEventArgs e)
{
// If the flyoutheader/footer have changed size then we need to
// remeasure the flyout content
- if (UpdateContentPadding())
- UpdateContentLayout();
+ UpdateContentPadding();
}
protected virtual void UpdateFlyoutFooter()
@@ -255,9 +305,9 @@ protected virtual void UpdateFlyoutFooter()
if (_footerView != null)
{
var oldFooterView = _footerView;
- _rootView.RemoveView(_footerView.PlatformView);
+ _rootView.RemoveView(_footerView);
_footerView = null;
- oldFooterView.TearDown();
+ oldFooterView.View = null;
}
var footer = ((IShellController)_shellContext.Shell).FlyoutFooter;
@@ -265,40 +315,50 @@ protected virtual void UpdateFlyoutFooter()
if (footer == null)
return;
- _footerView = new ShellViewRenderer(_shellContext.AndroidContext, footer, MauiContext);
+ if (_flyoutWidth == 0)
+ return;
- _rootView.AddView(_footerView.PlatformView);
+ _footerView = new ContainerView(_shellContext.AndroidContext, footer, MauiContext)
+ {
+ MatchWidth = true
+ };
- if (_footerView.PlatformView.LayoutParameters is CoordinatorLayout.LayoutParams cl)
- cl.Gravity = (int)(GravityFlags.Bottom | GravityFlags.End);
+ var footerViewLP = new CoordinatorLayout.LayoutParams(0, 0)
+ {
+ Gravity = (int)(GravityFlags.Bottom | GravityFlags.End)
+ };
- UpdateFooterLayout();
- UpdateContentLayout();
+ UpdateFooterLayout(footerViewLP);
+ _rootView.AddView(_footerView, footerViewLP);
+
+ UpdateContentPadding();
}
void UpdateFooterLayout()
{
- if (_flyoutWidth == 0)
+ if (_flyoutWidth == 0 || _footerView == null)
{
return;
}
- var footerSize =
- _footerView?
- .Measure(
- MeasureSpecMode.Exactly.MakeMeasureSpec(_flyoutWidth),
- MeasureSpecMode.Unspecified.MakeMeasureSpec(0),
- null,
- null);
+ if (_footerView?.LayoutParameters is CoordinatorLayout.LayoutParams cl)
+ UpdateFooterLayout(cl);
+ }
- if (_footerView?.View != null && footerSize.HasValue)
- {
- var width = _shellContext.AndroidContext.FromPixels(footerSize.Value.Width);
- var height = _shellContext.AndroidContext.FromPixels(footerSize.Value.Height);
+ void UpdateFooterLayout(CoordinatorLayout.LayoutParams cl)
+ {
+ cl.Width = MeasureSpecMode.Exactly.MakeMeasureSpec(_flyoutWidth);
+ cl.Height = MeasureSpecMode.Unspecified.MakeMeasureSpec(0);
+ }
- _footerView.View.Frame =
- new Graphics.Rect(Graphics.Point.Zero, new Graphics.Size(width, height));
- }
+ int GetFooterViewTotalHeight()
+ {
+ var margin = Thickness.Zero;
+ var measuredHeight = (FooterView?.MeasuredHeight ?? 0);
+ if (_footerView?.View != null)
+ margin = _footerView.View.Margin;
+
+ return measuredHeight + (int)(_rootView.Context.ToPixels(margin.VerticalThickness));
}
bool UpdateContentPadding()
@@ -308,15 +368,21 @@ bool UpdateContentPadding()
if (flyoutView?.LayoutParameters is ViewGroup.MarginLayoutParams cl)
{
+ var viewMargin = _contentView?.View?.Margin ?? Thickness.Zero;
+ var bottomMarginPx = (int)_rootView.Context.ToPixels(viewMargin.Bottom);
+
// For scrollable content we use padding so once it's all the way scrolled up
// the bottom of the view isn't obscured by the footer view
// If you try to use Margin the RecylcerView won't render anything.
if (flyoutView is AndroidX.Core.View.IScrollingView &&
flyoutView is ViewGroup vg)
{
- var bottomPadding = FooterView?.MeasuredHeight ?? 0;
+ var bottomPadding = GetFooterViewTotalHeight();
returnValue = true;
- cl.BottomMargin = 0;
+
+ if (cl.BottomMargin != bottomMarginPx)
+ cl.BottomMargin = bottomMarginPx;
+
if (vg.PaddingBottom != bottomPadding)
{
vg.SetPadding(0, 0, 0, bottomPadding);
@@ -327,8 +393,25 @@ bool UpdateContentPadding()
}
else
{
- var bottomMargin = FooterView?.MeasuredHeight ?? 0;
- bottomMargin += _headerView?.MeasuredHeight ?? 0;
+ var bottomMargin = GetFooterViewTotalHeight() + bottomMarginPx;
+ var headerViewHeight = _headerView?.MeasuredHeight ?? 0;
+
+ // If the ScrollFlag on the LayoutParams are not set to zero than the content will automatically offset
+ // By the height of the action bar so we can subtract that out of how much margin needs to be applied
+ // to make room for the footer.
+ //
+ // The Flyout Content is already going to be offset by the app bar height
+ // so we don't need to add that to the bottom margin
+ if (headerViewHeight > 0 &&
+ _headerFrameLayout?.LayoutParameters is AppBarLayout.LayoutParams alp &&
+ alp.ScrollFlags != 0)
+ {
+ bottomMargin += _headerView?.MeasuredHeight ?? 0;
+
+ var headerViewMinHeight = _headerView?.MinimumHeight ?? 0;
+ if (bottomMargin > headerViewMinHeight)
+ bottomMargin -= headerViewMinHeight;
+ }
if (cl.BottomMargin != bottomMargin)
{
@@ -336,45 +419,27 @@ bool UpdateContentPadding()
returnValue = true;
}
}
- }
-
- return returnValue;
- }
-
- void UpdateContentLayout()
- {
- if (_contentView != null)
- {
- if (_contentView == null)
- return;
- UpdateContentPadding();
-
- var height =
- (View.MeasuredHeight) -
- (FooterView?.MeasuredHeight ?? 0) -
- (_headerView?.MeasuredHeight ?? 0);
-
- var width = View.MeasuredWidth;
-
- var frameSize = _contentView.Measure(
- MeasureSpecMode.Exactly.MakeMeasureSpec(width),
- MeasureSpecMode.Exactly.MakeMeasureSpec(height), null, null);
-
- var dpWidth = _shellContext.AndroidContext.FromPixels(frameSize.Width);
- var dpHeight = _shellContext.AndroidContext.FromPixels(frameSize.Height);
+ // Set the XPLAT frame to the measured size of the platform
+ // and propagate any margins set
+ if (_contentView?.PlatformView != null)
+ {
+ var dpWidth = _rootView.Context.FromPixels(_contentView.PlatformView.MeasuredWidth);
+ var dpHeight = _rootView.Context.FromPixels(_contentView.PlatformView.MeasuredHeight);
+ _contentView.View.Frame = _contentView.View.ComputeFrame(new Graphics.Rect(0, 0, dpWidth, dpHeight));
+
+ cl.LeftMargin = (int)_rootView.Context.ToPixels(viewMargin.Left);
+ cl.TopMargin = (int)_rootView.Context.ToPixels(viewMargin.Top);
+ cl.RightMargin = (int)_rootView.Context.ToPixels(viewMargin.Right);
+ // bottom margin is set by the code above this
+ }
- _contentView.View.Frame = new Graphics.Rect(0, 0, dpWidth, dpHeight);
- }
- else if (_flyoutContentView != null)
- {
- // For scrollable content we need to use padding instead of margin
- // if you use margin the recycler view won't render.
- UpdateContentPadding();
}
+
+ return returnValue;
}
- void OnFlyoutViewLayoutChanged()
+ void OnFlyoutViewLayoutChanging()
{
// The second time this fires the non flyout part of the view
// is visible to the user. I haven't found a better
@@ -396,8 +461,13 @@ void OnFlyoutViewLayoutChanged()
_flyoutHeight = View.MeasuredHeight;
_flyoutWidth = View.MeasuredWidth;
+
+ // We wait to instantiate the flyout footer until we know the WxH of the flyout container
+ if (_footerView == null)
+ UpdateFlyoutFooter();
+
UpdateFooterLayout();
- UpdateContentLayout();
+ UpdateContentPadding();
}
}
@@ -483,57 +553,76 @@ void UpdateFlyoutBgImageAsync()
protected virtual void UpdateFlyoutHeaderBehavior()
{
- var context = _shellContext.AndroidContext;
-
- var margin = _flyoutHeader?.Margin ?? default(Thickness);
+ if (_headerView == null)
+ return;
- var minimumHeight = Convert.ToInt32(_actionBarHeight + context.ToPixels(margin.Top) - context.ToPixels(margin.Bottom));
- _headerView.SetMinimumHeight(minimumHeight);
+ _headerView.SetFlyoutHeaderBehavior(_shellContext.Shell.FlyoutHeaderBehavior);
switch (_shellContext.Shell.FlyoutHeaderBehavior)
{
case FlyoutHeaderBehavior.Default:
case FlyoutHeaderBehavior.Fixed:
- _headerView.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, LP.WrapContent)
+ _headerFrameLayout.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, LP.WrapContent)
{
- ScrollFlags = 0,
- LeftMargin = (int)context.ToPixels(margin.Left),
- TopMargin = (int)context.ToPixels(margin.Top),
- RightMargin = (int)context.ToPixels(margin.Right),
- BottomMargin = (int)context.ToPixels(margin.Bottom)
+ ScrollFlags = 0
};
break;
case FlyoutHeaderBehavior.Scroll:
- _headerView.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, LP.WrapContent)
+ _headerFrameLayout.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, LP.WrapContent)
{
- ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll,
- LeftMargin = (int)context.ToPixels(margin.Left),
- TopMargin = (int)context.ToPixels(margin.Top),
- RightMargin = (int)context.ToPixels(margin.Right),
- BottomMargin = (int)context.ToPixels(margin.Bottom)
+ ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll
};
break;
case FlyoutHeaderBehavior.CollapseOnScroll:
- _headerView.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, LP.WrapContent)
+ _headerFrameLayout.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, LP.WrapContent)
{
ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagExitUntilCollapsed |
- AppBarLayout.LayoutParams.ScrollFlagScroll,
- LeftMargin = (int)context.ToPixels(margin.Left),
- TopMargin = (int)context.ToPixels(margin.Top),
- RightMargin = (int)context.ToPixels(margin.Right),
- BottomMargin = (int)context.ToPixels(margin.Bottom)
+ AppBarLayout.LayoutParams.ScrollFlagScroll
};
break;
}
}
+ int _lastAppbarLayoutOffset;
public void OnOffsetChanged(AppBarLayout appBarLayout, int verticalOffset)
{
+ if (_lastAppbarLayoutOffset == verticalOffset)
+ return;
+
+ _lastAppbarLayoutOffset = verticalOffset;
+
+ if (_headerView == null)
+ return;
+
var headerBehavior = _shellContext.Shell.FlyoutHeaderBehavior;
if (headerBehavior != FlyoutHeaderBehavior.CollapseOnScroll)
+ {
+ _headerView.SetParentTopPadding(0);
return;
+ }
+
+ _headerView.SetParentTopPadding(-verticalOffset);
+
+ }
- _headerView.SetPadding(0, -verticalOffset, 0, 0);
+ internal void Disconnect()
+ {
+ if (_shellContext?.Shell != null)
+ _shellContext.Shell.PropertyChanged -= OnShellPropertyChanged;
+
+ if (_flyoutHeader != null)
+ _flyoutHeader.MeasureInvalidated -= OnFlyoutHeaderMeasureInvalidated;
+
+ _flyoutHeader = null;
+
+ if (_footerView != null)
+ _footerView.View = null;
+
+ _headerView?.Disconnect();
+ DisconnectRecyclerView();
+
+ if (_contentView != null)
+ _contentView.View = null;
}
protected override void Dispose(bool disposing)
@@ -545,36 +634,36 @@ protected override void Dispose(bool disposing)
if (disposing)
{
- _shellContext.Shell.PropertyChanged -= OnShellPropertyChanged;
-
- if (_flyoutHeader != null)
- _flyoutHeader.MeasureInvalidated -= OnFlyoutHeaderMeasureInvalidated;
+ Disconnect();
if (_appBar != null)
{
_appBar.RemoveOnOffsetChangedListener(this);
- _appBar.RemoveView(_headerView);
+
+ if (_headerFrameLayout != null)
+ _appBar.RemoveView(_headerFrameLayout);
}
- if (_rootView != null && _footerView?.PlatformView != null)
- _rootView.RemoveView(_footerView.PlatformView);
+ if (_rootView != null && _footerView != null)
+ _rootView.RemoveView(_footerView);
if (View != null && View is ShellFlyoutLayout sfl)
- sfl.LayoutChanging -= OnFlyoutViewLayoutChanged;
+ sfl.LayoutChanging -= OnFlyoutViewLayoutChanging;
if (_headerView != null)
_headerView.LayoutChange -= OnHeaderViewLayoutChange;
- _contentView?.TearDown();
+ if (_contentView != null)
+ _contentView.View = null;
+
_flyoutContentView?.Dispose();
- _headerView.Dispose();
- _footerView?.TearDown();
- _rootView.Dispose();
+ _headerView?.Dispose();
+
+ _rootView?.Dispose();
_defaultBackgroundColor?.Dispose();
_bgImage?.Dispose();
_contentView = null;
- _flyoutHeader = null;
_rootView = null;
_headerView = null;
_shellContext = null;
@@ -592,6 +681,8 @@ protected override void Dispose(bool disposing)
public class HeaderContainer : ContainerView
{
bool _isdisposed = false;
+ private FlyoutHeaderBehavior _flyoutHeaderBehavior;
+
public HeaderContainer(Context context, View view, IMauiContext mauiContext) : base(context, view, mauiContext)
{
Initialize(view);
@@ -617,12 +708,30 @@ void UpdateElevation()
ElevationHelper.SetElevation(view, View);
}
- protected override void OnLayout(bool changed, int l, int t, int r, int b)
+ protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
- l -= PaddingLeft + PaddingRight;
- t -= PaddingTop + PaddingBottom;
+ UpdateMinimumHeight();
+ base.OnMeasure(widthMeasureSpec, heightMeasureSpec);
+
+ if (Parent is AView parentFrameLayout)
+ {
+ var headerOffsetFromParentContainer = (int)(DesiredSize.Height - MeasuredHeight);
+ parentFrameLayout.SetPadding(0, headerOffsetFromParentContainer, 0, 0);
+
+ // If the headerview has a minimum height set then we'll use
+ // that for the minimum height on the header views frame layout parent
+ // container
+ // This is really only relevant with CollapseOnScroll where
+ // the min height on the header view gets set to 56
+ parentFrameLayout.SetMinimumHeight((int)MinimumSize.Height);
+ }
+ }
+
+ protected override void OnLayout(bool changed, int l, int t, int r, int b)
+ {
UpdateElevation();
+
base.OnLayout(changed, l, t, r, b);
}
@@ -632,15 +741,61 @@ protected override void Dispose(bool disposing)
return;
_isdisposed = true;
+
if (disposing)
+ Disconnect();
+
+ base.Dispose(disposing);
+ }
+
+ internal void Disconnect()
+ {
+ if (View != null)
{
- if (View != null)
- View.PropertyChanged -= OnViewPropertyChanged;
+ View.PropertyChanged -= OnViewPropertyChanged;
+ View = null;
}
+ }
- View = null;
+ internal void SetFlyoutHeaderBehavior(FlyoutHeaderBehavior flyoutHeaderBehavior)
+ {
+ if (_flyoutHeaderBehavior == flyoutHeaderBehavior)
+ return;
- base.Dispose(disposing);
+ _flyoutHeaderBehavior = flyoutHeaderBehavior;
+ UpdateMinimumHeight();
+ }
+
+ void UpdateMinimumHeight()
+ {
+ var minHeight = 0;
+
+ if (View?.MinimumHeightRequest > 0)
+ {
+ minHeight = (int)Context.ToPixels(View.MinimumHeightRequest);
+ }
+ else if (_flyoutHeaderBehavior == FlyoutHeaderBehavior.CollapseOnScroll)
+ {
+ minHeight = Context.GetActionBarHeight();
+ }
+ else
+ {
+ minHeight = 0;
+ }
+
+ if (MinimumHeight != minHeight)
+ this.SetMinimumHeight(minHeight);
+
+ if (Parent is AView frameLayoutView &&
+ minHeight > frameLayoutView.MinimumHeight)
+ {
+ frameLayoutView.SetMinimumHeight(minHeight);
+ }
+
+ if (PlatformView.MinimumHeight != minHeight)
+ {
+ PlatformView.SetMinimumHeight(minHeight);
+ }
}
}
}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentContainer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentContainer.cs
index bbc96ab07634..96131de9c67e 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentContainer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentContainer.cs
@@ -29,11 +29,20 @@ public override AView OnCreateView(LayoutInflater inflater, ViewGroup container,
// Handler and MauiContext
// But we want to update the inflater and ChildFragmentManager to match
// the handlers new home
- if (_page?.Handler?.MauiContext is MauiContext scopedMauiContext)
+ if (_page.Handler?.MauiContext is MauiContext scopedMauiContext)
{
- scopedMauiContext.AddWeakSpecific(ChildFragmentManager);
- scopedMauiContext.AddWeakSpecific(inflater);
- mauiContext = scopedMauiContext;
+ // If this page comes to us from a different activity then don't reuse it
+ // disconnect the handler so it can recreate against new MauiContext
+ if (scopedMauiContext.GetActivity() == Context.GetActivity())
+ {
+ scopedMauiContext.AddWeakSpecific(ChildFragmentManager);
+ scopedMauiContext.AddWeakSpecific(inflater);
+ mauiContext = scopedMauiContext;
+ }
+ else
+ {
+ _page.Handler.DisconnectHandler();
+ }
}
mauiContext ??= _mauiContext.MakeScoped(layoutInflater: inflater, fragmentManager: ChildFragmentManager);
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentStateAdapter.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentStateAdapter.cs
index 83ee94b9a1cb..605b6eb71289 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentStateAdapter.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentStateAdapter.cs
@@ -27,11 +27,10 @@ public ShellFragmentStateAdapter(
{
_mauiContext = mauiContext;
_shellSection = shellSection;
- SectionController.ItemsCollectionChanged += OnItemsCollectionChanged;
_items = SectionController.GetItems();
}
- protected virtual void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ public void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
_items = SectionController.GetItems();
var removeList = new List();
@@ -42,8 +41,6 @@ protected virtual void OnItemsCollectionChanged(object sender, NotifyCollectionC
foreach (var remove in removeList)
_createdShellContent.Remove(remove);
-
- NotifyDataSetChanged();
}
public int CountOverride { get; set; }
@@ -52,6 +49,7 @@ protected virtual void OnItemsCollectionChanged(object sender, NotifyCollectionC
public override Fragment CreateFragment(int position)
{
+
var shellContent = _items[position];
return new ShellFragmentContainer(shellContent, _mauiContext) { Arguments = Bundle.Empty };
}
@@ -70,6 +68,14 @@ public override long GetItemId(int position)
public override bool ContainsItem(long itemId)
{
+ if (_createdShellContent.TryGetValue(itemId, out var shellContent) &&
+ !_items.Contains(shellContent))
+ {
+ // This means a data set change was triggered but the INCC change hasn't
+ // propagated from our xplat code to here yet
+ _createdShellContent.Remove(itemId);
+ }
+
return _createdShellContent.ContainsKey(itemId);
}
@@ -82,7 +88,6 @@ protected override void Dispose(bool disposing)
if (disposing)
{
- SectionController.ItemsCollectionChanged -= OnItemsCollectionChanged;
_shellSection = null;
_items = null;
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRendererBase.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRendererBase.cs
index f482f01c56f3..fffde3b252c2 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRendererBase.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRendererBase.cs
@@ -75,7 +75,7 @@ protected Page DisplayedPage
}
}
- protected IShellContext ShellContext { get; }
+ protected IShellContext ShellContext { get; private set; }
protected ShellItem ShellItem { get; private set; }
@@ -84,6 +84,13 @@ protected virtual IShellObservableFragment CreateFragmentForPage(Page page)
return ShellContext.CreateFragmentForPage(page);
}
+ internal void Disconnect()
+ {
+ ShellSection = null;
+ DisplayedPage = null;
+ ShellContext = null;
+ }
+
void Destroy()
{
foreach (var item in _fragmentMap)
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs
index 999aeed5cf4f..30c22a7ae7d4 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs
@@ -114,6 +114,7 @@ static Color ResolveThemeColor(Color light, Color dark)
IShellFlyoutRenderer _flyoutView;
FrameLayout _frameLayout;
IMauiContext _mauiContext;
+ bool _disposed;
event EventHandler _elementPropertyChanged;
@@ -345,6 +346,30 @@ void IElementHandler.Invoke(string command, object args)
void IElementHandler.DisconnectHandler()
{
+ if (_disposed)
+ return;
+
+ _disposed = true;
+
+ Element.PropertyChanged -= OnElementPropertyChanged;
+ Element.SizeChanged -= OnElementSizeChanged;
+ ((IShellController)Element).RemoveAppearanceObserver(this);
+
+ if (_flyoutView is ShellFlyoutRenderer sfr)
+ sfr.Disconnect();
+ else
+ (_flyoutView as IDisposable)?.Dispose();
+
+ if (_currentView is ShellItemRendererBase sir)
+ sir.Disconnect();
+ else
+ _currentView.Dispose();
+
+ _currentView = null;
+
+ Element = null;
+
+ _disposed = true;
}
class SplitDrawable : Drawable
@@ -390,4 +415,4 @@ public override void SetColorFilter(ColorFilter colorFilter)
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSectionRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSectionRenderer.cs
index 7e9e54d99e73..834b8b3eb963 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSectionRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSectionRenderer.cs
@@ -12,6 +12,7 @@
using AndroidX.ViewPager.Widget;
using AndroidX.ViewPager2.Widget;
using Google.Android.Material.Tabs;
+using Microsoft.Extensions.Logging;
using AToolbar = AndroidX.AppCompat.Widget.Toolbar;
using AView = Android.Views.View;
@@ -226,6 +227,45 @@ protected virtual void OnAnimationFinished(EventArgs e)
protected virtual void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
UpdateTablayoutVisibility();
+
+ if (_viewPager?.Adapter is ShellFragmentStateAdapter adapter)
+ {
+ adapter.OnItemsCollectionChanged(sender, e);
+ SafeNotifyDataSetChanged();
+ }
+ }
+
+ void SafeNotifyDataSetChanged(int iteration = 0)
+ {
+ if (_disposed)
+ return;
+
+ if (!_viewPager.IsAlive())
+ return;
+
+ if (iteration >= 10)
+ {
+ // It's very unlikely this will happen but just in case there's a scenario
+ // where we might hit an infinite loop we're adding an exit strategy
+ MauiContext.CreateLogger()
+ .LogWarning("ViewPager2 stuck in layout, unable to NotifyDataSetChanged;");
+
+ return;
+ }
+
+ if (_viewPager?.Adapter is ShellFragmentStateAdapter adapter)
+ {
+ // https://stackoverflow.com/questions/43221847/cannot-call-this-method-while-recyclerview-is-computing-a-layout-or-scrolling-wh
+ // ViewPager2 is based on RecyclerView which really doesn't like NotifyDataSetChanged when a layout is happening
+ if (!_viewPager.IsInLayout)
+ {
+ adapter.NotifyDataSetChanged();
+ }
+ else
+ {
+ _viewPager.Post(() => SafeNotifyDataSetChanged(++iteration));
+ }
+ }
}
void UpdateTablayoutVisibility()
@@ -258,7 +298,9 @@ protected virtual void OnShellItemPropertyChanged(object sender, PropertyChanged
var newIndex = SectionController.GetItems().IndexOf(ShellSection.CurrentItem);
if (SectionController.GetItems().Count != _viewPager.ChildCount)
- _viewPager.Adapter.NotifyDataSetChanged();
+ {
+ SafeNotifyDataSetChanged();
+ }
if (newIndex >= 0)
{
@@ -299,7 +341,15 @@ protected virtual void OnPageSelected(int position)
return;
var shellSection = ShellSection;
- var shellContent = SectionController.GetItems()[position];
+ var visibleItems = SectionController.GetItems();
+
+ // This mainly happens if all of the items that are part of this shell section
+ // vanish. Android calls `OnPageSelected` with position zero even though the view pager is
+ // empty
+ if (visibleItems.Count >= position)
+ return;
+
+ var shellContent = visibleItems[position];
if (shellContent == shellSection.CurrentItem)
return;
@@ -314,7 +364,7 @@ protected virtual void OnPageSelected(int position)
}
else if (shellSection?.CurrentItem != null)
{
- var currentPosition = SectionController.GetItems().IndexOf(shellSection.CurrentItem);
+ var currentPosition = visibleItems.IndexOf(shellSection.CurrentItem);
_selecting = true;
// Android doesn't really appreciate you calling SetCurrentItem inside a OnPageSelected callback.
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs
index bef8125cb6ce..3ac9a8831ca4 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs
@@ -62,7 +62,7 @@ public void UpdateSearchBarColors()
internal void UpdateFlowDirection(Shell shell)
{
_uiSearchBar.UpdateFlowDirection(shell);
- _numericAccessoryView.UpdateFlowDirection(shell);
+ _numericAccessoryView?.UpdateFlowDirection(shell);
var uiTextField = _uiSearchBar.FindDescendantView();
UpdateSearchBarHorizontalTextAlignment(uiTextField, shell);
@@ -304,7 +304,7 @@ void UpdateKeyboard()
// iPhone does not have an enter key on numeric keyboards
if (DeviceInfo.Idiom == DeviceIdiom.Phone && (keyboard == Keyboard.Numeric || keyboard == Keyboard.Telephone))
{
- _numericAccessoryView = _numericAccessoryView ?? CreateNumericKeyboardAccessoryView();
+ _numericAccessoryView ??= CreateNumericKeyboardAccessoryView();
_uiSearchBar.InputAccessoryView = _numericAccessoryView;
}
else
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutContentRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutContentRenderer.cs
index 5a9dfc1e657c..8416f200980f 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutContentRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutContentRenderer.cs
@@ -261,7 +261,7 @@ void UpdateFlyoutBgImageAsync()
return;
}
- imageSource.LoadImage(imageSource.FindMauiContext(), result =>
+ imageSource.LoadImage(_shellContext.Shell.FindMauiContext(), result =>
{
var nativeImage = result?.Value;
if (View == null || nativeImage == null)
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs
index 5ef13afcd2a9..cc05f9978014 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs
@@ -231,6 +231,7 @@ public void LayoutParallax()
footerHeight = FooterView.Frame.Height;
var contentViewYOffset = HeaderView?.Frame.Height ?? 0;
+
if (ScrollView != null)
{
if (Content == null)
@@ -240,10 +241,8 @@ public void LayoutParallax()
}
else
{
- ContentView.Frame =
- new CGRect(parent.Bounds.X, HeaderTopMargin, parent.Bounds.Width, parent.Bounds.Height - HeaderTopMargin - footerHeight);
-
- Content?.LayoutToSize(ContentView.Frame.Width, ContentView.Frame.Height - contentViewYOffset);
+ var contentFrame = new Rect(parent.Bounds.X, HeaderTopMargin, parent.Bounds.Width, parent.Bounds.Height - HeaderTopMargin - footerHeight);
+ (Content as IView)?.Arrange(contentFrame);
}
}
else
@@ -257,12 +256,11 @@ public void LayoutParallax()
{
topMargin = (float)UIApplication.SharedApplication.GetSafeAreaInsetsForWindow().Top;
}
+ else
+ contentViewYOffset -= (nfloat)HeaderTopMargin;
- ContentView.Frame =
- new CGRect(parent.Bounds.X, topMargin + contentViewYOffset, parent.Bounds.Width, parent.Bounds.Height - topMargin - footerHeight - contentViewYOffset);
-
-
- Content?.LayoutToSize(ContentView.Frame.Width, ContentView.Frame.Height);
+ var contentFrame = new Rect(parent.Bounds.X, topMargin + contentViewYOffset, parent.Bounds.Width, parent.Bounds.Height - topMargin - footerHeight - contentViewYOffset);
+ (Content as IView)?.Arrange(contentFrame);
}
if (HeaderView != null && !double.IsNaN(HeaderSize))
@@ -361,4 +359,4 @@ public void TearDown()
FooterView = null;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutRenderer.cs
index 1b64895f2936..ee153f4e2943 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutRenderer.cs
@@ -108,6 +108,7 @@ void IFlyoutBehaviorObserver.OnFlyoutBehaviorChanged(FlyoutBehavior behavior)
else if (behavior == FlyoutBehavior.Disabled)
IsOpen = false;
LayoutSidebar(false);
+ UpdateFlyoutAccessibility();
}
#endregion IFlyoutBehaviorObserver
@@ -155,9 +156,43 @@ bool IsOpen
_isOpen = value;
Shell.SetValueFromRenderer(Shell.FlyoutIsPresentedProperty, value);
+ UpdateFlyoutAccessibility();
}
}
+ void UpdateFlyoutAccessibility()
+ {
+ bool flyoutElementsHidden = false;
+ bool detailsElementsHidden = false;
+
+ switch (_flyoutBehavior)
+ {
+ case FlyoutBehavior.Flyout:
+ flyoutElementsHidden = !IsOpen;
+ detailsElementsHidden = IsOpen;
+
+ break;
+
+ case FlyoutBehavior.Locked:
+ flyoutElementsHidden = false;
+ detailsElementsHidden = false;
+
+ break;
+
+ case FlyoutBehavior.Disabled:
+ flyoutElementsHidden = true;
+ detailsElementsHidden = false;
+
+ break;
+ }
+
+ if (Flyout?.ViewController?.View != null)
+ Flyout.ViewController.View.AccessibilityElementsHidden = flyoutElementsHidden;
+
+ if (Detail?.View != null)
+ Detail.View.AccessibilityElementsHidden = detailsElementsHidden;
+ }
+
UIPanGestureRecognizer PanGestureRecognizer { get; set; }
Shell Shell { get; set; }
@@ -194,6 +229,7 @@ public override void ViewDidLoad()
((IShellController)Shell).AddFlyoutBehaviorObserver(this);
UpdateFlowDirection();
+ UpdateFlyoutAccessibility();
}
protected override void Dispose(bool disposing)
@@ -422,6 +458,8 @@ void LayoutSidebar(bool animate, bool cancelExisting = false)
UpdateTapoffView();
_flyoutAnimation = null;
+
+ UIAccessibility.PostNotification(UIAccessibilityPostNotification.ScreenChanged, null);
}
});
@@ -437,6 +475,8 @@ void LayoutSidebar(bool animate, bool cancelExisting = false)
{
TapoffView.Layer.Opacity = IsOpen ? 1 : 0;
}
+
+ UIAccessibility.PostNotification(UIAccessibilityPostNotification.ScreenChanged, null);
}
void UpdateTapoffView()
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs
index b257e0bb5c95..79c0213c2474 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs
@@ -130,7 +130,7 @@ internal bool SendPop()
}
}
-
+
// Do not remove, wonky behavior on some versions of iOS if you dont dispatch
// Shane: ^ not sure if this is true anymore because of how
// we now route this through "GoToAsync"
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerView.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerView.cs
index 4b5f06a83171..8374dbff206a 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerView.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerView.cs
@@ -19,7 +19,7 @@ public UIContainerView(View view)
_renderer = (IPlatformViewHandler)view.ToHandler(view.FindMauiContext());
- AddSubview(_renderer.PlatformView);
+ AddSubview(view.ToPlatform());
ClipsToBounds = true;
view.MeasureInvalidated += OnMeasureInvalidated;
MeasuredHeight = double.NaN;
@@ -92,7 +92,8 @@ public override void WillMoveToSuperview(UIView newSuper)
public override void LayoutSubviews()
{
- _view.LayoutToSize(Width ?? Frame.Width, Height ?? MeasuredHeight);
+ var platformFrame = new Rect(0, 0, Width ?? Frame.Width, Height ?? MeasuredHeight);
+ (_view as IView).Arrange(platformFrame);
}
protected override void Dispose(bool disposing)
diff --git a/src/Controls/src/Core/Compatibility/Handlers/TableView/Android/TableViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/TableView/Android/TableViewRenderer.cs
index 64dd61ebd109..0042e7e7d396 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/TableView/Android/TableViewRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/TableView/Android/TableViewRenderer.cs
@@ -18,6 +18,7 @@ public class TableViewRenderer : ViewRenderer
new CommandMapper(VisualElementRendererCommandMapper);
TableViewModelRenderer _adapter;
+ bool _reattached;
bool _disposed;
public TableViewRenderer(Context context) : base(context, Mapper, CommandMapper)
@@ -59,12 +60,29 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
_adapter = GetModelRenderer(listView, view);
listView.Adapter = _adapter;
}
+
protected override void OnAttachedToWindow()
{
base.OnAttachedToWindow();
if (Control != null)
Control.NestedScrollingEnabled = (Parent.GetParentOfType() != null);
+
+ // There might be a better way to go about doing this but from what I can tell
+ // once you detach and then reattach a ListView the cells become unselectable
+ // and the Android.ListView in general is left in an odd state.
+ // We didn't have to do this in XF because in XF there's an extra measure call that happens
+ // when the listview is reattached that essentially does the exact same thing.
+ // You can see this by adding back the legacy renderers and setting a breakpoint on the
+ // adapter.GetView call. In MAUI this never gets called when navigating back vs XF it does
+ if (!_reattached)
+ {
+ _reattached = true;
+ }
+ else
+ {
+ Control?.InvalidateViews();
+ }
}
public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
diff --git a/src/Controls/src/Core/Compatibility/Handlers/TableView/Windows/TableViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/TableView/Windows/TableViewRenderer.cs
index db13ef2384bd..ff89db6e7a73 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/TableView/Windows/TableViewRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/TableView/Windows/TableViewRenderer.cs
@@ -58,12 +58,12 @@ protected override void OnElementChanged(ElementChangedEventArgs e)
protected override void Dispose(bool disposing)
{
- if(disposing && !_disposed)
+ if (disposing && !_disposed)
{
_disposed = true;
- if(Control != null)
+ if (Control != null)
{
- Control.SelectionChanged -= OnSelectionChanged;
+ Control.SelectionChanged -= OnSelectionChanged;
}
}
base.Dispose(disposing);
diff --git a/src/Controls/src/Core/Compatibility/Handlers/VisualElementRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/VisualElementRenderer.cs
index a477d2958b1e..70829f5f4161 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/VisualElementRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/VisualElementRenderer.cs
@@ -213,7 +213,10 @@ protected virtual void SetImportantForAccessibility()
IMauiContext? IElementHandler.MauiContext => _mauiContext;
- PlatformView? IPlatformViewHandler.PlatformView => (Element?.Handler as IElementHandler)?.PlatformView as PlatformView;
+ PlatformView? IPlatformViewHandler.PlatformView
+ {
+ get => ((Element?.Handler)?.PlatformView as PlatformView) ?? this;
+ }
PlatformView? IPlatformViewHandler.ContainerView => this;
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Windows/VisualElementRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Windows/VisualElementRenderer.cs
index ef341504235b..d012931064a9 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Windows/VisualElementRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Windows/VisualElementRenderer.cs
@@ -18,8 +18,22 @@ public abstract partial class VisualElementRenderer
TPlatformElement? _nativeView;
public FrameworkElement ContainerElement => this;
- public TPlatformElement? Control => ((IElementHandler)this).PlatformView as TPlatformElement ?? _nativeView;
- object? IElementHandler.PlatformView => _nativeView;
+ public TPlatformElement? Control
+ {
+ get
+ {
+ var value = ((IElementHandler)this).PlatformView as TPlatformElement;
+ if (value != this && value != null)
+ return value;
+
+ return _nativeView;
+ }
+ }
+
+ object? IElementHandler.PlatformView
+ {
+ get => (_nativeView as object) ?? this;
+ }
public UIElement? GeTPlatformElement() => Control;
@@ -64,7 +78,7 @@ protected override WSize MeasureOverride(global::Windows.Foundation.Size availab
var mauiContext = Element?.Handler?.MauiContext;
var minimumSize = MinimumSize();
var mauiRect = Control?.DesiredSize ?? minimumSize.ToPlatform();
-
+
if (Element is not IVisualTreeElement vte || mauiContext == null)
return mauiRect;
diff --git a/src/Controls/src/Core/Compatibility/Handlers/iOS/ViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/iOS/ViewRenderer.cs
index 140a4c7d0103..c07a95434f54 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/iOS/ViewRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/iOS/ViewRenderer.cs
@@ -1,8 +1,5 @@
#nullable enable
-using System;
using CoreGraphics;
-using Microsoft.Maui.Graphics;
-using ObjCRuntime;
using UIKit;
using PlatformView = UIKit.UIView;
@@ -21,8 +18,19 @@ public abstract partial class ViewRenderer : VisualElem
{
TPlatformView? _nativeView;
- public TPlatformView? Control => ((IElementHandler)this).PlatformView as TPlatformView ?? _nativeView;
- object? IElementHandler.PlatformView => _nativeView;
+ public TPlatformView? Control
+ {
+ get
+ {
+ var value = ((IElementHandler)this).PlatformView as TPlatformView;
+ if (value != this && value != null)
+ return value;
+
+ return _nativeView;
+ }
+ }
+
+ object? IElementHandler.PlatformView => (_nativeView as object) ?? this;
public ViewRenderer() : this(VisualElementRendererMapper, VisualElementRendererCommandMapper)
{
diff --git a/src/Controls/src/Core/Compatibility/Handlers/iOS/VisualElementRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/iOS/VisualElementRenderer.cs
index cd7e4f1dc5b1..6a22ad51da66 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/iOS/VisualElementRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/iOS/VisualElementRenderer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.Maui.Controls.Handlers.Compatibility
public abstract partial class VisualElementRenderer : UIView, IPlatformViewHandler, IElementHandler
where TElement : Element, IView
{
- object? IElementHandler.PlatformView => Subviews.Length > 0 ? Subviews[0] : null;
+ object? IElementHandler.PlatformView => Subviews.Length > 0 ? Subviews[0] : this;
public virtual UIViewController? ViewController => null;
diff --git a/src/Controls/src/Core/Compatibility/Windows/WindowsResourcesProvider.cs b/src/Controls/src/Core/Compatibility/Windows/WindowsResourcesProvider.cs
index 89c7dda6fa1e..264816606b6f 100644
--- a/src/Controls/src/Core/Compatibility/Windows/WindowsResourcesProvider.cs
+++ b/src/Controls/src/Core/Compatibility/Windows/WindowsResourcesProvider.cs
@@ -38,14 +38,14 @@ Style GetStyle(object nativeKey, TextBlock prototype)
formsStyle.Setters.Add(Label.FontSizeProperty, prototype.FontSize);
formsStyle.Setters.Add(Label.FontFamilyProperty, prototype.FontFamily.Source);
- formsStyle.Setters.Add(Label.FontAttributesProperty, ToAttributes(prototype.FontWeight));
+ formsStyle.Setters.Add(Label.FontAttributesProperty, ToAttributes(prototype.FontWeight));
return formsStyle;
}
static FontAttributes ToAttributes(FWeight fontWeight)
{
- if (fontWeight.Weight == FontWeights.Bold.Weight || fontWeight.Weight == FontWeights.SemiBold.Weight
+ if (fontWeight.Weight == FontWeights.Bold.Weight || fontWeight.Weight == FontWeights.SemiBold.Weight
|| fontWeight.Weight == FontWeights.ExtraBold.Weight)
{
return FontAttributes.Bold;
diff --git a/src/Controls/src/Core/ContentPresenter.cs b/src/Controls/src/Core/ContentPresenter.cs
index 2dd042dca692..189e9cdf4407 100644
--- a/src/Controls/src/Core/ContentPresenter.cs
+++ b/src/Controls/src/Core/ContentPresenter.cs
@@ -99,11 +99,24 @@ static async void OnContentChanged(BindableObject bindable, object oldValue, obj
}
}
+ protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
+ {
+ DesiredSize = this.ComputeDesiredSize(widthConstraint, heightConstraint);
+ return DesiredSize;
+ }
+
Size IContentView.CrossPlatformMeasure(double widthConstraint, double heightConstraint)
{
return this.MeasureContent(widthConstraint, heightConstraint);
}
+ protected override Size ArrangeOverride(Rect bounds)
+ {
+ Frame = this.ComputeFrame(bounds);
+ Handler?.PlatformArrange(Frame);
+ return Frame.Size;
+ }
+
Size IContentView.CrossPlatformArrange(Rect bounds)
{
this.ArrangeContent(bounds);
diff --git a/src/Controls/src/Core/ContentView.cs b/src/Controls/src/Core/ContentView.cs
index ee59c4ad46f4..1c7a9705732b 100644
--- a/src/Controls/src/Core/ContentView.cs
+++ b/src/Controls/src/Core/ContentView.cs
@@ -5,7 +5,7 @@ namespace Microsoft.Maui.Controls
{
///
[ContentProperty("Content")]
- public class ContentView : TemplatedView, IContentView
+ public partial class ContentView : TemplatedView
{
///
public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(ContentView), null, propertyChanged: TemplateUtilities.OnContentChanged);
@@ -17,9 +17,6 @@ public View Content
set { SetValue(ContentProperty, value); }
}
- object IContentView.Content => Content;
- IView IContentView.PresentedContent => ((this as IControlTemplated).TemplateRoot as IView) ?? Content;
-
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
@@ -45,29 +42,5 @@ internal override void OnControlTemplateChanged(ControlTemplate oldValue, Contro
SetInheritedBindingContext(content, BindingContext);
}
}
-
- protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
- {
- DesiredSize = this.ComputeDesiredSize(widthConstraint, heightConstraint);
- return DesiredSize;
- }
-
- Size IContentView.CrossPlatformMeasure(double widthConstraint, double heightConstraint)
- {
- return this.MeasureContent(widthConstraint, heightConstraint);
- }
-
- protected override Size ArrangeOverride(Rect bounds)
- {
- Frame = this.ComputeFrame(bounds);
- Handler?.PlatformArrange(Frame);
- return Frame.Size;
- }
-
- Size IContentView.CrossPlatformArrange(Rect bounds)
- {
- this.ArrangeContent(bounds);
- return bounds.Size;
- }
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Controls.Core.csproj b/src/Controls/src/Core/Controls.Core.csproj
index 935ad4afade5..6028560330f5 100644
--- a/src/Controls/src/Core/Controls.Core.csproj
+++ b/src/Controls/src/Core/Controls.Core.csproj
@@ -5,10 +5,10 @@
Microsoft.Maui.Controls
disable
false
- <_MauiDesignDllBuild Condition=" '$(OS)' != 'Unix' And '$(MSBuildRuntimeType)' == 'Full'">True
+ <_MauiDesignDllBuild Condition=" '$(OS)' != 'Unix' ">True
high
true
- $(NoWarn);CS1591
+ $(NoWarn);CS1591;RS0041;RS0026;RS0027;RS0022
@@ -34,7 +34,7 @@
-
+
$(TargetsForTfmSpecificBuildOutput);
@@ -53,4 +53,6 @@
+
+
diff --git a/src/Core/src/Converters/FlowDirectionTypeConverter.cs b/src/Controls/src/Core/FlowDirectionConverter.cs
similarity index 93%
rename from src/Core/src/Converters/FlowDirectionTypeConverter.cs
rename to src/Controls/src/Core/FlowDirectionConverter.cs
index 7df280d741c8..664ea5b3bdc3 100644
--- a/src/Core/src/Converters/FlowDirectionTypeConverter.cs
+++ b/src/Controls/src/Core/FlowDirectionConverter.cs
@@ -3,9 +3,9 @@
using System.Globalization;
#nullable disable
-namespace Microsoft.Maui.Converters
+namespace Microsoft.Maui.Controls
{
- public class FlowDirectionTypeConverter : TypeConverter
+ public class FlowDirectionConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
=> sourceType == typeof(string);
diff --git a/src/Controls/src/Core/FlyoutPage.cs b/src/Controls/src/Core/FlyoutPage.cs
index 01be0205fa72..70ae79d3a400 100644
--- a/src/Controls/src/Core/FlyoutPage.cs
+++ b/src/Controls/src/Core/FlyoutPage.cs
@@ -211,6 +211,14 @@ protected override void OnAppearing()
base.OnAppearing();
}
+ protected override void OnDisappearing()
+ {
+ Flyout?.SendDisappearing();
+ Detail?.SendDisappearing();
+
+ base.OnDisappearing();
+ }
+
protected override bool OnBackButtonPressed()
{
if (IsPresented)
diff --git a/src/Controls/src/Core/HandlerImpl/Button/Button.Tizen.cs b/src/Controls/src/Core/HandlerImpl/Button/Button.Tizen.cs
index b5eab66e32f4..781e0f865107 100644
--- a/src/Controls/src/Core/HandlerImpl/Button/Button.Tizen.cs
+++ b/src/Controls/src/Core/HandlerImpl/Button/Button.Tizen.cs
@@ -13,6 +13,6 @@ public static void MapText(ButtonHandler handler, Button button)
}
[MissingMapper]
- public static void MapLineBreakMode(IButtonHandler handler, Button button) {}
+ public static void MapLineBreakMode(IButtonHandler handler, Button button) { }
}
}
diff --git a/src/Controls/src/Core/HandlerImpl/ContentView/ContentView.Impl.cs b/src/Controls/src/Core/HandlerImpl/ContentView/ContentView.Impl.cs
new file mode 100644
index 000000000000..46ca9922cdb9
--- /dev/null
+++ b/src/Controls/src/Core/HandlerImpl/ContentView/ContentView.Impl.cs
@@ -0,0 +1,9 @@
+namespace Microsoft.Maui.Controls
+{
+ public partial class ContentView : IContentView
+ {
+ object IContentView.Content => Content;
+
+ IView IContentView.PresentedContent => ((this as IControlTemplated).TemplateRoot as IView) ?? Content;
+ }
+}
diff --git a/src/Controls/src/Core/HandlerImpl/Editor/Editor.Tizen.cs b/src/Controls/src/Core/HandlerImpl/Editor/Editor.Tizen.cs
index c7c657b3787c..c47d9cade1c9 100644
--- a/src/Controls/src/Core/HandlerImpl/Editor/Editor.Tizen.cs
+++ b/src/Controls/src/Core/HandlerImpl/Editor/Editor.Tizen.cs
@@ -2,7 +2,7 @@
{
public partial class Editor
{
- public static void MapText(EditorHandler handler, Editor editor)
+ public static void MapText(EditorHandler handler, Editor editor)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, editor);
}
diff --git a/src/Controls/src/Core/HandlerImpl/Ellipse.Impl.cs b/src/Controls/src/Core/HandlerImpl/Ellipse.Impl.cs
index e9ed65ed0590..b15c2ee33ad5 100644
--- a/src/Controls/src/Core/HandlerImpl/Ellipse.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Ellipse.Impl.cs
@@ -11,7 +11,7 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
base.OnPropertyChanged(propertyName);
if (propertyName == XProperty.PropertyName ||
- propertyName == YProperty.PropertyName ||
+ propertyName == YProperty.PropertyName ||
propertyName == WidthProperty.PropertyName ||
propertyName == HeightProperty.PropertyName)
{
diff --git a/src/Controls/src/Core/HandlerImpl/Entry/Entry.Android.cs b/src/Controls/src/Core/HandlerImpl/Entry/Entry.Android.cs
index f04d280e01d2..2b1904cd020a 100644
--- a/src/Controls/src/Core/HandlerImpl/Entry/Entry.Android.cs
+++ b/src/Controls/src/Core/HandlerImpl/Entry/Entry.Android.cs
@@ -11,7 +11,7 @@ public static void MapImeOptions(EntryHandler handler, Entry entry)
Platform.EditTextExtensions.UpdateImeOptions(handler.PlatformView, entry);
}
- public static void MapText(EntryHandler handler, Entry entry)
+ public static void MapText(EntryHandler handler, Entry entry)
{
Platform.EditTextExtensions.UpdateText(handler.PlatformView, entry);
}
diff --git a/src/Controls/src/Core/HandlerImpl/Entry/Entry.Tizen.cs b/src/Controls/src/Core/HandlerImpl/Entry/Entry.Tizen.cs
index 7b1ed441788b..cd01ab1f9fc5 100644
--- a/src/Controls/src/Core/HandlerImpl/Entry/Entry.Tizen.cs
+++ b/src/Controls/src/Core/HandlerImpl/Entry/Entry.Tizen.cs
@@ -2,7 +2,7 @@
{
public partial class Entry
{
- public static void MapText(EntryHandler handler, Entry entry)
+ public static void MapText(EntryHandler handler, Entry entry)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, entry);
}
diff --git a/src/Controls/src/Core/HandlerImpl/Entry/Entry.iOS.cs b/src/Controls/src/Core/HandlerImpl/Entry/Entry.iOS.cs
index 8dab982b9ca1..be813143213e 100644
--- a/src/Controls/src/Core/HandlerImpl/Entry/Entry.iOS.cs
+++ b/src/Controls/src/Core/HandlerImpl/Entry/Entry.iOS.cs
@@ -12,7 +12,7 @@ public static void MapAdjustsFontSizeToFitWidth(EntryHandler handler, Entry entr
Platform.TextExtensions.UpdateAdjustsFontSizeToFitWidth(handler.PlatformView, entry);
}
- public static void MapText(EntryHandler handler, Entry entry)
+ public static void MapText(EntryHandler handler, Entry entry)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, entry);
}
diff --git a/src/Controls/src/Core/HandlerImpl/GraphicsView.Impl.cs b/src/Controls/src/Core/HandlerImpl/GraphicsView.Impl.cs
index 045b16ddc10f..7880ac5d5c8f 100644
--- a/src/Controls/src/Core/HandlerImpl/GraphicsView.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/GraphicsView.Impl.cs
@@ -34,7 +34,7 @@ public void Invalidate()
void IGraphicsView.EndHoverInteraction() => EndHoverInteraction?.Invoke(this, EventArgs.Empty);
void IGraphicsView.EndInteraction(PointF[] points, bool isInsideBounds) => EndInteraction?.Invoke(this, new TouchEventArgs(points, isInsideBounds));
-
+
void IGraphicsView.StartHoverInteraction(PointF[] points) => StartHoverInteraction?.Invoke(this, new TouchEventArgs(points, true));
void IGraphicsView.MoveHoverInteraction(PointF[] points) => MoveHoverInteraction?.Invoke(this, new TouchEventArgs(points, true));
diff --git a/src/Controls/src/Core/HandlerImpl/Label/Label.Android.cs b/src/Controls/src/Core/HandlerImpl/Label/Label.Android.cs
index b656cc54a00e..f47a982ee082 100644
--- a/src/Controls/src/Core/HandlerImpl/Label/Label.Android.cs
+++ b/src/Controls/src/Core/HandlerImpl/Label/Label.Android.cs
@@ -27,12 +27,11 @@ private protected override void OnHandlerChangedCore()
if (_mauiTextView != null)
{
_mauiTextView.LayoutChanged -= OnLayoutChanged;
- _mauiTextView.Dispose();
_mauiTextView = null;
}
}
}
-
+
public static void MapTextType(LabelHandler handler, Label label)
{
Platform.TextViewExtensions.UpdateText(handler.PlatformView, label);
@@ -43,6 +42,17 @@ public static void MapText(LabelHandler handler, Label label)
Platform.TextViewExtensions.UpdateText(handler.PlatformView, label);
}
+ // TODO: NET7 make this public
+ internal static void MapTextColor(LabelHandler handler, Label label)
+ {
+ handler.PlatformView?.UpdateTextColor(label);
+
+ if (label?.HasFormattedTextSpans ?? false)
+ return;
+
+ Platform.TextViewExtensions.UpdateText(handler.PlatformView, label);
+ }
+
public static void MapLineBreakMode(LabelHandler handler, Label label)
{
handler.PlatformView?.UpdateLineBreakMode(label);
diff --git a/src/Controls/src/Core/HandlerImpl/Label/Label.cs b/src/Controls/src/Core/HandlerImpl/Label/Label.cs
index 6bf806603686..8b12a249be2d 100644
--- a/src/Controls/src/Core/HandlerImpl/Label/Label.cs
+++ b/src/Controls/src/Core/HandlerImpl/Label/Label.cs
@@ -15,6 +15,9 @@ public partial class Label
#if WINDOWS
[PlatformConfiguration.WindowsSpecific.InputView.DetectReadingOrderFromContentProperty.PropertyName] = MapDetectReadingOrderFromContent,
#endif
+#if ANDROID
+ [nameof(TextColor)] = MapTextColor,
+#endif
#if __IOS__
[nameof(TextDecorations)] = MapTextDecorations,
[nameof(CharacterSpacing)] = MapCharacterSpacing,
diff --git a/src/Controls/src/Core/HandlerImpl/NavigationPage/NavigationPage.cs b/src/Controls/src/Core/HandlerImpl/NavigationPage/NavigationPage.cs
index 123a56ccb283..9fd8ee0a8297 100644
--- a/src/Controls/src/Core/HandlerImpl/NavigationPage/NavigationPage.cs
+++ b/src/Controls/src/Core/HandlerImpl/NavigationPage/NavigationPage.cs
@@ -2,7 +2,7 @@
{
public partial class NavigationPage
{
- public static IPropertyMapper ControlsNavigationPageMapper =
+ public static IPropertyMapper ControlsNavigationPageMapper =
new PropertyMapper(NavigationViewHandler.Mapper)
{
#if IOS
diff --git a/src/Controls/src/Core/HandlerImpl/Page.Impl.cs b/src/Controls/src/Core/HandlerImpl/Page.Impl.cs
index 656f6d7d49a7..ba9624a40f1d 100644
--- a/src/Controls/src/Core/HandlerImpl/Page.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Page.Impl.cs
@@ -7,6 +7,8 @@ namespace Microsoft.Maui.Controls
///
public partial class Page : IView, ITitledElement, IToolbarElement
{
+ internal bool HasNavigatedTo { get; private set; }
+
Paint IView.Background
{
get
@@ -40,6 +42,7 @@ internal Toolbar Toolbar
internal void SendNavigatedTo(NavigatedToEventArgs args)
{
+ HasNavigatedTo = true;
NavigatedTo?.Invoke(this, args);
OnNavigatedTo(args);
}
@@ -52,6 +55,7 @@ internal void SendNavigatingFrom(NavigatingFromEventArgs args)
internal void SendNavigatedFrom(NavigatedFromEventArgs args)
{
+ HasNavigatedTo = false;
NavigatedFrom?.Invoke(this, args);
OnNavigatedFrom(args);
}
diff --git a/src/Controls/src/Core/HandlerImpl/RadioButton/RadioButton.Impl.cs b/src/Controls/src/Core/HandlerImpl/RadioButton/RadioButton.Impl.cs
index 0feef6ac5ecf..4bfacdbe4430 100644
--- a/src/Controls/src/Core/HandlerImpl/RadioButton/RadioButton.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/RadioButton/RadioButton.Impl.cs
@@ -12,30 +12,6 @@ public partial class RadioButton : IRadioButton
object IContentView.Content => ContentAsString();
#endif
- protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
- {
- DesiredSize = this.ComputeDesiredSize(widthConstraint, heightConstraint);
- return DesiredSize;
- }
-
- Size IContentView.CrossPlatformMeasure(double widthConstraint, double heightConstraint)
- {
- return this.MeasureContent(widthConstraint, heightConstraint);
- }
-
- protected override Size ArrangeOverride(Rect bounds)
- {
- Frame = this.ComputeFrame(bounds);
- Handler?.PlatformArrange(Frame);
- return Frame.Size;
- }
-
- Size IContentView.CrossPlatformArrange(Rect bounds)
- {
- this.ArrangeContent(bounds);
- return bounds.Size;
- }
-
IView IContentView.PresentedContent => ((this as IControlTemplated).TemplateRoot as IView) ?? (Content as IView);
double IButtonStroke.StrokeThickness => (double)GetValue(BorderWidthProperty);
diff --git a/src/Controls/src/Core/HandlerImpl/ScrollView/ScrollView.Impl.cs b/src/Controls/src/Core/HandlerImpl/ScrollView/ScrollView.Impl.cs
index 159b4fa07790..9e2d887896b4 100644
--- a/src/Controls/src/Core/HandlerImpl/ScrollView/ScrollView.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/ScrollView/ScrollView.Impl.cs
@@ -1,4 +1,5 @@
using System;
+using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Layouts;
using static Microsoft.Maui.Layouts.LayoutManager;
@@ -73,8 +74,7 @@ Size IContentView.CrossPlatformMeasure(double widthConstraint, double heightCons
}
content.Measure(widthConstraint, heightConstraint);
- ContentSize = content.DesiredSize;
- return ContentSize;
+ return content.DesiredSize;
}
protected override Size ArrangeOverride(Rect bounds)
@@ -94,8 +94,8 @@ Size IContentView.CrossPlatformArrange(Rect bounds)
// Normally we'd just want the content to be arranged within the ContentView's Frame,
// but ScrollView content might be larger than the ScrollView itself (for obvious reasons)
// So in each dimension, we assume the larger of the two values.
- bounds.Width = Math.Max(Frame.Width, presentedContent.DesiredSize.Width + padding.HorizontalThickness);
- bounds.Height = Math.Max(Frame.Height, presentedContent.DesiredSize.Height + padding.VerticalThickness);
+ bounds.Width = Math.Max(bounds.Width, presentedContent.DesiredSize.Width + padding.HorizontalThickness);
+ bounds.Height = Math.Max(bounds.Height, presentedContent.DesiredSize.Height + padding.VerticalThickness);
this.ArrangeContent(bounds);
}
diff --git a/src/Controls/src/Core/HandlerImpl/SearchBar/SearchBar.Tizen.cs b/src/Controls/src/Core/HandlerImpl/SearchBar/SearchBar.Tizen.cs
index ce19b366a553..75c3c615bdf1 100644
--- a/src/Controls/src/Core/HandlerImpl/SearchBar/SearchBar.Tizen.cs
+++ b/src/Controls/src/Core/HandlerImpl/SearchBar/SearchBar.Tizen.cs
@@ -2,7 +2,7 @@
{
public partial class SearchBar
{
- public static void MapText(SearchBarHandler handler, SearchBar searchBar)
+ public static void MapText(SearchBarHandler handler, SearchBar searchBar)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, searchBar);
}
diff --git a/src/Controls/src/Core/HandlerImpl/SearchBar/SearchBar.iOS.cs b/src/Controls/src/Core/HandlerImpl/SearchBar/SearchBar.iOS.cs
index 2b96524dc05f..f49f35921aeb 100644
--- a/src/Controls/src/Core/HandlerImpl/SearchBar/SearchBar.iOS.cs
+++ b/src/Controls/src/Core/HandlerImpl/SearchBar/SearchBar.iOS.cs
@@ -7,7 +7,7 @@ public static void MapSearchBarStyle(SearchBarHandler handler, SearchBar searchB
Platform.SearchBarExtensions.UpdateSearchBarStyle(handler.PlatformView, searchBar);
}
- public static void MapText(SearchBarHandler handler, SearchBar searchBar)
+ public static void MapText(SearchBarHandler handler, SearchBar searchBar)
{
Platform.SearchBarExtensions.UpdateText(handler.PlatformView, searchBar);
}
diff --git a/src/Controls/src/Core/HandlerImpl/Shell.Impl.cs b/src/Controls/src/Core/HandlerImpl/Shell.Impl.cs
index a4f2528c5074..ada29875c1ef 100644
--- a/src/Controls/src/Core/HandlerImpl/Shell.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Shell.Impl.cs
@@ -28,5 +28,14 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
if (propertyName == Shell.FlyoutIsPresentedProperty.PropertyName)
Handler?.UpdateValue(nameof(IFlyoutView.IsPresented));
}
+
+#if ANDROID
+ protected override void OnHandlerChanging(HandlerChangingEventArgs args)
+ {
+ base.OnHandlerChanging(args);
+ args.OldHandler?.DisconnectHandler();
+ }
+
+#endif
}
}
diff --git a/src/Controls/src/Core/HandlerImpl/TemplatedView/TemplatedView.Impl.cs b/src/Controls/src/Core/HandlerImpl/TemplatedView/TemplatedView.Impl.cs
new file mode 100644
index 000000000000..9ad2a42fc041
--- /dev/null
+++ b/src/Controls/src/Core/HandlerImpl/TemplatedView/TemplatedView.Impl.cs
@@ -0,0 +1,43 @@
+#nullable enable
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Layouts;
+
+namespace Microsoft.Maui.Controls
+{
+ public partial class TemplatedView : IContentView
+ {
+ object? IContentView.Content => null;
+
+ IView? IContentView.PresentedContent =>
+ (this as IControlTemplated).TemplateRoot as IView;
+
+ partial void OnApplyTemplateImpl()
+ {
+ Handler?.UpdateValue(nameof(IContentView.Content));
+ }
+
+ protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
+ {
+ DesiredSize = this.ComputeDesiredSize(widthConstraint, heightConstraint);
+ return DesiredSize;
+ }
+
+ Size IContentView.CrossPlatformMeasure(double widthConstraint, double heightConstraint)
+ {
+ return this.MeasureContent(widthConstraint, heightConstraint);
+ }
+
+ protected override Size ArrangeOverride(Rect bounds)
+ {
+ Frame = this.ComputeFrame(bounds);
+ Handler?.PlatformArrange(Frame);
+ return Frame.Size;
+ }
+
+ Size IContentView.CrossPlatformArrange(Rect bounds)
+ {
+ this.ArrangeContent(bounds);
+ return bounds.Size;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/Toolbar/Toolbar.Android.cs b/src/Controls/src/Core/HandlerImpl/Toolbar/Toolbar.Android.cs
index 2f67a5ff3aad..c699c88cf564 100644
--- a/src/Controls/src/Core/HandlerImpl/Toolbar/Toolbar.Android.cs
+++ b/src/Controls/src/Core/HandlerImpl/Toolbar/Toolbar.Android.cs
@@ -9,8 +9,8 @@
using Google.Android.Material.AppBar;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Handlers;
-using LP = Android.Views.ViewGroup.LayoutParams;
using AToolbar = AndroidX.AppCompat.Widget.Toolbar;
+using LP = Android.Views.ViewGroup.LayoutParams;
namespace Microsoft.Maui.Controls
{
@@ -37,7 +37,7 @@ partial void OnHandlerChanging(IElementHandler oldHandler, IElementHandler newHa
Controls.Platform.ToolbarExtensions.DisposeMenuItems(
oldHandler?.PlatformView as AToolbar,
- ToolbarItems,
+ ToolbarItems,
OnToolbarItemPropertyChanged);
}
}
diff --git a/src/Controls/src/Core/HandlerImpl/VisualElement/VisualElement.Impl.cs b/src/Controls/src/Core/HandlerImpl/VisualElement/VisualElement.Impl.cs
index 1db38959c549..0378265aed8f 100644
--- a/src/Controls/src/Core/HandlerImpl/VisualElement/VisualElement.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/VisualElement/VisualElement.Impl.cs
@@ -204,7 +204,7 @@ double IView.Width
{
return Primitives.Dimension.Unset;
}
-
+
ValidatePositive(value, nameof(IView.Width));
return value;
}
@@ -226,7 +226,7 @@ double IView.Height
{
return Primitives.Dimension.Unset;
}
-
+
ValidatePositive(value, nameof(IView.Height));
return value;
}
@@ -324,6 +324,12 @@ void OnShadowChanged(object? sender, PropertyChangedEventArgs e)
OnPropertyChanged(nameof(Shadow));
}
+ void PropagateBindingContextToBrush()
+ {
+ if (Background != null)
+ SetInheritedBindingContext(Background, BindingContext);
+ }
+
void PropagateBindingContextToShadow()
{
if (Shadow != null)
diff --git a/src/Controls/src/Core/HandlerImpl/VisualElement/VisualElement.Windows.cs b/src/Controls/src/Core/HandlerImpl/VisualElement/VisualElement.Windows.cs
index 8758328bf145..b24692fa3a22 100644
--- a/src/Controls/src/Core/HandlerImpl/VisualElement/VisualElement.Windows.cs
+++ b/src/Controls/src/Core/HandlerImpl/VisualElement/VisualElement.Windows.cs
@@ -7,13 +7,13 @@ public partial class VisualElement
{
public static void MapAccessKeyHorizontalOffset(IViewHandler handler, IView view) =>
Platform.VisualElementExtensions.UpdateAccessKey((PlatformView)handler.PlatformView, view);
-
+
public static void MapAccessKeyPlacement(IViewHandler handler, IView view) =>
Platform.VisualElementExtensions.UpdateAccessKey((PlatformView)handler.PlatformView, view);
-
+
public static void MapAccessKey(IViewHandler handler, IView view) =>
Platform.VisualElementExtensions.UpdateAccessKey((PlatformView)handler.PlatformView, view);
-
+
public static void MapAccessKeyVerticalOffset(IViewHandler handler, IView view) =>
Platform.VisualElementExtensions.UpdateAccessKey((PlatformView)handler.PlatformView, view);
}
diff --git a/src/Controls/src/Core/HandlerImpl/Window/Window.Android.cs b/src/Controls/src/Core/HandlerImpl/Window/Window.Android.cs
index 0d8985988794..80d1484d422e 100644
--- a/src/Controls/src/Core/HandlerImpl/Window/Window.Android.cs
+++ b/src/Controls/src/Core/HandlerImpl/Window/Window.Android.cs
@@ -12,19 +12,9 @@ public partial class Window
internal Activity PlatformActivity =>
(Handler?.PlatformView as Activity) ?? throw new InvalidOperationException("Window should have an Activity set.");
+ [Obsolete]
public static void MapContent(WindowHandler handler, IWindow view)
{
- if (view.Content is not Shell)
- {
- WindowHandler.MapContent(handler, view);
- return;
- }
-
- var nativeContent = view.Content.ToContainerView(handler.MauiContext!);
- handler.PlatformView.SetContentView(nativeContent);
-
- if (view is Window w)
- handler?.UpdateValue(nameof(IToolbarElement.Toolbar));
}
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/HandlerImpl/Window/Window.Impl.cs b/src/Controls/src/Core/HandlerImpl/Window/Window.Impl.cs
index 87910636db8a..26885ca6211a 100644
--- a/src/Controls/src/Core/HandlerImpl/Window/Window.Impl.cs
+++ b/src/Controls/src/Core/HandlerImpl/Window/Window.Impl.cs
@@ -30,6 +30,7 @@ public partial class Window : NavigableElement, IWindow, IVisualTreeElement, ITo
List _visualChildren;
Toolbar? _toolbar;
MenuBarTracker _menuBarTracker;
+ bool _isActivated;
IToolbar? IToolbarElement.Toolbar => Toolbar;
internal Toolbar? Toolbar
@@ -161,7 +162,25 @@ public bool RemoveOverlay(IWindowOverlay overlay)
internal IMauiContext MauiContext =>
Handler?.MauiContext ?? throw new InvalidOperationException("MauiContext is null.");
- internal bool IsActivated { get; private set; }
+ internal bool IsActivated
+ {
+ get
+ {
+ return _isActivated;
+ }
+ private set
+ {
+ if (_isActivated == value)
+ return;
+
+ _isActivated = value;
+
+ if (value)
+ SendWindowAppearing();
+ else
+ SendWindowDisppearing();
+ }
+ }
IFlowDirectionController FlowController => this;
@@ -259,6 +278,11 @@ void SendWindowAppearing()
Page?.SendAppearing();
}
+ void SendWindowDisppearing()
+ {
+ Page?.SendDisappearing();
+ }
+
void OnModalPopped(Page modalPage)
{
int index = _visualChildren.IndexOf(modalPage);
@@ -406,6 +430,9 @@ static void OnPageChanging(BindableObject bindable, object oldValue, object newV
if (bindable is not Window window)
return;
+ if (oldValue is Page oldPage)
+ oldPage.SendDisappearing();
+
if (newValue is IToolbarElement toolbarElement &&
toolbarElement.Toolbar is Toolbar tb &&
newValue is not Shell)
diff --git a/src/Controls/src/Core/HandlerImpl/Window/Window.cs b/src/Controls/src/Core/HandlerImpl/Window/Window.cs
index 91d6b81becc0..dd61c7b4f7bc 100644
--- a/src/Controls/src/Core/HandlerImpl/Window/Window.cs
+++ b/src/Controls/src/Core/HandlerImpl/Window/Window.cs
@@ -5,9 +5,7 @@ namespace Microsoft.Maui.Controls
{
public partial class Window
{
- public static IPropertyMapper ControlsWindowMapper = new PropertyMapper(WindowHandler.Mapper)
- {
- };
+ public static IPropertyMapper ControlsWindowMapper = new PropertyMapper(WindowHandler.Mapper);
internal static void RemapForControls()
{
diff --git a/src/Controls/src/Core/Handlers/Items/Android/Adapters/SelectableItemsViewAdapter.cs b/src/Controls/src/Core/Handlers/Items/Android/Adapters/SelectableItemsViewAdapter.cs
index f94f9c328b63..0c66205ba662 100644
--- a/src/Controls/src/Core/Handlers/Items/Android/Adapters/SelectableItemsViewAdapter.cs
+++ b/src/Controls/src/Core/Handlers/Items/Android/Adapters/SelectableItemsViewAdapter.cs
@@ -136,7 +136,6 @@ void UpdateMauiSelection(int adapterPosition)
return;
case SelectionMode.Single:
ItemsView.SelectedItem = ItemsSource.GetItem(adapterPosition);
- RefreshViewHolderSelection();
return;
case SelectionMode.Multiple:
var item = ItemsSource.GetItem(adapterPosition);
@@ -150,17 +149,8 @@ void UpdateMauiSelection(int adapterPosition)
{
selectedItems.Add(item);
}
- RefreshViewHolderSelection();
return;
}
-
- void RefreshViewHolderSelection()
- {
- for (int position = 0; position < _currentViewHolders.Count; position++)
- {
- _currentViewHolders[position].IsSelected = PositionIsSelected(position);
- }
- }
}
}
}
diff --git a/src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs b/src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs
index c3050dfb74f2..669f790a0e18 100644
--- a/src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs
+++ b/src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs
@@ -114,14 +114,14 @@ public override void UpdateAdapter()
// So we give it an alternate delegate for creating the views
var oldItemViewAdapter = ItemsViewAdapter;
-
+
if (oldItemViewAdapter != null)
{
UnsubscribeCollectionItemsSourceChanged(oldItemViewAdapter);
ItemsView.SetValueFromRenderer(CarouselView.PositionProperty, 0);
ItemsView.SetValueFromRenderer(CarouselView.CurrentItemProperty, null);
}
-
+
_gotoPosition = -1;
base.UpdateAdapter();
diff --git a/src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs b/src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs
index b317bcb74825..c2825678e200 100644
--- a/src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs
+++ b/src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs
@@ -544,6 +544,7 @@ internal void UpdateEmptyViewVisibility()
// TODO hartez 2018/10/24 17:34:36 If this works, cache this layout manager as _emptyLayoutManager
SetLayoutManager(new LinearLayoutManager(Context));
+ UpdateEmptyView();
}
else if (!showEmptyView && currentAdapter != ItemsViewAdapter)
{
diff --git a/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs b/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs
index f41ef3dffdb0..1116b0736b69 100644
--- a/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs
+++ b/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs
@@ -30,7 +30,7 @@ protected override void ConnectHandler(ListViewBase platformView)
{
ItemsView.Scrolled -= CarouselScrolled;
ListViewBase.SizeChanged += InitialSetup;
-
+
UpdateScrollBarVisibilityForLoop();
base.ConnectHandler(platformView);
@@ -196,7 +196,7 @@ public static void MapPeekAreaInsets(CarouselViewHandler handler, CarouselView c
handler.UpdatePeekAreaInsets();
}
- public static void MapLoop(CarouselViewHandler handler, CarouselView carouselView)
+ public static void MapLoop(CarouselViewHandler handler, CarouselView carouselView)
{
handler.UpdateLoop();
}
diff --git a/src/Controls/src/Core/Handlers/Items/CollectionViewHandler.Windows.cs b/src/Controls/src/Core/Handlers/Items/CollectionViewHandler.Windows.cs
index f4cae5dea190..3f1f6377a25f 100644
--- a/src/Controls/src/Core/Handlers/Items/CollectionViewHandler.Windows.cs
+++ b/src/Controls/src/Core/Handlers/Items/CollectionViewHandler.Windows.cs
@@ -8,6 +8,6 @@ namespace Microsoft.Maui.Controls.Handlers.Items
{
public partial class CollectionViewHandler : ReorderableItemsViewHandler
{
-
+
}
}
diff --git a/src/Controls/src/Core/Handlers/Items/CollectionViewHandler.cs b/src/Controls/src/Core/Handlers/Items/CollectionViewHandler.cs
index e303512f4dee..f6b1e0e17a77 100644
--- a/src/Controls/src/Core/Handlers/Items/CollectionViewHandler.cs
+++ b/src/Controls/src/Core/Handlers/Items/CollectionViewHandler.cs
@@ -31,11 +31,11 @@ public CollectionViewHandler(PropertyMapper mapper = null) : base(mapper ?? Mapp
[StructuredItemsView.FooterTemplateProperty.PropertyName] = MapFooterTemplate,
[StructuredItemsView.ItemsLayoutProperty.PropertyName] = MapItemsLayout,
[StructuredItemsView.ItemSizingStrategyProperty.PropertyName] = MapItemSizingStrategy,
- //[SelectableItemsView.SelectedItemProperty.PropertyName] = MapSelectedItem,
- //[SelectableItemsView.SelectedItemsProperty.PropertyName] = MapSelectedItems,
- //[SelectableItemsView.SelectionModeProperty.PropertyName] = MapSelectionMode,
- //[GroupableItemsView.IsGroupedProperty.PropertyName] = MapIsGrouped
- [ReorderableItemsView.IsGroupedProperty.PropertyName] = MapCanReorderItems
+ [SelectableItemsView.SelectedItemProperty.PropertyName] = MapSelectedItem,
+ [SelectableItemsView.SelectedItemsProperty.PropertyName] = MapSelectedItems,
+ [SelectableItemsView.SelectionModeProperty.PropertyName] = MapSelectionMode,
+ [GroupableItemsView.IsGroupedProperty.PropertyName] = MapIsGrouped,
+ [ReorderableItemsView.CanReorderItemsProperty.PropertyName] = MapCanReorderItems
};
}
}
diff --git a/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs b/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs
index 95644b1d7b19..1867990ca012 100644
--- a/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs
+++ b/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs
@@ -20,7 +20,7 @@
namespace Microsoft.Maui.Controls.Handlers.Items
{
- public abstract partial class ItemsViewHandler : ViewHandler where TItemsView : ItemsView
+ public abstract partial class ItemsViewHandler : ViewHandler where TItemsView : ItemsView
{
protected CollectionViewSource CollectionViewSource;
ScrollViewer _scrollViewer;
@@ -58,7 +58,7 @@ protected override void DisconnectHandler(ListViewBase platformView)
base.DisconnectHandler(platformView);
}
- public static void MapItemsSource(ItemsViewHandler handler, ItemsView itemsView)
+ public static void MapItemsSource(ItemsViewHandler handler, ItemsView itemsView)
{
handler.UpdateItemsSource();
}
@@ -100,7 +100,7 @@ public static void MapIsVisible(ItemsViewHandler handler, ItemsView
public static void MapItemsUpdatingScrollMode(ItemsViewHandler handler, ItemsView itemsView)
{
-
+
}
protected abstract ListViewBase SelectListViewBase();
diff --git a/src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Windows.cs b/src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Windows.cs
index fe5b721cd9af..e088961aaeb2 100644
--- a/src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Windows.cs
+++ b/src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Windows.cs
@@ -32,7 +32,7 @@ public static void MapItemsLayout(StructuredItemsViewHandler handler
public static void MapItemSizingStrategy(StructuredItemsViewHandler handler, StructuredItemsView itemsView)
{
-
+
}
protected override ListViewBase SelectListViewBase()
diff --git a/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs b/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs
index 01721a1168a7..9ea7c84f3f9c 100644
--- a/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs
+++ b/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs
@@ -137,7 +137,7 @@ public override void ViewDidLoad()
if (!(OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsTvOSVersionAtLeast(11)))
{
AutomaticallyAdjustsScrollViewInsets = false;
- }
+ }
else
{
// We set this property to keep iOS from trying to be helpful about insetting all the
diff --git a/src/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cs b/src/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cs
index 3c08fe600134..915c37e954a7 100644
--- a/src/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cs
+++ b/src/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cs
@@ -1,4 +1,5 @@
using System;
+using System.ComponentModel;
using CoreGraphics;
using Foundation;
using Microsoft.Maui.Controls.Internals;
@@ -93,6 +94,24 @@ CGSize UpdateCellSize()
return size;
}
+ [Obsolete]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected void Layout(CGSize constraints)
+ {
+ var platformView = PlatformHandler.ToPlatform();
+
+ var width = constraints.Width;
+ var height = constraints.Height;
+
+ PlatformHandler.VirtualView.Measure(width, height);
+
+ platformView.Frame = new CGRect(0, 0, width, height);
+
+ var rectangle = platformView.Frame.ToRectangle();
+ PlatformHandler.VirtualView.Arrange(rectangle);
+ _size = rectangle.Size;
+ }
+
public void Bind(DataTemplate template, object bindingContext, ItemsView itemsView)
{
var oldElement = PlatformHandler?.VirtualView as View;
@@ -177,22 +196,6 @@ void SetRenderer(IPlatformViewHandler renderer)
(renderer.VirtualView as View).MeasureInvalidated += MeasureInvalidated;
}
- protected void Layout(CGSize constraints)
- {
- var platformView = PlatformHandler.ToPlatform();
-
- var width = constraints.Width;
- var height = constraints.Height;
-
- PlatformHandler.VirtualView.Measure(width, height);
-
- platformView.Frame = new CGRect(0, 0, width, height);
-
- var rectangle = platformView.Frame.ToRectangle();
- PlatformHandler.VirtualView.Arrange(rectangle);
- _size = rectangle.Size;
- }
-
void ClearSubviews()
{
for (int n = ContentView.Subviews.Length - 1; n >= 0; n--)
diff --git a/src/Controls/src/Core/Handlers/Shapes/Line/LineHandler.Tizen.cs b/src/Controls/src/Core/Handlers/Shapes/Line/LineHandler.Tizen.cs
index 1494179e4bdd..c946a36c5ee4 100644
--- a/src/Controls/src/Core/Handlers/Shapes/Line/LineHandler.Tizen.cs
+++ b/src/Controls/src/Core/Handlers/Shapes/Line/LineHandler.Tizen.cs
@@ -2,7 +2,7 @@
namespace Microsoft.Maui.Controls.Handlers
{
- public partial class LineHandler
+ public partial class LineHandler
{
public static void MapX1(IShapeViewHandler handler, Line line)
{
diff --git a/src/Controls/src/Core/Handlers/Shapes/Line/LineHandler.Windows.cs b/src/Controls/src/Core/Handlers/Shapes/Line/LineHandler.Windows.cs
index c516f57a8f2a..e53c2d6799cb 100644
--- a/src/Controls/src/Core/Handlers/Shapes/Line/LineHandler.Windows.cs
+++ b/src/Controls/src/Core/Handlers/Shapes/Line/LineHandler.Windows.cs
@@ -3,7 +3,7 @@
namespace Microsoft.Maui.Controls.Handlers
{
- public partial class LineHandler
+ public partial class LineHandler
{
public static void MapX1(IShapeViewHandler handler, Line line)
{
diff --git a/src/Controls/src/Core/Handlers/Shapes/Path/PathHandler.Tizen.cs b/src/Controls/src/Core/Handlers/Shapes/Path/PathHandler.Tizen.cs
index f4ef45d6d524..9becec1401db 100644
--- a/src/Controls/src/Core/Handlers/Shapes/Path/PathHandler.Tizen.cs
+++ b/src/Controls/src/Core/Handlers/Shapes/Path/PathHandler.Tizen.cs
@@ -2,7 +2,7 @@
namespace Microsoft.Maui.Controls.Handlers
{
- public partial class PathHandler
+ public partial class PathHandler
{
public static void MapData(IShapeViewHandler handler, Path path)
{
diff --git a/src/Controls/src/Core/Handlers/Shapes/Rectangle/RectangleHandler.Windows.cs b/src/Controls/src/Core/Handlers/Shapes/Rectangle/RectangleHandler.Windows.cs
index 8c9eea951003..ced3c8e08aca 100644
--- a/src/Controls/src/Core/Handlers/Shapes/Rectangle/RectangleHandler.Windows.cs
+++ b/src/Controls/src/Core/Handlers/Shapes/Rectangle/RectangleHandler.Windows.cs
@@ -3,7 +3,7 @@
namespace Microsoft.Maui.Controls.Handlers
{
public partial class RectangleHandler
- {
+ {
public static void MapRadiusX(IShapeViewHandler handler, Rectangle rectangle)
{
handler.PlatformView?.InvalidateShape(rectangle);
diff --git a/src/Controls/src/Core/Handlers/Shell/ShellHandler.Windows.cs b/src/Controls/src/Core/Handlers/Shell/ShellHandler.Windows.cs
index d2cbb53ae59e..952a60fb8896 100644
--- a/src/Controls/src/Core/Handlers/Shell/ShellHandler.Windows.cs
+++ b/src/Controls/src/Core/Handlers/Shell/ShellHandler.Windows.cs
@@ -131,7 +131,7 @@ public static void MapFlyout(ShellHandler handler, IFlyoutView flyoutView)
rnv.FlyoutView = flyoutView.Flyout;
handler.PlatformView.FlyoutCustomContent = flyoutView.Flyout?.ToPlatform(handler.MauiContext);
-
+
}
public static void MapIsPresented(ShellHandler handler, IFlyoutView flyoutView)
diff --git a/src/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutTemplateSelector.cs b/src/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutTemplateSelector.cs
index ff0a1c764fca..60ea13def267 100644
--- a/src/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutTemplateSelector.cs
+++ b/src/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutTemplateSelector.cs
@@ -25,10 +25,10 @@ protected override Microsoft.UI.Xaml.DataTemplate SelectTemplateCore(object item
{
if (item is MenuFlyoutSeparator)
return SeperatorTemplate;
-
+
if (item is MenuItem)
return MenuItemTemplate;
-
+
return BaseShellItemTemplate;
}
}
diff --git a/src/Controls/src/Core/Handlers/Shell/Windows/ShellFooterView.cs b/src/Controls/src/Core/Handlers/Shell/Windows/ShellFooterView.cs
index a5bf36706ca7..a95bfdbd86cd 100644
--- a/src/Controls/src/Core/Handlers/Shell/Windows/ShellFooterView.cs
+++ b/src/Controls/src/Core/Handlers/Shell/Windows/ShellFooterView.cs
@@ -28,10 +28,10 @@ void OnShellFooterViewSizeChanged(object sender, SizeChangedEventArgs e)
public void SetElement(Shell shell)
{
- if(_shell != null)
+ if (_shell != null)
_shell.PropertyChanged -= OnShellPropertyChanged;
- if(shell != null)
+ if (shell != null)
{
_shell = shell;
_shell.PropertyChanged += OnShellPropertyChanged;
@@ -41,7 +41,7 @@ public void SetElement(Shell shell)
void OnShellPropertyChanged(object sender, PropertyChangedEventArgs e)
{
- if(e.IsOneOf(Shell.FlyoutFooterProperty, Shell.FlyoutFooterTemplateProperty))
+ if (e.IsOneOf(Shell.FlyoutFooterProperty, Shell.FlyoutFooterTemplateProperty))
UpdateFooter();
}
@@ -49,7 +49,7 @@ void UpdateFooter()
{
if (Element != null)
{
- if(Content is ViewToHandlerConverter.WrapperControl wrapperControl)
+ if (Content is ViewToHandlerConverter.WrapperControl wrapperControl)
{
wrapperControl.CleanUp();
Content = null;
diff --git a/src/Controls/src/Core/Handlers/Shell/Windows/ShellHeaderView.cs b/src/Controls/src/Core/Handlers/Shell/Windows/ShellHeaderView.cs
index 6ddb9e4297c8..5d685c38c0b6 100644
--- a/src/Controls/src/Core/Handlers/Shell/Windows/ShellHeaderView.cs
+++ b/src/Controls/src/Core/Handlers/Shell/Windows/ShellHeaderView.cs
@@ -25,10 +25,10 @@ void OnShellHeaderViewSizeChanged(object sender, SizeChangedEventArgs e)
public void SetElement(Shell shell)
{
- if(_shell != null)
+ if (_shell != null)
_shell.PropertyChanged -= OnShellPropertyChanged;
- if(shell != null)
+ if (shell != null)
{
_shell = shell;
_shell.PropertyChanged += OnShellPropertyChanged;
@@ -38,7 +38,7 @@ public void SetElement(Shell shell)
void OnShellPropertyChanged(object sender, PropertyChangedEventArgs e)
{
- if(e.IsOneOf(Shell.FlyoutHeaderProperty, Shell.FlyoutHeaderTemplateProperty))
+ if (e.IsOneOf(Shell.FlyoutHeaderProperty, Shell.FlyoutHeaderTemplateProperty))
UpdateHeader();
}
@@ -46,7 +46,7 @@ void UpdateHeader()
{
if (Element != null)
{
- if(Content is ViewToHandlerConverter.WrapperControl wrapperControl)
+ if (Content is ViewToHandlerConverter.WrapperControl wrapperControl)
{
wrapperControl.CleanUp();
Content = null;
diff --git a/src/Controls/src/Core/Handlers/Shell/Windows/ShellSplitView.cs b/src/Controls/src/Core/Handlers/Shell/Windows/ShellSplitView.cs
index 306c2ba4c105..2a378cbe3c94 100644
--- a/src/Controls/src/Core/Handlers/Shell/Windows/ShellSplitView.cs
+++ b/src/Controls/src/Core/Handlers/Shell/Windows/ShellSplitView.cs
@@ -67,14 +67,14 @@ internal void RefreshFlyoutBackdrop()
{
// Because shell is currently Nesting Navigation Views we have to be careful and make sure to retrive the correct one
// If we just do a straight search for "LightDismissLayer it will return the wrong one.
- if(_dismissLayer == null)
+ if (_dismissLayer == null)
{
var contentRoot = _splitView.GetDescendantByName("ContentRoot");
- if(contentRoot != null)
+ if (contentRoot != null)
{
- foreach(var child in contentRoot.Children)
+ foreach (var child in contentRoot.Children)
{
- if(child is WRectangle maybe &&
+ if (child is WRectangle maybe &&
$"{child.GetValue(FrameworkElement.NameProperty)}" == "LightDismissLayer")
{
_dismissLayer = maybe;
@@ -83,7 +83,7 @@ internal void RefreshFlyoutBackdrop()
}
}
}
-
+
if (_dismissLayer == null)
return;
diff --git a/src/Controls/src/Core/Handlers/Shell/Windows/ShellToolbarItemView.cs b/src/Controls/src/Core/Handlers/Shell/Windows/ShellToolbarItemView.cs
index 148d10d85bb0..32758cfcdfed 100644
--- a/src/Controls/src/Core/Handlers/Shell/Windows/ShellToolbarItemView.cs
+++ b/src/Controls/src/Core/Handlers/Shell/Windows/ShellToolbarItemView.cs
@@ -41,7 +41,7 @@ public ToolbarItem ToolbarItem
void ToolbarItemChanged(ToolbarItem oldItem, ToolbarItem newItem)
{
- if(oldItem != null)
+ if (oldItem != null)
oldItem.PropertyChanged -= ToolbarItemPropertyChanged;
// TODO MAUI
diff --git a/src/Controls/src/Core/Handlers/Shell/Windows/ViewToHandlerConverter.cs b/src/Controls/src/Core/Handlers/Shell/Windows/ViewToHandlerConverter.cs
index e8652e0d9071..135f1c245008 100644
--- a/src/Controls/src/Core/Handlers/Shell/Windows/ViewToHandlerConverter.cs
+++ b/src/Controls/src/Core/Handlers/Shell/Windows/ViewToHandlerConverter.cs
@@ -45,7 +45,7 @@ internal void CleanUp()
{
_view?.Cleanup();
- if(_view != null)
+ if (_view != null)
_view.MeasureInvalidated -= OnMeasureInvalidated;
}
@@ -58,7 +58,7 @@ public WrapperControl(View view)
Children.Add(FrameworkElement);
// make sure we re-measure once the template is applied
-
+
FrameworkElement.Loaded += (sender, args) =>
{
// If the view is a layout (stacklayout, grid, etc) we need to trigger a layout pass
@@ -77,7 +77,7 @@ void OnMeasureInvalidated(object? sender, EventArgs e)
protected override WSize ArrangeOverride(WSize finalSize)
{
_view.IsInPlatformLayout = true;
- (_view.Handler as IPlatformViewHandler)?.LayoutVirtualView(finalSize);
+ (_view.Handler as IPlatformViewHandler)?.LayoutVirtualView(finalSize);
if (_view.Width <= 0 || _view.Height <= 0)
{
diff --git a/src/Controls/src/Core/Interactivity/PlatformBehavior.cs b/src/Controls/src/Core/Interactivity/PlatformBehavior.cs
index 72ed87e04cfe..99879ec7ba6b 100644
--- a/src/Controls/src/Core/Interactivity/PlatformBehavior.cs
+++ b/src/Controls/src/Core/Interactivity/PlatformBehavior.cs
@@ -10,7 +10,7 @@
using PlatformView = Microsoft.UI.Xaml.FrameworkElement;
#elif TIZEN
using PlatformView = ElmSharp.EvasObject;
-#elif NET6_0 || (NETSTANDARD || !PLATFORM)
+#elif NET6_0_OR_GREATER || (NETSTANDARD || !PLATFORM)
using PlatformView = System.Object;
#endif
diff --git a/src/Controls/src/Core/Layout/FlexLayout.cs b/src/Controls/src/Core/Layout/FlexLayout.cs
index e1796064c303..19a4f841530c 100644
--- a/src/Controls/src/Core/Layout/FlexLayout.cs
+++ b/src/Controls/src/Core/Layout/FlexLayout.cs
@@ -460,10 +460,9 @@ void InitItemProperties(IView view, Flex.Item item)
item.Height = height < 0 ? float.NaN : (float)height;
item.IsVisible = GetIsVisible(view);
- // TODO ezhart The Core layout interfaces don't have the padding property yet; when that's available, we should add a check for it here
- if (view is FlexLayout && view is Controls.Layout layout)
+ if (view is IPadding viewWithPadding)
{
- var (pleft, ptop, pright, pbottom) = (Thickness)layout.GetValue(Compatibility.Layout.PaddingProperty);
+ var (pleft, ptop, pright, pbottom) = viewWithPadding.Padding;
item.PaddingLeft = (float)pleft;
item.PaddingTop = (float)ptop;
item.PaddingRight = (float)pright;
@@ -471,19 +470,49 @@ void InitItemProperties(IView view, Flex.Item item)
}
}
+ // Until we can rewrite the FlexLayout engine to handle measurement properly (without the "in measure mode" hacks)
+ // we need to replace the default implementation of CrossPlatformMeasure.
+ // And we need to disable the public API analyzer briefly, because it doesn't understand hiding.
+#pragma warning disable RS0016 // Add public types and members to the declared API
+ new public Graphics.Size CrossPlatformMeasure(double widthConstraint, double heightConstraint)
+#pragma warning restore RS0016 // Add public types and members to the declared API
+ {
+ var layoutManager = _layoutManager ??= CreateLayoutManager();
+
+ InMeasureMode = true;
+ var result = layoutManager.Measure(widthConstraint, heightConstraint);
+ InMeasureMode = false;
+
+ return result;
+ }
+
+ internal bool InMeasureMode { get; set; }
+
void AddFlexItem(IView child)
{
if (_root == null)
return;
var item = (child as FlexLayout)?._root ?? new Flex.Item();
InitItemProperties(child, item);
- if (!(child is FlexLayout))
- { //inner layouts don't get measured
+ if (child is not FlexLayout)
+ {
item.SelfSizing = (Flex.Item it, ref float w, ref float h) =>
{
var sizeConstraints = item.GetConstraints();
- sizeConstraints.Width = (sizeConstraints.Width == 0) ? double.PositiveInfinity : sizeConstraints.Width;
- sizeConstraints.Height = (sizeConstraints.Height == 0) ? double.PositiveInfinity : sizeConstraints.Height;
+
+ sizeConstraints.Width = (InMeasureMode && sizeConstraints.Width == 0) ? double.PositiveInfinity : sizeConstraints.Width;
+ sizeConstraints.Height = (InMeasureMode && sizeConstraints.Height == 0) ? double.PositiveInfinity : sizeConstraints.Height;
+
+ if (child is Image)
+ {
+ // This is a hack to get FlexLayout to behave like it did in Forms
+ // Forms always did its initial image measure unconstrained, which would return
+ // the intrinsic size of the image (no scaling or aspect ratio adjustments)
+
+ sizeConstraints.Width = double.PositiveInfinity;
+ sizeConstraints.Height = double.PositiveInfinity;
+ }
+
var request = child.Measure(sizeConstraints.Width, sizeConstraints.Height);
w = (float)request.Width;
h = (float)request.Height;
@@ -528,14 +557,39 @@ public Graphics.Rect GetFlexFrame(IView view)
};
}
+ void EnsureFlexItemPropertiesUpdated()
+ {
+ for (int n = 0; n < this.Count; n++)
+ {
+ var child = this[n];
+ var flexItem = GetFlexItem(child);
+
+ InitItemProperties(child, flexItem);
+ }
+ }
+
///
public void Layout(double width, double height)
{
if (_root.Parent != null) //Layout is only computed at root level
return;
+
+ var useMeasureHack = NeedsMeasureHack(width, height);
+ if (useMeasureHack)
+ {
+ PrepareMeasureHack();
+ }
+
+ EnsureFlexItemPropertiesUpdated();
+
_root.Width = !double.IsPositiveInfinity((width)) ? (float)width : 0;
_root.Height = !double.IsPositiveInfinity((height)) ? (float)height : 0;
_root.Layout();
+
+ if (useMeasureHack)
+ {
+ RestoreValues();
+ }
}
protected override void OnParentSet()
@@ -602,31 +656,12 @@ protected override void OnClear()
PopulateLayout();
}
- protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
- {
- var useMeasureHack = NeedsMeasureHack(widthConstraint, heightConstraint);
-
- if (useMeasureHack)
- {
- PrepareMeasureHack();
- }
-
- var result = base.MeasureOverride(widthConstraint, heightConstraint);
-
- if (useMeasureHack)
- {
- RestoreValues();
- }
-
- return result;
- }
-
- static bool NeedsMeasureHack(double widthConstraint, double heightConstraint)
+ static bool NeedsMeasureHack(double widthConstraint, double heightConstraint)
{
return double.IsInfinity(widthConstraint) || double.IsInfinity(heightConstraint);
}
- void PrepareMeasureHack()
+ void PrepareMeasureHack()
{
// FlexLayout's Shrink and Stretch features require a fixed area to measure/layout correctly;
// when the dimensions they are working in are infinite, they don't really make sense. We can
@@ -643,7 +678,7 @@ void PrepareMeasureHack()
}
}
- void RestoreValues()
+ void RestoreValues()
{
// If we had to modify the Shrink and Stretch values of the FlexItems for measurement, we
// restore them to their original values.
@@ -653,7 +688,7 @@ void RestoreValues()
if (GetFlexItem(child) is Flex.Item item)
{
item.Shrink = GetShrink(child);
- item.AlignSelf = (Flex.AlignSelf)GetAlignSelf(child);
+ item.AlignSelf = (Flex.AlignSelf)GetAlignSelf(child);
}
}
}
diff --git a/src/Controls/src/Core/Platform/AlertManager/AlertManager.Windows.cs b/src/Controls/src/Core/Platform/AlertManager/AlertManager.Windows.cs
index 04760c012ce3..fe1a0bcdc0f4 100644
--- a/src/Controls/src/Core/Platform/AlertManager/AlertManager.Windows.cs
+++ b/src/Controls/src/Core/Platform/AlertManager/AlertManager.Windows.cs
@@ -171,7 +171,7 @@ void OnActionSheetRequested(Page sender, ActionSheetArguments arguments)
}
var actionSheetContent = new ActionSheetContent(arguments);
-
+
var actionSheet = new Flyout
{
FlyoutPresenterStyle = (UI.Xaml.Style)UI.Xaml.Application.Current.Resources["MauiFlyoutPresenterStyle"],
diff --git a/src/Controls/src/Core/Platform/AlertManager/AlertManager.iOS.cs b/src/Controls/src/Core/Platform/AlertManager/AlertManager.iOS.cs
index 48fdecdff827..441fc49bd0c7 100644
--- a/src/Controls/src/Core/Platform/AlertManager/AlertManager.iOS.cs
+++ b/src/Controls/src/Core/Platform/AlertManager/AlertManager.iOS.cs
@@ -20,17 +20,17 @@ internal void Subscribe(Window window)
{
var platformWindow = window?.MauiContext.GetPlatformWindow();
- if (Subscriptions.Any(s => s.Window == platformWindow))
+ if (Subscriptions.Any(s => s.PlatformView == platformWindow))
return;
- Subscriptions.Add(new AlertRequestHelper(platformWindow));
+ Subscriptions.Add(new AlertRequestHelper(window, platformWindow));
}
internal void Unsubscribe(Window window)
{
var platformWindow = window?.MauiContext.GetPlatformWindow();
- var toRemove = Subscriptions.Where(s => s.Window == platformWindow).ToList();
+ var toRemove = Subscriptions.Where(s => s.PlatformView == platformWindow).ToList();
foreach (AlertRequestHelper alertRequestHelper in toRemove)
{
@@ -45,24 +45,27 @@ internal sealed class AlertRequestHelper : IDisposable
int _busyCount;
- internal AlertRequestHelper(UIWindow window)
+ internal AlertRequestHelper(Window virtualView, UIWindow platformView)
{
- Window = window;
+ VirtualView = virtualView;
+ PlatformView = platformView;
- MessagingCenter.Subscribe(Window, Page.BusySetSignalName, OnPageBusy);
- MessagingCenter.Subscribe(Window, Page.AlertSignalName, OnAlertRequested);
- MessagingCenter.Subscribe(Window, Page.PromptSignalName, OnPromptRequested);
- MessagingCenter.Subscribe(Window, Page.ActionSheetSignalName, OnActionSheetRequested);
+ MessagingCenter.Subscribe(PlatformView, Page.BusySetSignalName, OnPageBusy);
+ MessagingCenter.Subscribe(PlatformView, Page.AlertSignalName, OnAlertRequested);
+ MessagingCenter.Subscribe(PlatformView, Page.PromptSignalName, OnPromptRequested);
+ MessagingCenter.Subscribe(PlatformView, Page.ActionSheetSignalName, OnActionSheetRequested);
}
- public UIWindow Window { get; }
+ public Window VirtualView { get; }
+
+ public UIWindow PlatformView { get; }
public void Dispose()
{
- MessagingCenter.Unsubscribe(Window, Page.BusySetSignalName);
- MessagingCenter.Unsubscribe(Window, Page.AlertSignalName);
- MessagingCenter.Unsubscribe(Window, Page.PromptSignalName);
- MessagingCenter.Unsubscribe(Window, Page.ActionSheetSignalName);
+ MessagingCenter.Unsubscribe(PlatformView, Page.BusySetSignalName);
+ MessagingCenter.Unsubscribe(PlatformView, Page.AlertSignalName);
+ MessagingCenter.Unsubscribe(PlatformView, Page.PromptSignalName);
+ MessagingCenter.Unsubscribe(PlatformView, Page.ActionSheetSignalName);
}
void OnPageBusy(IView sender, bool enabled)
@@ -106,7 +109,7 @@ void PresentAlert(AlertArguments arguments)
_ => arguments.SetResult(true)));
}
- PresentPopUp(Window, alert);
+ PresentPopUp(VirtualView, PlatformView, alert);
}
void PresentPrompt(PromptArguments arguments)
@@ -126,7 +129,7 @@ void PresentPrompt(PromptArguments arguments)
alert.AddAction(UIAlertAction.Create(arguments.Cancel, UIAlertActionStyle.Cancel, _ => arguments.SetResult(null)));
alert.AddAction(UIAlertAction.Create(arguments.Accept, UIAlertActionStyle.Default, _ => arguments.SetResult(alert.TextFields[0].Text)));
- PresentPopUp(Window, alert);
+ PresentPopUp(VirtualView, PlatformView, alert);
}
@@ -155,15 +158,16 @@ void PresentActionSheet(ActionSheetArguments arguments)
alert.AddAction(UIAlertAction.Create(blabel, UIAlertActionStyle.Default, _ => arguments.SetResult(blabel)));
}
- PresentPopUp(Window, alert, arguments);
+ PresentPopUp(VirtualView, PlatformView, alert, arguments);
}
- static void PresentPopUp(UIWindow window, UIAlertController alert, ActionSheetArguments arguments = null)
+
+ static void PresentPopUp(Window virtualView, UIWindow platformView, UIAlertController alert, ActionSheetArguments arguments = null)
{
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad && arguments != null)
{
UIDevice.CurrentDevice.BeginGeneratingDeviceOrientationNotifications();
var observer = NSNotificationCenter.DefaultCenter.AddObserver(UIDevice.OrientationDidChangeNotification,
- n => { alert.PopoverPresentationController.SourceRect = window.RootViewController.View.Bounds; });
+ n => { alert.PopoverPresentationController.SourceRect = platformView.RootViewController.View.Bounds; });
arguments.Result.Task.ContinueWith(t =>
{
@@ -171,16 +175,32 @@ static void PresentPopUp(UIWindow window, UIAlertController alert, ActionSheetAr
UIDevice.CurrentDevice.EndGeneratingDeviceOrientationNotifications();
}, TaskScheduler.FromCurrentSynchronizationContext());
- alert.PopoverPresentationController.SourceView = window.RootViewController.View;
- alert.PopoverPresentationController.SourceRect = window.RootViewController.View.Bounds;
+ alert.PopoverPresentationController.SourceView = platformView.RootViewController.View;
+ alert.PopoverPresentationController.SourceRect = platformView.RootViewController.View.Bounds;
alert.PopoverPresentationController.PermittedArrowDirections = 0; // No arrow
}
- window.BeginInvokeOnMainThread(() =>
+ var modalStack = virtualView?.Navigation?.ModalStack;
+
+ if (modalStack != null && modalStack.Count > 0)
{
- _ = window.RootViewController.PresentViewControllerAsync(alert, true);
- });
+ var topPage = modalStack[modalStack.Count - 1];
+ var pageController = topPage.ToUIViewController(topPage.FindMauiContext());
+ if (pageController != null)
+ {
+ platformView.BeginInvokeOnMainThread(() =>
+ {
+ pageController.PresentViewControllerAsync(alert, true);
+ });
+ return;
+ }
+ }
+
+ platformView.BeginInvokeOnMainThread(() =>
+ {
+ _ = platformView.RootViewController.PresentViewControllerAsync(alert, true);
+ });
}
}
}
diff --git a/src/Controls/src/Core/Platform/Android/BottomNavigationViewUtils.cs b/src/Controls/src/Core/Platform/Android/BottomNavigationViewUtils.cs
index c800d10a36e3..4d8ad904d256 100644
--- a/src/Controls/src/Core/Platform/Android/BottomNavigationViewUtils.cs
+++ b/src/Controls/src/Core/Platform/Android/BottomNavigationViewUtils.cs
@@ -94,6 +94,9 @@ internal static async void SetupMenu(
static async Task SetMenuItemIcon(IMenuItem menuItem, ImageSource source, IMauiContext context)
{
+ if (!menuItem.IsAlive())
+ return;
+
if (source == null)
return;
@@ -105,11 +108,10 @@ static async Task SetMenuItemIcon(IMenuItem menuItem, ImageSource source, IMauiC
source,
context.Context);
- if (result is not null)
- menuItem?.SetIcon(result.Value);
+ if (menuItem.IsAlive() && result is not null)
+ menuItem.SetIcon(result.Value);
}
-
public static BottomSheetDialog CreateMoreBottomSheet(
Action selectCallback,
IMauiContext mauiContext,
diff --git a/src/Controls/src/Core/Platform/Android/Extensions/ApplicationExtensions.cs b/src/Controls/src/Core/Platform/Android/Extensions/ApplicationExtensions.cs
index db037ffd8598..c1940fdbe5ec 100644
--- a/src/Controls/src/Core/Platform/Android/Extensions/ApplicationExtensions.cs
+++ b/src/Controls/src/Core/Platform/Android/Extensions/ApplicationExtensions.cs
@@ -15,7 +15,7 @@ public static void UpdateWindowSoftInputModeAdjust(this AApplication platformVie
if (Application.Current != null)
{
WindowSoftInputModeAdjust elementValue = Application.Current.OnThisPlatform().GetWindowSoftInputModeAdjust();
-
+
switch (elementValue)
{
case WindowSoftInputModeAdjust.Resize:
diff --git a/src/Controls/src/Core/Platform/Android/Extensions/EditTextExtensions.cs b/src/Controls/src/Core/Platform/Android/Extensions/EditTextExtensions.cs
index 9f47aa4f3c74..fa2d14280e3f 100644
--- a/src/Controls/src/Core/Platform/Android/Extensions/EditTextExtensions.cs
+++ b/src/Controls/src/Core/Platform/Android/Extensions/EditTextExtensions.cs
@@ -1,7 +1,10 @@
-using Android.Widget;
+using Android.Text;
+using Android.Widget;
+using AndroidX.Core.Widget;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform.Android;
using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;
+using Microsoft.Maui.Platform;
namespace Microsoft.Maui.Controls.Platform
{
@@ -13,33 +16,31 @@ public static void UpdateImeOptions(this EditText editText, Entry entry)
editText.ImeOptions = imeOptions;
}
-
+
public static void UpdateText(this EditText editText, InputView inputView)
{
- // Is UpdateText being called only to transform the text
- // that's already set on the platform element?
- // If so then we want to retain the cursor position
- bool transformingPlatformText =
- (editText.Text == inputView.Text);
+ bool isPasswordEnabled =
+ (editText.InputType & InputTypes.TextVariationPassword) == InputTypes.TextVariationPassword ||
+ (editText.InputType & InputTypes.NumberVariationPassword) == InputTypes.NumberVariationPassword;
+
+ // Setting the text causes the cursor to be reset to position zero.
+ // So, let's retain the current cursor position and calculate a new cursor
+ // position if the text was modified by a Converter.
+ var oldText = editText.Text ?? string.Empty;
+ var newText = TextTransformUtilites.GetTransformedText(
+ inputView?.Text,
+ isPasswordEnabled ? TextTransform.None : inputView.TextTransform
+ );
- var value = TextTransformUtilites.GetTransformedText(inputView.Text, inputView.TextTransform);
+ // Re-calculate the cursor offset position if the text was modified by a Converter.
+ // but if the text is being set by code, let's just move the cursor to the end.
+ var cursorOffset = newText.Length - oldText.Length;
+ int cursorPosition = editText.IsFocused ? editText.GetCursorPosition(cursorOffset) : newText.Length;
- if (!transformingPlatformText)
- {
- editText.Text = value;
- }
- else
- {
- // Setting the text causes the cursor to reset to position zero
- // so if we are transforming the text and then setting it to a
- // new value then we need to retain the cursor position
- if (value == editText.Text)
- return;
+ if (oldText != newText)
+ editText.Text = newText;
- int selectionStart = editText.SelectionStart;
- editText.Text = value;
- editText.SetSelection(selectionStart);
- }
+ editText.SetSelection(cursorPosition, cursorPosition);
}
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/Android/Extensions/FormattedStringExtensions.cs b/src/Controls/src/Core/Platform/Android/Extensions/FormattedStringExtensions.cs
index 01c8a1f3dbd9..a944926306c5 100644
--- a/src/Controls/src/Core/Platform/Android/Extensions/FormattedStringExtensions.cs
+++ b/src/Controls/src/Core/Platform/Android/Extensions/FormattedStringExtensions.cs
@@ -15,7 +15,7 @@ namespace Microsoft.Maui.Controls.Platform
public static class FormattedStringExtensions
{
public static SpannableString ToSpannableString(this Label label)
- => ToSpannableString(
+ => ToSpannableStringNewWay(
label.FormattedText,
label.RequireFontManager(),
label.Handler?.MauiContext?.Context,
@@ -26,7 +26,28 @@ public static SpannableString ToSpannableString(this Label label)
label.TextTransform,
label.TextDecorations);
+ // TODO: NET7 this overload must be removed in net7.0 and replace with the one below
public static SpannableString ToSpannableString(
+ this FormattedString formattedString,
+ IFontManager fontManager,
+ TextPaint? textPaint = null,
+ Context? context = null,
+ double defaultLineHeight = 0,
+ TextAlignment defaultHorizontalAlignment = TextAlignment.Start,
+ Font? defaultFont = null,
+ Graphics.Color? defaultColor = null,
+ TextTransform defaultTextTransform = TextTransform.Default)
+ => formattedString.ToSpannableStringNewWay(
+ fontManager,
+ context,
+ 0d,
+ defaultHorizontalAlignment,
+ defaultFont,
+ defaultColor,
+ defaultTextTransform,
+ TextDecorations.None);
+
+ internal static SpannableString ToSpannableStringNewWay(
this FormattedString formattedString,
IFontManager fontManager,
Context? context = null,
diff --git a/src/Controls/src/Core/Platform/Android/Extensions/RecyclerViewExtensions.cs b/src/Controls/src/Core/Platform/Android/Extensions/RecyclerViewExtensions.cs
index 5df82956ea61..37cac12c2d16 100644
--- a/src/Controls/src/Core/Platform/Android/Extensions/RecyclerViewExtensions.cs
+++ b/src/Controls/src/Core/Platform/Android/Extensions/RecyclerViewExtensions.cs
@@ -11,8 +11,8 @@ public static class RecyclerViewExtensions
public static void UpdateSelection(this RecyclerView recyclerView, SelectableItemsView selectableItemsView)
{
var mode = selectableItemsView.SelectionMode;
-
- var adapter = (recyclerView.GetAdapter() as SelectableItemsViewAdapter);
+ //TODO: on NET7 implement a ISelectableItemsViewAdapter interface on the adapter
+ var adapter = recyclerView.GetAdapter() as ReorderableItemsViewAdapter;
adapter?.ClearPlatformSelection();
switch (mode)
diff --git a/src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs b/src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs
index 2ba04a78a65b..8901f6a832f2 100644
--- a/src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs
+++ b/src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs
@@ -165,8 +165,8 @@ public static void UpdateBarTextColor(this AToolbar nativeToolbar, Toolbar toolb
// We need to reset the toolbar text color to the default color when it's unset
if (_defaultTitleTextColor == null)
{
- var context = nativeToolbar.Context?.GetThemedContext ();
- _defaultTitleTextColor = PlatformInterop.GetColorStateListForToolbarStyleableAttribute (context,
+ var context = nativeToolbar.Context?.GetThemedContext();
+ _defaultTitleTextColor = PlatformInterop.GetColorStateListForToolbarStyleableAttribute(context,
Resource.Attribute.toolbarStyle, Resource.Styleable.Toolbar_titleTextColor);
}
diff --git a/src/Controls/src/Core/Platform/GestureManager/GestureManager.Windows.cs b/src/Controls/src/Core/Platform/GestureManager/GestureManager.Windows.cs
index 6e99e44913cf..da2ebf530530 100644
--- a/src/Controls/src/Core/Platform/GestureManager/GestureManager.Windows.cs
+++ b/src/Controls/src/Core/Platform/GestureManager/GestureManager.Windows.cs
@@ -401,7 +401,7 @@ void HandlePinch(ManipulationDeltaRoutedEventArgs e, View view)
global::Windows.Foundation.Point translationPoint = container.TransformToVisual(Container).TransformPoint(e.Position);
var scaleOriginPoint = new Point(translationPoint.X / view.Width, translationPoint.Y / view.Height);
IEnumerable pinchGestures = view.GestureRecognizers.GetGesturesFor();
-
+
foreach (IPinchGestureController recognizer in pinchGestures)
{
if (!_wasPinchGestureStartedSent)
diff --git a/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Tizen.cs b/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Tizen.cs
index 3cbbcc8351ea..0f79d12c4108 100644
--- a/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Tizen.cs
+++ b/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Tizen.cs
@@ -15,7 +15,7 @@ partial void OnPageAttachedHandler()
WindowMauiContext.GetPlatformWindow().SetBackButtonPressedHandler(OnBackButtonPressed);
}
- public Task PopModalAsync(bool animated)
+ public Task PopModalAsync(bool animated)
{
Page modal = _navModel.PopModal();
((IPageController)modal).SendDisappearing();
diff --git a/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Windows.cs b/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Windows.cs
index 038eae50e075..60771a2e3d0a 100644
--- a/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Windows.cs
+++ b/src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Windows.cs
@@ -1,26 +1,17 @@
#nullable enable
-
using System;
using System.Threading.Tasks;
using Microsoft.Maui.Graphics;
-using Microsoft.UI.Xaml.Controls;
namespace Microsoft.Maui.Controls.Platform
{
internal partial class ModalNavigationManager
{
- Panel Container
- {
- get
- {
- if (_window.NativeWindow.Content is Panel p)
- return p;
+ WindowRootViewContainer Container =>
+ _window.NativeWindow.Content as WindowRootViewContainer ??
+ throw new InvalidOperationException("Root container Panel not found");
- throw new InvalidOperationException("Root container Panel not found");
- }
- }
-
- public Task PopModalAsync(bool animated)
+ public Task PopModalAsync(bool animated)
{
var tcs = new TaskCompletionSource();
var currentPage = _navModel.CurrentPage;
@@ -31,8 +22,7 @@ public Task PopModalAsync(bool animated)
public Task PushModalAsync(Page modal, bool animated)
{
- if (modal == null)
- throw new ArgumentNullException(nameof(modal));
+ _ = modal ?? throw new ArgumentNullException(nameof(modal));
var tcs = new TaskCompletionSource();
var currentPage = _navModel.CurrentPage;
@@ -43,13 +33,14 @@ public Task PushModalAsync(Page modal, bool animated)
void RemovePage(Page page)
{
- if (Container == null || page == null)
+ if (page == null)
return;
var mauiContext = page.FindMauiContext() ??
throw new InvalidOperationException("Maui Context removed from outgoing page too early");
- Container.Children.Remove(mauiContext.GetNavigationRootManager().RootView);
+ var windowManager = mauiContext.GetNavigationRootManager();
+ Container.RemovePage(windowManager.RootView);
}
void SetCurrent(Page newPage, Page previousPage, bool popping, Action? completedCallback = null)
@@ -59,13 +50,12 @@ void SetCurrent(Page newPage, Page previousPage, bool popping, Action? completed
if (popping)
{
RemovePage(previousPage);
- }
+ }
else if (newPage.BackgroundColor.IsDefault() && newPage.Background.IsEmpty)
{
RemovePage(previousPage);
}
-
if (popping)
{
previousPage
@@ -74,14 +64,16 @@ void SetCurrent(Page newPage, Page previousPage, bool popping, Action? completed
?.Disconnect();
previousPage.Handler = null;
- // Un-parent the page; otherwise the Resources Changed Listeners won't be unhooked and the
- // page will leak
+
+ // Un-parent the page; otherwise the Resources Changed Listeners won't be unhooked and the
+ // page will leak
previousPage.Parent = null;
}
if (Container == null || newPage == null)
return;
+ // pushing modal
if (!popping)
{
var modalContext =
@@ -93,35 +85,34 @@ void SetCurrent(Page newPage, Page previousPage, bool popping, Action? completed
var windowManager = modalContext.GetNavigationRootManager();
windowManager.Connect(newPage.ToPlatform(modalContext));
- Container.Children.Add(windowManager.RootView);
+ Container.AddPage(windowManager.RootView);
previousPage
.FindMauiContext()
?.GetNavigationRootManager()
?.UpdateAppTitleBar(false);
}
+ // popping modal
else
{
var windowManager = newPage.FindMauiContext()?.GetNavigationRootManager() ??
throw new InvalidOperationException("Previous Page Has Lost its MauiContext");
- if(!Container.Children.Contains(windowManager.RootView))
- Container.Children.Add(windowManager.RootView);
+ Container.AddPage(windowManager.RootView);
windowManager.UpdateAppTitleBar(true);
}
completedCallback?.Invoke();
}
- catch (Exception error)
+ catch (Exception error) when (error.HResult == -2147417842)
{
- //This exception prevents the Main Page from being changed in a child
- //window or a different thread, except on the Main thread.
+ //This exception prevents the Main Page from being changed in a child
+ //window or a different thread, except on the Main thread.
//HEX 0x8001010E
- if (error.HResult == -2147417842)
- throw new InvalidOperationException("Changing the current page is only allowed if it's being called from the same UI thread." +
- "Please ensure that the new page is in the same UI thread as the current page.");
- throw;
+ throw new InvalidOperationException(
+ "Changing the current page is only allowed if it's being called from the same UI thread." +
+ "Please ensure that the new page is in the same UI thread as the current page.", error);
}
}
}
diff --git a/src/Controls/src/Core/Platform/Tizen/GestureDetector.cs b/src/Controls/src/Core/Platform/Tizen/GestureDetector.cs
index 6576dce5f606..0ebad536846f 100644
--- a/src/Controls/src/Core/Platform/Tizen/GestureDetector.cs
+++ b/src/Controls/src/Core/Platform/Tizen/GestureDetector.cs
@@ -204,7 +204,8 @@ void RemoveGesture(IGestureRecognizer recognizer)
{
var cache = _handlerCache;
var handler = LookupHandler(recognizer);
- if (handler == null) return;
+ if (handler == null)
+ return;
var gestureType = cache.FirstOrDefault(x => x.Value.Contains(handler)).Key;
diff --git a/src/Controls/src/Core/Platform/Tizen/Shell/ShellFlyoutItemAdaptor.cs b/src/Controls/src/Core/Platform/Tizen/Shell/ShellFlyoutItemAdaptor.cs
index f9b1e4f9f587..279b113e2505 100644
--- a/src/Controls/src/Core/Platform/Tizen/Shell/ShellFlyoutItemAdaptor.cs
+++ b/src/Controls/src/Core/Platform/Tizen/Shell/ShellFlyoutItemAdaptor.cs
@@ -14,7 +14,7 @@ public class ShellFlyoutItemAdaptor : ItemAdaptor
{
Dictionary _platformViewsTable = new Dictionary();
Dictionary