diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index edb70cab2421..36fd6af2a16d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "1.0.0-prerelease.22569.1", + "version": "1.0.0-prerelease.23110.1", "commands": [ "xharness" ] diff --git a/.editorconfig b/.editorconfig index a303b1fe982b..b864e8f4f202 100644 --- a/.editorconfig +++ b/.editorconfig @@ -27,6 +27,7 @@ dotnet_diagnostic.IL2050.severity = none # Code analyzers dotnet_diagnostic.CA1307.severity = error dotnet_diagnostic.CA1309.severity = error +dotnet_diagnostic.CA1815.severity = error # Modifier preferences dotnet_style_require_accessibility_modifiers = never:suggestion diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 63fa671206d3..fea2ff84f841 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -18,7 +18,7 @@ Have a look at our [Development Guide](DEVELOPMENT.md) to learn about setting up ### What to work on -If you're looking for something to work on, please browse our [Handler Property Backlog](https://github.com/dotnet/maui/projects/4). Any issue that is not already assigned is up for grabs. Make sure to read over the [Handler Property PR Guidelines](https://github.com/dotnet/maui/wiki/Handler-Property-PR-Guidelines) to acquaint yourself on how you can get started in contributing to our handler conversion efforts. Included is also a sample PR you can model after. +If you're looking for something to work on, please browse our [backlog](https://github.com/dotnet/maui/issues?q=is%3Aopen+is%3Aissue+milestone%3ABacklog). Any issue that is not already assigned is up for grabs. Follow the style used by the [.NET Foundation](https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/coding-style.md), with two primary exceptions: @@ -29,7 +29,7 @@ Read and follow our [Pull Request template](PULL_REQUEST_TEMPLATE.md). ### Pull Request Requirements -Please refer to our [Handler Property PR Guidelines](https://github.com/dotnet/maui/wiki/Handler-Property-PR-Guidelines) and [Pull Request template](PULL_REQUEST_TEMPLATE.md). +Please refer to our [Pull Request template](PULL_REQUEST_TEMPLATE.md). Please check the "Allow edits from maintainers" checkbox on your pull request. This allows us to quickly make minor fixes and resolve conflicts for you. diff --git a/.github/fabricbot.json b/.github/fabricbot.json index 0a54f967ad59..22ba6d9c744a 100644 --- a/.github/fabricbot.json +++ b/.github/fabricbot.json @@ -2005,116 +2005,12 @@ { "name": "addReply", "parameters": { - "comment": "Thanks for the issue report @${issueAuthor}! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.\n\nIf you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.\n\n1. Go to the [Visual Studio for Windows feedback tool](https://docs.microsoft.com/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022) or [Visual Studio for Mac feedback tool](https://learn.microsoft.com/en-us/visualstudio/mac/report-a-problem?view=vsmac-2022) to report the issue\n2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.\n\nThis issue will be automatically closed in 3 days if there are no further comments." + "comment": "Thanks for the issue report @${issueAuthor}! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.\n\nIf you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.\n\n1. Go to the [Visual Studio for Windows feedback tool](https://docs.microsoft.com/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022) or [Visual Studio for Mac feedback tool](https://learn.microsoft.com/en-us/visualstudio/mac/report-a-problem?view=vsmac-2022) to report the issue\n2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there." } } ] } }, - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "frequency": [ - { - "weekDay": 0, - "hours": [ - 0, - 6, - 12, - 18 - ] - }, - { - "weekDay": 1, - "hours": [ - 0, - 6, - 12, - 18 - ] - }, - { - "weekDay": 2, - "hours": [ - 0, - 6, - 12, - 18 - ] - }, - { - "weekDay": 3, - "hours": [ - 0, - 6, - 12, - 18 - ] - }, - { - "weekDay": 4, - "hours": [ - 0, - 6, - 12, - 18 - ] - }, - { - "weekDay": 5, - "hours": [ - 0, - 6, - 12, - 18 - ] - }, - { - "weekDay": 6, - "hours": [ - 0, - 6, - 12, - 18 - ] - } - ], - "searchTerms": [ - { - "name": "isOpen", - "parameters": {} - }, - { - "name": "hasLabel", - "parameters": { - "label": "s/move-to-vs-feedback" - } - }, - { - "name": "noActivitySince", - "parameters": { - "days": 3 - } - } - ], - "taskName": "Close 's/move-to-vs-feedback' after 3 days of no activity", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "This issue is being closed due to inactivity. If this issue is still affecting you, please follow the steps above to use the VS Feedback Tool to report the issue." - } - }, - { - "name": "closeIssue", - "parameters": {} - } - ] - } - }, { "taskType": "trigger", "capabilityId": "IssueResponder", diff --git a/.github/workflows/dotnet-autoformat-pr-push.yml b/.github/workflows/dotnet-autoformat-pr-push.yml index 36bbec44475a..7eaab91d8e9f 100644 --- a/.github/workflows/dotnet-autoformat-pr-push.yml +++ b/.github/workflows/dotnet-autoformat-pr-push.yml @@ -18,6 +18,7 @@ jobs: github.event.workflow_run.conclusion == 'success' steps: - name: 'Push autoformatted patch' - uses: rolfbjarne/autoformat-push@v0.1 + uses: rolfbjarne/autoformat-push@v0.2 with: - githubToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + githubToken: ${{ secrets.GITHUB_TOKEN }} + commentContents: 'Thank you for your pull request. We are auto-formating your source code to follow our code guidelines.' diff --git a/.github/workflows/dotnet-autoformat-pr.yml b/.github/workflows/dotnet-autoformat-pr.yml index e94963a536df..dcb055c50335 100644 --- a/.github/workflows/dotnet-autoformat-pr.yml +++ b/.github/workflows/dotnet-autoformat-pr.yml @@ -14,7 +14,6 @@ jobs: - name: 'Autoformat' uses: rolfbjarne/autoformat@v0.2 with: - script: 'dotnet format .\Microsoft.Maui.sln --no-restore --exclude Templates/src BlazorWebView/src/SharedSource/BlazorWebViewDeveloperTools.cs BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs Graphics/src/Graphics.Win2D/W2DCanvas.cs Graphics/src/Graphics.Win2D/W2DExtensions.cs' - projects: "Microsoft.Maui.sln" + script: 'dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src BlazorWebView/src/SharedSource/BlazorWebViewDeveloperTools.cs BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs Graphics/src/Graphics.Win2D/W2DCanvas.cs Graphics/src/Graphics.Win2D/W2DExtensions.cs' onlyFilesModifiedInPullRequest: true - git_commit_message: 'Thank you for your pull request. We are auto-formating your source code to follow our code guidelines.' + git_commit_message: 'Auto-format source code' diff --git a/.gitignore b/.gitignore index ca39706b101e..7ed3d08b1787 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,8 @@ ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore -.nuspec/**/*.dll -.nuspec/**/*.dylib -.nuspec/**/*.so -.XamarinFormsVersionFile.txt +.nuspec/ +.buildtasks/ templatesTest/ # User-specific files diff --git a/.nuspec/AutoImport.InTree.props b/.nuspec/AutoImport.InTree.props deleted file mode 100644 index 449b9845588e..000000000000 --- a/.nuspec/AutoImport.InTree.props +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MSBuild:Compile - $(DefaultXamlRuntime) - - - MSBuild:Compile - $(DefaultXamlRuntime) - - - MSBuild:Compile - $(DefaultXamlRuntime) - - - - \ No newline at end of file diff --git a/.nuspec/Microsoft.Maui.Controls.DualScreen.nuspec b/.nuspec/Microsoft.Maui.Controls.DualScreen.nuspec deleted file mode 100644 index 6391725e89f6..000000000000 --- a/.nuspec/Microsoft.Maui.Controls.DualScreen.nuspec +++ /dev/null @@ -1,49 +0,0 @@ - - - - Xamarin.Forms.DualScreen - $version$ - Microsoft - microsoft xamarin - xamarin forms twopaneview DualScreen xamarinforms xamarinformsdualscreen xamarin.forms.dualscreen - MIT - Assets\xamarin_128x128.png - http://xamarin.com/forms - - true - DualScreen support for Xamarin.Forms - © Microsoft Corporation. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.nuspec/Microsoft.Maui.Controls.SingleProject.props b/.nuspec/Microsoft.Maui.Controls.SingleProject.props deleted file mode 100644 index feeed761bb20..000000000000 --- a/.nuspec/Microsoft.Maui.Controls.SingleProject.props +++ /dev/null @@ -1,29 +0,0 @@ - - - - WinExe - MSIX - true - false - - false - true - true - <_SingleProjectRIDRequired Condition="'$(OutputType)' == 'WinExe'">true - <_SingleProjectRIDSpecified Condition="'$(RuntimeIdentifier)' != '' or '$(RuntimeIdentifiers)' != ''">true - - - - <_SingleProjectHostArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) - <_SingleProjectHostArchitecture>$(_SingleProjectHostArchitecture.ToLower()) - win10-$(_SingleProjectHostArchitecture) - <_MauiUsingDefaultRuntimeIdentifier>true - - - - - - - - - diff --git a/.nuspec/Microsoft.Maui.Core.props b/.nuspec/Microsoft.Maui.Core.props deleted file mode 100644 index 805beb40223e..000000000000 --- a/.nuspec/Microsoft.Maui.Core.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - true - $(EnableMsixTooling) - true - false - - - diff --git a/.nuspec/Microsoft.Maui.Core.targets b/.nuspec/Microsoft.Maui.Core.targets deleted file mode 100644 index faf2349bae2d..000000000000 --- a/.nuspec/Microsoft.Maui.Core.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/.nuspec/_._ b/.nuspec/_._ deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/Directory.Build.props b/Directory.Build.props index 008616235f54..8933b3839956 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,13 +14,21 @@ <_MauiPreviousDotNetTfm Condition="'$(_MauiPreviousDotNetTfm)' == ''">net$(_MauiPreviousDotNetVersion) <_MauiTargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) + <_MauiNoTargetPlatform>false <_MauiNoTargetPlatform Condition="'$(_MauiTargetPlatformIdentifier)' == ''">True + <_MauiTargetPlatformIsAndroid>false <_MauiTargetPlatformIsAndroid Condition="'$(_MauiTargetPlatformIdentifier)' == 'android'">True + <_MauiTargetPlatformIsiOS>false <_MauiTargetPlatformIsiOS Condition="'$(_MauiTargetPlatformIdentifier)' == 'ios'">True + <_MauiTargetPlatformIsMacCatalyst>false <_MauiTargetPlatformIsMacCatalyst Condition="'$(_MauiTargetPlatformIdentifier)' == 'maccatalyst'">True + <_MauiTargetPlatformIsmacOS>false <_MauiTargetPlatformIsmacOS Condition="'$(_MauiTargetPlatformIdentifier)' == 'macos'">True + <_MauiTargetPlatformIstvOS>false <_MauiTargetPlatformIstvOS Condition="'$(_MauiTargetPlatformIdentifier)' == 'tvos'">True + <_MauiTargetPlatformIsWindows>false <_MauiTargetPlatformIsWindows Condition="$(_MauiTargetPlatformIdentifier.Contains('windows')) == 'True'">True + <_MauiTargetPlatformIsTizen>false <_MauiTargetPlatformIsTizen Condition="'$(_MauiTargetPlatformIdentifier)' == 'tizen'">True @@ -109,7 +117,6 @@ $(MSBuildThisFileDirectory) $(MSBuildThisFileDirectory)src/ - $(MSBuildThisFileDirectory).nuspec/ $(MSBuildThisFileDirectory)bin/ $(DotNetOutputPath)temp/ $(DotNetOutputPath)dotnet/ @@ -119,7 +126,8 @@ $(DotNetDirectory)sdk-manifests/$(DotNetSdkManifestsFolder)/ $(DotNetDirectory)template-packs/ <_MauiBuildTasksLocation>$(_MauiBuildTasksLocation) - <_MauiBuildTasksLocation Condition="'$(_MauiBuildTasksLocation)' == ''">$(MSBuildThisFileDirectory).nuspec\ + <_MauiBuildTasksLocation Condition="'$(_MauiBuildTasksLocation)' == ''">$(MSBuildThisFileDirectory).buildtasks\ + <_MauiAOTProfileLocation>$(MauiSrcDirectory)Controls\src\Build.Tasks\nuget\buildTransitive\netstandard2.0\ true portable true diff --git a/Directory.Build.targets b/Directory.Build.targets index 65470a9b9367..2005eb8e56bb 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -75,7 +75,7 @@ - + diff --git a/Microsoft.Maui-mac.slnf b/Microsoft.Maui-mac.slnf index c5f706d0729a..8578bcd290cd 100644 --- a/Microsoft.Maui-mac.slnf +++ b/Microsoft.Maui-mac.slnf @@ -27,6 +27,7 @@ "src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj", "src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj", "src\\Controls\\src\\Core\\Controls.Core.csproj", + "src\\Controls\\src\\NuGet\\Controls.NuGet.csproj", "src\\Controls\\src\\SourceGen\\Controls.SourceGen.csproj", "src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj", "src\\Controls\\src\\Xaml\\Controls.Xaml.csproj", @@ -57,12 +58,6 @@ "src\\TestUtils\\src\\DeviceTests.Runners\\TestUtils.DeviceTests.Runners.csproj", "src\\TestUtils\\src\\DeviceTests\\TestUtils.DeviceTests.csproj", "src\\TestUtils\\src\\TestUtils\\TestUtils.csproj", - "src\\Workload\\Microsoft.Maui.Controls.Ref\\Microsoft.Maui.Controls.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Controls.Runtime\\Microsoft.Maui.Controls.Runtime.csproj", - "src\\Workload\\Microsoft.Maui.Core.Ref\\Microsoft.Maui.Core.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Core.Runtime\\Microsoft.Maui.Core.Runtime.csproj", - "src\\Workload\\Microsoft.Maui.Essentials.Ref\\Microsoft.Maui.Essentials.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Essentials.Runtime\\Microsoft.Maui.Essentials.Runtime.csproj", "src\\Workload\\Microsoft.Maui.Sdk\\Microsoft.Maui.Sdk.csproj", "src\\Workload\\Microsoft.NET.Sdk.Maui\\Microsoft.NET.Sdk.Maui.csproj" ] diff --git a/Microsoft.Maui.BuildTasks.slnf b/Microsoft.Maui.BuildTasks.slnf index 80af361012ad..820dd1bbcdc9 100644 --- a/Microsoft.Maui.BuildTasks.slnf +++ b/Microsoft.Maui.BuildTasks.slnf @@ -4,7 +4,10 @@ "projects": [ "src\\Graphics\\src\\Graphics\\Graphics.csproj", "src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj", + "src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj", "src\\Controls\\src\\Core\\Controls.Core.csproj", + "src\\Controls\\src\\NuGet\\Controls.NuGet.csproj", + "src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj", "src\\Controls\\src\\Xaml\\Controls.Xaml.csproj", "src\\Core\\src\\Core.csproj", "src\\SingleProject\\Resizetizer\\src\\Resizetizer.csproj" diff --git a/Microsoft.Maui.Packages-mac.slnf b/Microsoft.Maui.Packages-mac.slnf index bfb2f5c21bcf..51c79fd590b2 100644 --- a/Microsoft.Maui.Packages-mac.slnf +++ b/Microsoft.Maui.Packages-mac.slnf @@ -9,6 +9,7 @@ "src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj", "src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj", "src\\Controls\\src\\Core\\Controls.Core.csproj", + "src\\Controls\\src\\NuGet\\Controls.NuGet.csproj", "src\\Controls\\src\\SourceGen\\Controls.SourceGen.csproj", "src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj", "src\\Controls\\src\\Xaml\\Controls.Xaml.csproj", @@ -20,13 +21,7 @@ "src\\Graphics\\src\\Text.Markdig\\Graphics.Text.Markdig.csproj", "src\\SingleProject\\Resizetizer\\src\\Resizetizer.csproj", "src\\Templates\\src\\Microsoft.Maui.Templates.csproj", - "src\\Workload\\Microsoft.Maui.Controls.Ref\\Microsoft.Maui.Controls.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Controls.Runtime\\Microsoft.Maui.Controls.Runtime.csproj", "src\\Workload\\Microsoft.Maui.Sdk\\Microsoft.Maui.Sdk.csproj", - "src\\Workload\\Microsoft.Maui.Core.Ref\\Microsoft.Maui.Core.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Core.Runtime\\Microsoft.Maui.Core.Runtime.csproj", - "src\\Workload\\Microsoft.Maui.Essentials.Ref\\Microsoft.Maui.Essentials.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Essentials.Runtime\\Microsoft.Maui.Essentials.Runtime.csproj", "src\\Workload\\Microsoft.NET.Sdk.Maui\\Microsoft.NET.Sdk.Maui.csproj" ] } diff --git a/Microsoft.Maui.Packages.slnf b/Microsoft.Maui.Packages.slnf index c28b36f80843..76bd81f1b7bb 100644 --- a/Microsoft.Maui.Packages.slnf +++ b/Microsoft.Maui.Packages.slnf @@ -11,6 +11,7 @@ "src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj", "src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj", "src\\Controls\\src\\Core\\Controls.Core.csproj", + "src\\Controls\\src\\NuGet\\Controls.NuGet.csproj", "src\\Controls\\src\\SourceGen\\Controls.SourceGen.csproj", "src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj", "src\\Controls\\src\\Xaml\\Controls.Xaml.csproj", @@ -23,14 +24,7 @@ "src\\Essentials\\src\\Essentials.csproj", "src\\SingleProject\\Resizetizer\\src\\Resizetizer.csproj", "src\\Templates\\src\\Microsoft.Maui.Templates.csproj", - "src\\Workload\\Microsoft.Maui.Controls.Ref\\Microsoft.Maui.Controls.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Controls.Runtime\\Microsoft.Maui.Controls.Runtime.csproj", "src\\Workload\\Microsoft.Maui.Sdk\\Microsoft.Maui.Sdk.csproj", - "src\\Workload\\Microsoft.Maui.Core.Ref\\Microsoft.Maui.Core.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Core.Runtime\\Microsoft.Maui.Core.Runtime.csproj", - "src\\Workload\\Microsoft.Maui.Essentials.Ref\\Microsoft.Maui.Essentials.Ref.csproj", - "src\\Workload\\Microsoft.Maui.Essentials.Runtime\\Microsoft.Maui.Essentials.Runtime.csproj", - "src\\Workload\\Microsoft.Maui.Resizetizer.Sdk\\Microsoft.Maui.Resizetizer.Sdk.csproj", "src\\Workload\\Microsoft.NET.Sdk.Maui\\Microsoft.NET.Sdk.Maui.csproj" ] } diff --git a/Microsoft.Maui.sln b/Microsoft.Maui.sln index 59a9f74842cc..c57fc12d4936 100644 --- a/Microsoft.Maui.sln +++ b/Microsoft.Maui.sln @@ -70,22 +70,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebViewAppShared", "src\Bla EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workload", "Workload", "{EC63FD88-5E12-46D7-B440-68F70241D987}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Controls.Ref", "src\Workload\Microsoft.Maui.Controls.Ref\Microsoft.Maui.Controls.Ref.csproj", "{91B7E807-1026-4238-A7C2-D7A02C66F141}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Controls.Runtime", "src\Workload\Microsoft.Maui.Controls.Runtime\Microsoft.Maui.Controls.Runtime.csproj", "{9D8171BD-0F66-4D97-9A38-46800FC6B710}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Sdk", "src\Workload\Microsoft.Maui.Sdk\Microsoft.Maui.Sdk.csproj", "{C5C434A7-4E1F-456F-A23A-F2566C98301A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Core.Ref", "src\Workload\Microsoft.Maui.Core.Ref\Microsoft.Maui.Core.Ref.csproj", "{359FFDAC-3E3C-4A78-98EE-9070841E5792}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Core.Runtime", "src\Workload\Microsoft.Maui.Core.Runtime\Microsoft.Maui.Core.Runtime.csproj", "{73075C7E-AA0A-4FD6-BBD7-6BD3B43BC2A9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Essentials.Ref", "src\Workload\Microsoft.Maui.Essentials.Ref\Microsoft.Maui.Essentials.Ref.csproj", "{28B1E6A8-4EB7-4B82-9552-10C418692496}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Essentials.Runtime", "src\Workload\Microsoft.Maui.Essentials.Runtime\Microsoft.Maui.Essentials.Runtime.csproj", "{C69336DF-EE56-4236-8188-06B2A8AD8A36}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Resizetizer.Sdk", "src\Workload\Microsoft.Maui.Resizetizer.Sdk\Microsoft.Maui.Resizetizer.Sdk.csproj", "{02414DF4-FBE9-400B-8F3F-40DDC7F8FEFC}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Sdk.Maui", "src\Workload\Microsoft.NET.Sdk.Maui\Microsoft.NET.Sdk.Maui.csproj", "{081EE5E5-69D4-493C-9EB4-47423C4728AB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils.DeviceTests.Runners", "src\TestUtils\src\DeviceTests.Runners\TestUtils.DeviceTests.Runners.csproj", "{316C0861-069B-4572-879F-F01E568F33A2}" @@ -253,6 +239,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Gtk", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Core.Design.UnitTests", "src\Controls\tests\Core.Design.UnitTests\Controls.Core.Design.UnitTests.csproj", "{F68932B0-81A2-4CC3-A4F7-28091EE91B23}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.NuGet", "src\Controls\src\NuGet\Controls.NuGet.csproj", "{4A6930AE-B67C-4D29-B1A8-ED9EB7F923A7}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.DeviceTests.Shared", "src\Core\tests\DeviceTests.Shared\Core.DeviceTests.Shared.csproj", "{66CC98E3-6A1A-4C44-A23C-B575E82106EC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphics.DeviceTests", "src\Graphics\tests\DeviceTests\Graphics.DeviceTests.csproj", "{34969E49-FA6E-41BB-9813-5689BB14021E}" @@ -337,38 +325,10 @@ Global {9F1E0CE0-BF56-433F-8238-6C2B880EEF18}.Debug|Any CPU.Build.0 = Debug|Any CPU {9F1E0CE0-BF56-433F-8238-6C2B880EEF18}.Release|Any CPU.ActiveCfg = Release|Any CPU {9F1E0CE0-BF56-433F-8238-6C2B880EEF18}.Release|Any CPU.Build.0 = Release|Any CPU - {91B7E807-1026-4238-A7C2-D7A02C66F141}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91B7E807-1026-4238-A7C2-D7A02C66F141}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91B7E807-1026-4238-A7C2-D7A02C66F141}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91B7E807-1026-4238-A7C2-D7A02C66F141}.Release|Any CPU.Build.0 = Release|Any CPU - {9D8171BD-0F66-4D97-9A38-46800FC6B710}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D8171BD-0F66-4D97-9A38-46800FC6B710}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D8171BD-0F66-4D97-9A38-46800FC6B710}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D8171BD-0F66-4D97-9A38-46800FC6B710}.Release|Any CPU.Build.0 = Release|Any CPU {C5C434A7-4E1F-456F-A23A-F2566C98301A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C5C434A7-4E1F-456F-A23A-F2566C98301A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C5C434A7-4E1F-456F-A23A-F2566C98301A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C5C434A7-4E1F-456F-A23A-F2566C98301A}.Release|Any CPU.Build.0 = Release|Any CPU - {359FFDAC-3E3C-4A78-98EE-9070841E5792}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {359FFDAC-3E3C-4A78-98EE-9070841E5792}.Debug|Any CPU.Build.0 = Debug|Any CPU - {359FFDAC-3E3C-4A78-98EE-9070841E5792}.Release|Any CPU.ActiveCfg = Release|Any CPU - {359FFDAC-3E3C-4A78-98EE-9070841E5792}.Release|Any CPU.Build.0 = Release|Any CPU - {73075C7E-AA0A-4FD6-BBD7-6BD3B43BC2A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73075C7E-AA0A-4FD6-BBD7-6BD3B43BC2A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73075C7E-AA0A-4FD6-BBD7-6BD3B43BC2A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73075C7E-AA0A-4FD6-BBD7-6BD3B43BC2A9}.Release|Any CPU.Build.0 = Release|Any CPU - {28B1E6A8-4EB7-4B82-9552-10C418692496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28B1E6A8-4EB7-4B82-9552-10C418692496}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28B1E6A8-4EB7-4B82-9552-10C418692496}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28B1E6A8-4EB7-4B82-9552-10C418692496}.Release|Any CPU.Build.0 = Release|Any CPU - {C69336DF-EE56-4236-8188-06B2A8AD8A36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69336DF-EE56-4236-8188-06B2A8AD8A36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69336DF-EE56-4236-8188-06B2A8AD8A36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69336DF-EE56-4236-8188-06B2A8AD8A36}.Release|Any CPU.Build.0 = Release|Any CPU - {02414DF4-FBE9-400B-8F3F-40DDC7F8FEFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {02414DF4-FBE9-400B-8F3F-40DDC7F8FEFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {02414DF4-FBE9-400B-8F3F-40DDC7F8FEFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {02414DF4-FBE9-400B-8F3F-40DDC7F8FEFC}.Release|Any CPU.Build.0 = Release|Any CPU {081EE5E5-69D4-493C-9EB4-47423C4728AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {081EE5E5-69D4-493C-9EB4-47423C4728AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {081EE5E5-69D4-493C-9EB4-47423C4728AB}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -635,6 +595,10 @@ Global {F68932B0-81A2-4CC3-A4F7-28091EE91B23}.Debug|Any CPU.Build.0 = Debug|Any CPU {F68932B0-81A2-4CC3-A4F7-28091EE91B23}.Release|Any CPU.ActiveCfg = Release|Any CPU {F68932B0-81A2-4CC3-A4F7-28091EE91B23}.Release|Any CPU.Build.0 = Release|Any CPU + {4A6930AE-B67C-4D29-B1A8-ED9EB7F923A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A6930AE-B67C-4D29-B1A8-ED9EB7F923A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A6930AE-B67C-4D29-B1A8-ED9EB7F923A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A6930AE-B67C-4D29-B1A8-ED9EB7F923A7}.Release|Any CPU.Build.0 = Release|Any CPU {66CC98E3-6A1A-4C44-A23C-B575E82106EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {66CC98E3-6A1A-4C44-A23C-B575E82106EC}.Debug|Any CPU.Build.0 = Debug|Any CPU {66CC98E3-6A1A-4C44-A23C-B575E82106EC}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -675,14 +639,7 @@ Global {05DB57B8-D0A5-499B-AD35-7093C2E9C9D7} = {E25E7929-2423-4C8A-9B03-DC4C8B19A2E5} {A8E9400E-70DD-421F-8609-1C2FA4AE8E71} = {1614D1A4-5C3D-4D5B-8C89-426E37A564EF} {9F1E0CE0-BF56-433F-8238-6C2B880EEF18} = {A8E9400E-70DD-421F-8609-1C2FA4AE8E71} - {91B7E807-1026-4238-A7C2-D7A02C66F141} = {EC63FD88-5E12-46D7-B440-68F70241D987} - {9D8171BD-0F66-4D97-9A38-46800FC6B710} = {EC63FD88-5E12-46D7-B440-68F70241D987} {C5C434A7-4E1F-456F-A23A-F2566C98301A} = {EC63FD88-5E12-46D7-B440-68F70241D987} - {359FFDAC-3E3C-4A78-98EE-9070841E5792} = {EC63FD88-5E12-46D7-B440-68F70241D987} - {73075C7E-AA0A-4FD6-BBD7-6BD3B43BC2A9} = {EC63FD88-5E12-46D7-B440-68F70241D987} - {28B1E6A8-4EB7-4B82-9552-10C418692496} = {EC63FD88-5E12-46D7-B440-68F70241D987} - {C69336DF-EE56-4236-8188-06B2A8AD8A36} = {EC63FD88-5E12-46D7-B440-68F70241D987} - {02414DF4-FBE9-400B-8F3F-40DDC7F8FEFC} = {EC63FD88-5E12-46D7-B440-68F70241D987} {081EE5E5-69D4-493C-9EB4-47423C4728AB} = {EC63FD88-5E12-46D7-B440-68F70241D987} {316C0861-069B-4572-879F-F01E568F33A2} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C} {E87D865B-4EA8-4A30-B6C1-572D2061D707} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C} @@ -762,6 +719,7 @@ Global {F26D31D3-CE4C-4F32-A77F-E2905C948674} = {42AB9AE1-631D-4AD4-85B7-910FF0940BDB} {F351A992-18E4-473C-8ADD-2BA0BAA7B5A2} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE} {F68932B0-81A2-4CC3-A4F7-28091EE91B23} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E} + {4A6930AE-B67C-4D29-B1A8-ED9EB7F923A7} = {50C758FE-4E10-409A-94F5-A75480960864} {66CC98E3-6A1A-4C44-A23C-B575E82106EC} = {C564DDD6-DE79-45CD-88EA-3F690481572A} {34969E49-FA6E-41BB-9813-5689BB14021E} = {936C47A9-A7EA-4FBD-8733-CED1D4100E69} EndGlobalSection diff --git a/THIRD-PARTY-NOTICES.TXT b/THIRD-PARTY-NOTICES.TXT index ccc2d383f7f2..58bb1b5a09e9 100644 --- a/THIRD-PARTY-NOTICES.TXT +++ b/THIRD-PARTY-NOTICES.TXT @@ -465,3 +465,31 @@ License notice for Gradle (https://github.com/gradle/gradle) ============================================================================== + +License notice for IQKeyboardManager +========================================= + +(https://github.com/hackiftekhar/IQKeyboardManager/blob/master/LICENSE.md) + +MIT License + +Copyright (c) 2013-2017 Iftekhar Qurashi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= diff --git a/cSpell.json b/cSpell.json index 980bfd275013..026be1843be9 100644 --- a/cSpell.json +++ b/cSpell.json @@ -2,7 +2,11 @@ "version": "0.2", "language": "en", "words": [ - "Blazor" + "Blazor", + "Skia", + "Resizetizer", + "nugets", + "netstandard" ], "ignoreWords": [], "patterns": [ diff --git a/docs/design/NuGets.md b/docs/design/NuGets.md new file mode 100644 index 000000000000..7db4653f76d5 --- /dev/null +++ b/docs/design/NuGets.md @@ -0,0 +1,158 @@ +# .NET MAUI NuGet Structure + +There are several artifacts in the .NET MAUI "universe": + +* Workload packages: + * `Microsoft.NET.Sdk.Maui.Manifest` - The workload manifest for the .NET SDK + * `Microsoft.Maui.Sdk` - The actual .NET MAUI workload SDK + * `Microsoft.Maui.Templates.net*` - The current set of templates for this build of .NET MAUI +* .NET MAUI framework: + * `Microsoft.Maui.Controls` - The super/root package of .NET MAUI Controls + * `Microsoft.Maui.Controls.Core` - The Controls assemblies + * `Microsoft.Maui.Controls.Xaml` - The XAML parser + * `Microsoft.Maui.Controls.Build.Tasks` - The real set of XAML[C|G] targets and globs + * `Microsoft.Maui.Resizetizer` - The framework-and-platform-agnostic asset generator and integrator + * `Microsoft.Maui.Core` - The base interfaces and handlers for all .NET MAUI things + * `Microsoft.Maui.Essentials` - The core set of framework-agnostic, cross-platform APIs + * `Microsoft.Maui.Controls.Compatibility` - The set of compatibility APIs for Xamarin.Forms +* .NET MAUI maps support: + * `Microsoft.Maui.Controls.Maps` - The set of XAML-based map controls + * `Microsoft.Maui.Maps` - The set of handlers and interfaces for mapping controls +* .NET MAUI dual-screen / foldable support: + * `Microsoft.Maui.Controls.Foldable` - The set of APIs and controls needed for dual-screen support +* .NET MAUI graphics: + * `Microsoft.Maui.Graphics` - The core graphics engine of .NET MAUI + * `Microsoft.Maui.Graphics.Win2D.WinUI.Desktop` - The Win2D-based version of the graphics engine (soon to be merged with the core engine) + * `Microsoft.Maui.Graphics.Skia` - The SkiaSharp-based version of the graphics engine + * `Microsoft.Maui.Graphics.Text.Markdig` - The markdown support for the graphics engine +* ASP.NET Blazor desktop/mobile support: + * `Microsoft.AspNetCore.Components.WebView.Maui` - The BlazorWebView for .NET MAUI apps + * `Microsoft.AspNetCore.Components.WebView.WindowsForms` - The BlazorWebView for Windows Forms apps + * `Microsoft.AspNetCore.Components.WebView.Wpf` - The BlazorWebView for WPF apps + +## Handling .targets and .props + +A typical workload has all the targets in the "SDK" portion and then pulls in a bunch of RID-specific NuGet packages, but for MAUI this is not necessary as the size of the entire workload with all the packs is about 60MB - with about 38MB actually just being SkiaSharp for all the platforms in the Resizetizer SDK. + +For MAUI, we decided to reduce the number of pack and msi downloads and just go with almost a 1 to 1 csproj to nuget. + +Most nugets do not contain or need targets and/or props files, but some do. These include: + + - Workload + - Manifest - `Microsoft.NET.Sdk.Maui.Manifest` + - SDK - `Microsoft.Maui.Sdk` + - NuGet Packages + - Controls - `Microsoft.Maui.Controls.Build.Tasks` + - Core - `Microsoft.Maui.Core` + - Resizetizer - `Microsoft.Maui.Resizetizer` + +### Structure of .props & .targets Files + +In most cases, there are 4 types of targets/props files: + + - `.props` + This file runs before anything and everything (except the `Directory.Build.props`) and can set defaults for the csproj to use. + - `.targets` + This is the actual start of the targets for the pack. It does at least 2 things: + 1. Imports the `.Before.targets` file that runs before any targets run (but after all props have run). + 2. Queues up the `.After.targets` file in the `$(AfterMicrosoftNETSdkTargets)` MSBuild property to run after all the targets have been imported. If a nuget needs to have some targets run at this point, then that nuget can append the file to the property: + ```xml + + $(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)Microsoft.Maui.[something].After.targets + + ``` + - `.Before.targets` + This file includes anything that is needed in the main targets file, but before any core SDK/platform targets have run. This is often used to set defaults based on values the user has set in the csproj. + _This file technically could be merged into `.targets`, but is split out to make the organization of the targets easier._ + - `.After.targets` + This file runs after most of the targets have run - including the core SDK and workloads. This can be used to override any SDK targets or tasks. + +### Targets in the Workload + +There are 2 components in the workload: + - Manifest - `Microsoft.NET.Sdk.Maui.Manifest` + - SDK - `Microsoft.Maui.Sdk` + +The workload manifest contains the `WorkloadManifest.json` and the `WorkloadManifest.targets` as required by .NET. The .json file is just a tree of all the various components and pack IDs that are needed as part of the MAUI workload. The .targets file is just the entrypoint to the SDK and contains the SDK pack imports for MSBuild. + +The SDK pack contains the actual targets and props files. Using a structure similar to the section above, it includes the main parts of the workload things. + +There are 2 key files that must be present in a workload: + - `AutoImport.props` + This file is empty as this is just needed by MSBuild. + - `Sdk.targets` + This file imports the `BundledVersions.targets` and `Microsoft.Maui.Sdk.targets` files depending on the `UseXxx` MSBuild properties. + +The targets file can then import all the SDK: + - `BundledVersions.targets` + This file sets various version properties and then implicitly imports all the required NuGet packages depending on the `UseXxx` MSBuild properties. + - `Microsoft.Maui.Sdk.targets` + This is the actual start of the targets for the MAUI framework. It does a few things: + 1. Imports the `Microsoft.Maui.Sdk.Before.targets` file that runs before any MAUI targets run (but after all props have run). + 2. Imports any targets from the nugets that need to run after the .csproj but before the nuget .targets using the `$(MicrosoftMauiSdkPlatformTargets)` MSBuild property. If a nuget needs to have some targets run at this point, then that nuget can append the file to the property: + ```xml + + $(MicrosoftMauiSdkPlatformTargets);$(MSBuildThisFileDirectory)Microsoft.Maui.Sdk.[platform].targets + + ``` + 3. Queues up the `Microsoft.Maui.Sdk.After.targets` file to run after all the targets have been imported. + - `Microsoft.Maui.Sdk.Before.targets` + This file sets any pre-nuget-restore properties required by the framework. This currently includes anything that NuGet will use as part of the restore - such as RIDs and R2R values. These properties cannot be in the nugets as restoring the nugets will make it such that the restore state is now invalidated. + _This file technically could be merged into `Microsoft.Maui.Sdk.targets`, but is split out to make the organization of the targets easier. + - `Microsoft.Maui.Sdk.After.targets` + This file runs after most of the targets have run and currently just ensures all the `ProjectCapability` items are included based on the `UseXxx` MSBuild properties. These values are used by the IDE to determine what to do and how to restore. So, these must also be on disk prior to any nuget install. + +### Targets in the Packs + +There are 3 packs today that need targets: + + - Controls - `Microsoft.Maui.Controls.Build.Tasks` + - Core - `Microsoft.Maui.Core` + - Resizetizer - `Microsoft.Maui.Resizetizer` + +#### Targets in Controls + +The Controls section of MAUI is the main set of libraries that a MAUI app uses. The targets and props needed but MAUI mostly live in the `Microsoft.Maui.Controls.Build.Tasks` nuget. This is mainly because of the dependency structure of MAUI. + +Controls is the "library name" as well as the assembly name - but the bits we need for the MSBuild tasks depend on this. We _could_ do some funky magic and merge all the components of Controls into a single NuGet, but this is maybe not as worth it. Right now we have a empty NuGet that just pulls in all the things. + +But for the targets, this is very similar to the structure mentioned above, but with some platform targets too. + +For the files we use, there are 3 areas: + - platform targets that set some properties and then import the netstandard targets + - netstandard targets that represent the real work + - targets as the root that catch any platforms that are not counted as netstandard and just import the netstandard targets + +**Platform Files** + +If NuGet detects a platform folder in the nuget, then it skips all other imports and just uses the files in there. As a result, the targets files are just dummy/redirection to import the netstandard targets. the props files are where the real customization comes from and is used to set some platform-specific details. + +When the targets were all in the workload, they all ran at a point where the TFM could be used. But, when in a NuGet, they run too early so we use the NuGet feature of the TFM loading. + +**.NET Standard Files** + +This is the real work folder and is just `netstandard` because that is the TFM of the build tasks assembly - and that is just because this needs to be loaded by both the full MSBuild and the dotnet core MSBuild. + +These targets follow the structure outlined above with some props files and then the targets files importing a before and after targets. Some of the things that these files do is set the globs and include the various XAML compiler tasks. It also hooks up the analyzers and AOT profiles. + +**Root Files** + +Some platforms do not count netstandard as part of net7 - such as Windows - so it falls back to nothing. Not sure if this is a bug or a feature, but having files at the root makes sure that _all_ things get _something_. + +#### Targets in Core + +The targets and props for Core all live in the root of the buildTransitive so that all platforms can have access to them without having to have duplicates or files importing them per TFM. Windows is the exception to this because it has to set some platform-specific properties. There are some Windows-specific targets and tasks in the root, but they are conditioned to the Windows TFM. This makes maintenance easier if everything is in a single file. + +Since we have added a Windows TFM folder, NuGet stops looking at the root of the buildTransitive folder for targets and props. As a result, the Windows targets and props just import the root files after setting any platform-specific properties. + +The targets and tasks in this NuGet are pretty minimal and really just set some core platform defaults - mainly Windows App SDK properties to control how we want projects to work in .NET MAUI. It also adds some Windows App SDK workarounds for bugs that have not yet reached the public releases. + +#### Targets in Resizetizer + +The targets and props in Resizetizer are pretty standard and really all fit into 1 file. However, to be consistent we have the 4 base files. + +The properties, targets and tasks are all imported on all platforms and are conditioned per TFM. + +#### Targets in Blazor WebView + +The targets and props in the Blazor nugets are maintained by the Blazor team and they just have a single targets and props file for all platforms to share. diff --git a/eng/Microsoft.Extensions.targets b/eng/Microsoft.Extensions.targets index 931798a7942d..e1d2b8192c69 100644 --- a/eng/Microsoft.Extensions.targets +++ b/eng/Microsoft.Extensions.targets @@ -20,6 +20,26 @@ Update="System.Numerics.Vectors" Version="$(SystemNumericsVectorsVersion)" /> + + + + + + + + https://github.com/dotnet/templating 3f4da9ced34942d83054e647f3b1d9d7dde281e8 - + https://github.com/dotnet/xharness - bc9877ac24c13ef8d4ad4c2c3652291a1b02b78f + 6e20fd14ba45ff67193f961186d373ffbcfd5ea2 - + https://github.com/dotnet/xharness - bc9877ac24c13ef8d4ad4c2c3652291a1b02b78f + 6e20fd14ba45ff67193f961186d373ffbcfd5ea2 - + https://github.com/dotnet/xharness - bc9877ac24c13ef8d4ad4c2c3652291a1b02b78f + 6e20fd14ba45ff67193f961186d373ffbcfd5ea2 diff --git a/eng/Versions.props b/eng/Versions.props index e4890550546e..39cc92db44f1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -27,30 +27,38 @@ 10.0.22621.755 1.0.4 - 7.0.2 - 7.0.2 - 7.0.2 - 7.0.2 + 7.0.3 + 7.0.3 + 7.0.3 + 7.0.3 7.0.1 7.0.1 7.0.1 - 7.0.2 - 7.0.2 + 7.0.3 + 7.0.3 7.0.1 - 7.0.2 + 7.0.3 8.0.0-preview1.23067.2 3.3.3 3.3.3 4.5.0 - <_MicrosoftWebWebView2Version>1.0.1518.46 + 4.5.5 + 4.5.1 + 7.0.1 + 7.0.0 + 7.0.0 + 4.3.0 + 4.3.0 + 6.0.0 + <_MicrosoftWebWebView2Version>1.0.1587.40 <_XamarinAndroidGlideVersion>4.13.2.2 <_XamarinAndroidXSecurityVersion>1.1.0-alpha03 <_XamarinGoogleCryptoTinkAndroidVersion>1.7.0.2 - 118.1.0 + 118.1.0.1 + maccatalyst-x64 diff --git a/src/Compatibility/Android.AppLinks/src/Compatibility.Android.AppLinks.csproj b/src/Compatibility/Android.AppLinks/src/Compatibility.Android.AppLinks.csproj index c2235e2a14ce..b5a6215529bc 100644 --- a/src/Compatibility/Android.AppLinks/src/Compatibility.Android.AppLinks.csproj +++ b/src/Compatibility/Android.AppLinks/src/Compatibility.Android.AppLinks.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj b/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj index d5e854e26c33..c98889dfa205 100644 --- a/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj +++ b/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj @@ -57,7 +57,6 @@ - diff --git a/src/Compatibility/ControlGallery/src/Android/PlatformSpecificCoreGalleryFactory.cs b/src/Compatibility/ControlGallery/src/Android/PlatformSpecificCoreGalleryFactory.cs index 280f6ffb863e..79c1d0761e39 100644 --- a/src/Compatibility/ControlGallery/src/Android/PlatformSpecificCoreGalleryFactory.cs +++ b/src/Compatibility/ControlGallery/src/Android/PlatformSpecificCoreGalleryFactory.cs @@ -16,11 +16,7 @@ public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFa public IEnumerable<(Func Create, string Title)> GetPages() { -#if HAVE_OPENTK - yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy"); -#else return null; -#endif } } } diff --git a/src/Compatibility/ControlGallery/src/Core/ControlGalleryPages/FlowDirectionGallery.cs b/src/Compatibility/ControlGallery/src/Core/ControlGalleryPages/FlowDirectionGallery.cs index 4bad11ecdf25..6e0700b4e331 100644 --- a/src/Compatibility/ControlGallery/src/Core/ControlGalleryPages/FlowDirectionGallery.cs +++ b/src/Compatibility/ControlGallery/src/Core/ControlGalleryPages/FlowDirectionGallery.cs @@ -291,8 +291,6 @@ void SetContent(FlowDirection direction) lbl3.HorizontalTextAlignment = TextAlignment.Center; lbl3.Text = "Center text"; - //var ogv = AddView(grid, ref col, ref row, hOptions, vOptions, margin); - var pkr = AddView(grid, ref col, ref row); pkr.ItemsSource = Enumerable.Range(0, 10).ToList(); diff --git a/src/Compatibility/ControlGallery/src/Core/CoreGallery.cs b/src/Compatibility/ControlGallery/src/Core/CoreGallery.cs index a8c0179a1ffd..e995bdd424f9 100644 --- a/src/Compatibility/ControlGallery/src/Core/CoreGallery.cs +++ b/src/Compatibility/ControlGallery/src/Core/CoreGallery.cs @@ -360,7 +360,6 @@ public override string ToString() new GalleryPageFactory(() => new KeyboardCoreGallery(), "Keyboard Gallery"), new GalleryPageFactory(() => new LabelCoreGalleryPage(), "Label Gallery"), new GalleryPageFactory(() => new ListViewCoreGalleryPage(), "ListView Gallery"), - new GalleryPageFactory(() => new OpenGLViewCoreGalleryPage(), "OpenGLView Gallery"), new GalleryPageFactory(() => new PickerCoreGalleryPage(), "Picker Gallery"), new GalleryPageFactory(() => new ProgressBarCoreGalleryPage(), "ProgressBar Gallery"), new GalleryPageFactory(() => new MaterialProgressBarGallery(), "ProgressBar & Slider Gallery (Material)"), @@ -422,10 +421,6 @@ public override string ToString() new GalleryPageFactory(() => new MinimumSizeGallery(), "MinimumSize Gallery - Legacy"), new GalleryPageFactory(() => new MultiGallery(), "Multi Gallery - Legacy"), new GalleryPageFactory(() => new NavigationPropertiesGallery(), "Navigation Properties"), -#if HAVE_OPENTK - new GalleryPageFactory(() => new BasicOpenGLGallery(), "Basic OpenGL Gallery - Legacy"), - new GalleryPageFactory(() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy"), -#endif new GalleryPageFactory(() => new PickerGallery(), "Picker Gallery - Legacy"), new GalleryPageFactory(() => new ProgressBarGallery(), "ProgressBar Gallery - Legacy"), new GalleryPageFactory(() => new RelativeLayoutGallery(), "RelativeLayout Gallery - Legacy"), diff --git a/src/Compatibility/ControlGallery/src/Core/CoreGalleryPages/OpenGLViewCoreGalleryPage.cs b/src/Compatibility/ControlGallery/src/Core/CoreGalleryPages/OpenGLViewCoreGalleryPage.cs deleted file mode 100644 index 207dede38931..000000000000 --- a/src/Compatibility/ControlGallery/src/Core/CoreGalleryPages/OpenGLViewCoreGalleryPage.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Microsoft.Maui.Controls.Compatibility.ControlGallery -{ - internal class OpenGLViewCoreGalleryPage : CoreGalleryPage - { - // TODO - protected override bool SupportsFocus - { - get { return false; } - } - - protected override void Build(StackLayout stackLayout) - { - base.Build(stackLayout); - } - } -} \ No newline at end of file diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/MemoryLeakGallery.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/MemoryLeakGallery.cs index b15d023ad019..e475f74a23af 100644 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/MemoryLeakGallery.cs +++ b/src/Compatibility/ControlGallery/src/Core/GalleryPages/MemoryLeakGallery.cs @@ -97,7 +97,6 @@ public MemoryLeakGallery() MakeButton(nameof(WebView), () => new WebView { BackgroundColor = Colors.Azure, HeightRequest = 50 }), MakeButton(nameof(ProgressBar), () => new ProgressBar { BackgroundColor = Colors.Azure, Progress = 0.5 }), MakeButton(nameof(Picker), () => new Picker { BackgroundColor = Colors.Azure, HeightRequest = 50 }), - MakeButton(nameof(OpenGLView), () => new OpenGLView ()), MakeButton(nameof(SearchBar), () => new SearchBar ()), MakeButton(nameof(Slider), () => new Slider ()), MakeButton(nameof(Stepper), () => new Stepper ()), diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/OpenGLGalleries/AdvancedOpenGLGallery.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/OpenGLGalleries/AdvancedOpenGLGallery.cs deleted file mode 100644 index 5808f14377d1..000000000000 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/OpenGLGalleries/AdvancedOpenGLGallery.cs +++ /dev/null @@ -1,218 +0,0 @@ -#if HAVE_OPENTK -using System; -using OpenTK; - -#if __WPF__ || __GTK__ || __MACOS__ -using OpenTK.Graphics.OpenGL; -#elif __ANDROID__ || __IOS__ -using OpenTK.Graphics.ES20; -#endif - -using Microsoft.Maui.Graphics; - -namespace Microsoft.Maui.Controls.Compatibility.ControlGallery -{ - public class AdvancedOpenGLGallery : ContentPage - { - private const string VertexShader = @" - uniform mat4 uMVPMatrix; - attribute vec4 vColor; - attribute vec4 vPosition; - varying vec4 color; - void main() - { - color = vColor; - gl_Position = uMVPMatrix * vPosition; - }"; - - private const string FragmentShader = @" - varying lowp vec4 color; - void main (void) - { - gl_FragColor = color; - }"; - - private bool _initGl = false; - private int _viewportWidth; - private int _viewportHeight; - private Vector4[] _vertices; - private Vector4[] _colors; - - private uint _mProgramHandle; - private int _mColorHandle; - private int _mPositionHandle; - private int _mMVPMatrixHandle; - private Matrix4 _mProjectionMatrix; - private Matrix4 _mViewMatrix; - private Matrix4 _mModelViewProjectionMatrix; - - private Microsoft.Maui.Controls.OpenGLView _openGLView = null; - - public AdvancedOpenGLGallery() - { - Title = "Advanced OpenGLView Sample"; - - var titleLabel = new Label - { - Text = "OpenGLView", - FontSize = 36 - }; - - _openGLView = new OpenGLView - { - HeightRequest = 300, - WidthRequest = 300, - HasRenderLoop = true - }; - - _openGLView.OnDisplay = r => - { - if (!_initGl) - { - double width_in_pixels = 300; - double height_in_pixels = 300; - - InitGl((int)width_in_pixels, (int)height_in_pixels); - } - - Render(); - }; - - var stack = new StackLayout - { - Padding = new Size(12, 12), - Children = { titleLabel, _openGLView } - }; - - Content = stack; - } - - void InitGl(int width, int height) - { - _viewportHeight = width; - _viewportWidth = height; - - _vertices = new Vector4[] - { - new Vector4(0.0f, 0.5f, 0.0f, 1.0f), - new Vector4(0.5f, -0.5f, 0.0f, 1.0f), - new Vector4(-0.5f, -0.5f, 0.0f, 1.0f) - }; - - _colors = new Vector4[] - { - new Vector4(1.0f, 0.0f, 0.0f, 1.0f), - new Vector4(0.0f, 1.0f, 0.0f, 1.0f), - new Vector4(0.0f, 0.0f, 1.0f, 1.0f) - }; - - uint vertexShader = CompileShader(VertexShader, ShaderType.VertexShader); - uint fragmentShader = CompileShader(FragmentShader, ShaderType.FragmentShader); - - _mProgramHandle = (uint)GL.CreateProgram(); - if (_mProgramHandle == 0) - throw new InvalidOperationException("Unable to create program"); - - GL.AttachShader(_mProgramHandle, vertexShader); - GL.AttachShader(_mProgramHandle, fragmentShader); - - GL.BindAttribLocation(_mProgramHandle, 0, "vPosition"); - GL.LinkProgram(_mProgramHandle); - - GL.Viewport(0, 0, _viewportWidth, _viewportHeight); - - GL.UseProgram(_mProgramHandle); - - _initGl = true; - } - - public static uint CompileShader(string shaderString, ShaderType shaderType) - { - uint shaderHandle = (uint)GL.CreateShader(shaderType); - GL.ShaderSource((int)shaderHandle, shaderString); - GL.CompileShader(shaderHandle); - - return shaderHandle; - } - - public static void UniformMatrix4(int location, Matrix4 value) - { - GL.UniformMatrix4(location, 1, false, ref value.Row0.X); - } - - void Render() - { - GL.UseProgram(_mProgramHandle); - - GL.ClearColor(0.7f, 0.7f, 0.7f, 1); - GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit | ClearBufferMask.StencilBufferBit); - - float aspectRatio = ((float)Width) / ((float)Height); - float ratio = ((float)_viewportWidth) / ((float)_viewportHeight); - - _mProjectionMatrix = Matrix4.CreateOrthographicOffCenter(-ratio, ratio, -1, 1, 0.1f, 10.0f); - - _mViewMatrix = Matrix4.LookAt(new Vector3(0, 0, 5), new Vector3(0, 0, 0), new Vector3(0, 1, 0)); - - _mModelViewProjectionMatrix = Matrix4.Mult(_mViewMatrix, _mProjectionMatrix); - - Matrix4 mModel = Matrix4.CreateRotationY((float)(Math.PI * 2.0 * ReferenceTime.GetTimeFromReferenceMs() / 5000.0)); - - _mModelViewProjectionMatrix = Matrix4.Mult(_mModelViewProjectionMatrix, mModel); - - _mPositionHandle = GL.GetAttribLocation(_mProgramHandle, "vPosition"); - - _mColorHandle = GL.GetAttribLocation(_mProgramHandle, "vColor"); - - GL.EnableVertexAttribArray(_mPositionHandle); - GL.EnableVertexAttribArray(_mColorHandle); - - unsafe - { - fixed (Vector4* pvertices = _vertices) - { - GL.VertexAttribPointer(_mPositionHandle, Vector4.SizeInBytes / 4, VertexAttribPointerType.Float, false, 0, new IntPtr(pvertices)); - } - - fixed (Vector4* pcolors = _colors) - { - GL.VertexAttribPointer(_mColorHandle, Vector4.SizeInBytes / 4, VertexAttribPointerType.Float, false, 0, new IntPtr(pcolors)); - } - } - - _mMVPMatrixHandle = GL.GetUniformLocation(_mProgramHandle, "uMVPMatrix"); - - UniformMatrix4(_mMVPMatrixHandle, _mModelViewProjectionMatrix); - -#pragma warning disable 0618 - GL.DrawArrays(BeginMode.Triangles, 0, 3); -#pragma warning restore 0618 - GL.Finish(); - GL.DisableVertexAttribArray(_mPositionHandle); - GL.DisableVertexAttribArray(_mColorHandle); - } - } - - public class ReferenceTime - { - private static DateTime reference_time; - private static bool reference_time_set = false; - - public static double GetTimeFromReferenceMs() - { - if (!reference_time_set) - { - reference_time = DateTime.Now; - reference_time_set = true; - - return 0.0; - } - - DateTime actual_time = DateTime.Now; - TimeSpan ts = new TimeSpan(actual_time.Ticks - reference_time.Ticks); - - return ts.TotalMilliseconds; - } - } -} -#endif \ No newline at end of file diff --git a/src/Compatibility/ControlGallery/src/Core/GalleryPages/OpenGLGalleries/BasicOpenGLGallery.cs b/src/Compatibility/ControlGallery/src/Core/GalleryPages/OpenGLGalleries/BasicOpenGLGallery.cs deleted file mode 100644 index a8f792787af1..000000000000 --- a/src/Compatibility/ControlGallery/src/Core/GalleryPages/OpenGLGalleries/BasicOpenGLGallery.cs +++ /dev/null @@ -1,94 +0,0 @@ -#if HAVE_OPENTK -using System; -using OpenTK.Graphics.OpenGL; - -namespace Microsoft.Maui.Controls.Compatibility.ControlGallery -{ - public class BasicOpenGLGallery : ContentPage - { - private bool _initGl = false; - private int _viewportWidth; - private int _viewportHeight; - private uint _mProgramHandle; - private OpenGLView _openGLView = null; - - public BasicOpenGLGallery() - { - Title = "Basic OpenGLView Sample"; - - var titleLabel = new Label - { - Text = "OpenGLView", - FontSize = 36 - }; - - _openGLView = new OpenGLView - { - HeightRequest = 300, - WidthRequest = 300, - HasRenderLoop = true - }; - - _openGLView.OnDisplay = r => - { - if (!_initGl) - { - double width_in_pixels = 300; - double height_in_pixels = 300; - - InitGl((int)width_in_pixels, (int)height_in_pixels); - } - - Render(); - }; - - var stack = new StackLayout - { - Padding = new Size(12, 12), - Children = { titleLabel, _openGLView } - }; - - Content = stack; - } - - void InitGl(int width, int height) - { - _viewportHeight = width; - _viewportWidth = height; - - _mProgramHandle = (uint)GL.CreateProgram(); - if (_mProgramHandle == 0) - throw new InvalidOperationException("Unable to create program"); - - GL.BindAttribLocation(_mProgramHandle, 0, "vPosition"); - GL.LinkProgram(_mProgramHandle); - - GL.Viewport(0, 0, _viewportWidth, _viewportHeight); - - GL.UseProgram(_mProgramHandle); - - _initGl = true; - } - - - void Render() - { -#pragma warning disable 0618 - GL.ClearColor(0, 0, 0, 0); - GL.Clear(ClearBufferMask.ColorBufferBit); - - GL.Color3(1.0f, 0.85f, 0.35f); - GL.Begin(BeginMode.Triangles); - - GL.Vertex3(0.0, 0.6, 0.0); - GL.Vertex3(-0.2, -0.3, 0.0); - GL.Vertex3(0.2, -0.3, 0.0); -#pragma warning restore 0618 - - GL.End(); - - GL.Flush(); - } - } -} -#endif \ No newline at end of file diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Helpers/ViewHelper.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Helpers/ViewHelper.cs index f79a9ba4c49a..924bacd9ea7d 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Helpers/ViewHelper.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Helpers/ViewHelper.cs @@ -24,7 +24,6 @@ public static List GetAllViews() new ListView { ItemsSource = Enumerable.Range(0,10), ItemTemplate = new DataTemplate(typeof(ImageCell)) }, new ListView { ItemsSource = Enumerable.Range(0,10), ItemTemplate = new DataTemplate(typeof(EntryCell)) }, new ListView { ItemsSource = Enumerable.Range(0,10), ItemTemplate = new DataTemplate(typeof(SwitchCell)) }, - new OpenGLView { }, new Picker { }, new ProgressBar { }, new SearchBar { }, diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8958.xaml.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8958.xaml.cs index c49926c06f19..a2cd08fa0b16 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8958.xaml.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/Issue8958.xaml.cs @@ -49,7 +49,9 @@ protected override void Init() } [Preserve(AllMembers = true)] +#pragma warning disable CA1815 // Override equals and operator equals on value types public struct Issue8958Model +#pragma warning restore CA1815 // Override equals and operator equals on value types { public string Title { get; set; } } diff --git a/src/Compatibility/ControlGallery/src/Issues.Shared/TransparentOverlayTests.cs b/src/Compatibility/ControlGallery/src/Issues.Shared/TransparentOverlayTests.cs index 11b5c5639386..1c63c511be31 100644 --- a/src/Compatibility/ControlGallery/src/Issues.Shared/TransparentOverlayTests.cs +++ b/src/Compatibility/ControlGallery/src/Issues.Shared/TransparentOverlayTests.cs @@ -65,7 +65,9 @@ Button MenuButton(TestPoint test) } [Preserve(AllMembers = true)] +#pragma warning disable CA1815 // Override equals and operator equals on value types public struct TestPoint +#pragma warning restore CA1815 // Override equals and operator equals on value types { public TestPoint(int i) : this() { diff --git a/src/Compatibility/ControlGallery/src/Tizen/RegistrarValidationService.cs b/src/Compatibility/ControlGallery/src/Tizen/RegistrarValidationService.cs index 1d029d5eec05..433c9b62f2c7 100644 --- a/src/Compatibility/ControlGallery/src/Tizen/RegistrarValidationService.cs +++ b/src/Compatibility/ControlGallery/src/Tizen/RegistrarValidationService.cs @@ -13,7 +13,7 @@ public bool Validate(VisualElement element, out string message) { message = "Success"; - if (element == null || element is OpenGLView) + if (element == null) return true; var renderer = Platform.Tizen.Platform.GetOrCreateRenderer(element); diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/PlatformQueries.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/PlatformQueries.cs index e2ec706546eb..ad4493df7216 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/PlatformQueries.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/PlatformQueries.cs @@ -72,7 +72,6 @@ internal static class PlatformViews public static readonly string Label = "UILabel"; public static readonly string ListView = "UITableView"; public static readonly string Map = "MKMapView"; - public static readonly string OpenGLView = "GLKView"; public static readonly string Picker = "UITextField"; public static readonly string Pin = "MKPinAnnotationView"; public static readonly string ProgressBar = "UIProgressView"; @@ -98,7 +97,6 @@ internal static class PlatformViews public static readonly string Label = "android.widget.TextView"; public static readonly string ListView = "android.widget.ListView"; public static readonly string Map = "android.gms.maps.GoogleMap"; - public static readonly string OpenGLView = "android.widget.GLSurfaceView"; public static readonly string Picker = "android.widget.EditText"; public static readonly string Pin = "android.gms.maps.model.Marker"; public static readonly string ProgressBar = "android.widget.ProgressBar"; diff --git a/src/Compatibility/ControlGallery/src/UITests.Shared/Queries.cs b/src/Compatibility/ControlGallery/src/UITests.Shared/Queries.cs index 5d488eb216ac..a9c24c9cefda 100644 --- a/src/Compatibility/ControlGallery/src/UITests.Shared/Queries.cs +++ b/src/Compatibility/ControlGallery/src/UITests.Shared/Queries.cs @@ -30,7 +30,6 @@ internal static class GalleryQueries public const string ImageButtonGallery = "* marked:'Image Button Gallery'"; public const string LabelGallery = "* marked:'Label Gallery'"; public const string ListViewGallery = "* marked:'ListView Gallery'"; - public const string OpenGLViewGallery = "* marked:'OpenGLView Gallery'"; public const string PickerGallery = "* marked:'Picker Gallery'"; public const string ProgressBarGallery = "* marked:'ProgressBar Gallery'"; public const string RadioButtonGallery = "* marked:'RadioButton Core Gallery'"; @@ -94,7 +93,6 @@ internal static class Views public static readonly string Label = PlatformViews.Label; public static readonly string ListView = PlatformViews.ListView; public static readonly string Map = PlatformViews.Map; - public static readonly string OpenGLView = PlatformViews.OpenGLView; public static readonly string Picker = PlatformViews.Picker; public static readonly string Pin = PlatformViews.Pin; public static readonly string ProgressBar = PlatformViews.ProgressBar; diff --git a/src/Compatibility/ControlGallery/src/WinUI/RegistrarValidationService.cs b/src/Compatibility/ControlGallery/src/WinUI/RegistrarValidationService.cs index ddd9a940d6e7..2f0620811662 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/RegistrarValidationService.cs +++ b/src/Compatibility/ControlGallery/src/WinUI/RegistrarValidationService.cs @@ -13,7 +13,7 @@ public bool Validate(VisualElement element, out string message) { message = "Success"; - if (element == null || element is OpenGLView) + if (element == null) return true; #pragma warning disable CS0612 // Type or member is obsolete diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.GTK/PlatformSpecificCoreGalleryFactory.cs b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.GTK/PlatformSpecificCoreGalleryFactory.cs index 818aae56820c..8ce8f4fbab86 100644 --- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.GTK/PlatformSpecificCoreGalleryFactory.cs +++ b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.GTK/PlatformSpecificCoreGalleryFactory.cs @@ -14,12 +14,7 @@ public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFa public IEnumerable<(Func Create, string Title)> GetPages() { -#if HAVE_OPENTK - yield return (() => new BasicOpenGLGallery(), "Basic OpenGL Gallery - Legacy"); - yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy"); -#else return null; -#endif } } } diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.GTK/Xamarin.Forms.ControlGallery.GTK.csproj b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.GTK/Xamarin.Forms.ControlGallery.GTK.csproj index 212b639a303f..3e68e6b06902 100644 --- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.GTK/Xamarin.Forms.ControlGallery.GTK.csproj +++ b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.GTK/Xamarin.Forms.ControlGallery.GTK.csproj @@ -89,12 +89,6 @@ - - GalleryPages\AdvancedOpenGLGallery.cs - - - GalleryPages\BasicOpenGLGallery.cs - diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.MacOS/PlatformSpecificCoreGalleryFactory.cs b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.MacOS/PlatformSpecificCoreGalleryFactory.cs index a1b39e9d59fb..0bfe0e7996c1 100644 --- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.MacOS/PlatformSpecificCoreGalleryFactory.cs +++ b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.MacOS/PlatformSpecificCoreGalleryFactory.cs @@ -14,12 +14,7 @@ public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFa public IEnumerable<(Func Create, string Title)> GetPages() { -#if HAVE_OPENTK - yield return (() => new BasicOpenGLGallery(), "Basic OpenGL Gallery - Legacy"); - yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy"); -#else return null; -#endif } } } diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.MacOS/Xamarin.Forms.ControlGallery.MacOS.csproj b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.MacOS/Xamarin.Forms.ControlGallery.MacOS.csproj index ab0ffbc09e6d..5c7589714645 100644 --- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.MacOS/Xamarin.Forms.ControlGallery.MacOS.csproj +++ b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.MacOS/Xamarin.Forms.ControlGallery.MacOS.csproj @@ -104,12 +104,6 @@ - - GalleryPages\AdvancedOpenGLGallery.cs - - - GalleryPages\BasicOpenGLGallery.cs - diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/PlatformSpecificCoreGalleryFactory.cs b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/PlatformSpecificCoreGalleryFactory.cs index 333acc2bd177..e900eb93a927 100644 --- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/PlatformSpecificCoreGalleryFactory.cs +++ b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/PlatformSpecificCoreGalleryFactory.cs @@ -14,12 +14,7 @@ public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFa public IEnumerable<(Func Create, string Title)> GetPages() { -#if HAVE_OPENTK - yield return (() => new BasicOpenGLGallery(), "Basic OpenGL Gallery - Legacy"); - yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy"); -#else return null; -#endif } } } diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/RegistrarValidationService.cs b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/RegistrarValidationService.cs index 464164719077..e976feb673a1 100644 --- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/RegistrarValidationService.cs +++ b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/RegistrarValidationService.cs @@ -12,7 +12,7 @@ public bool Validate(VisualElement element, out string message) { message = "Success"; - if (element == null || element is OpenGLView) + if (element == null) return true; var renderer = Platform.WPF.Platform.GetOrCreateRenderer(element); diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj index e88efd4e20a9..df3b2c2cc2e5 100644 --- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj +++ b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj @@ -42,12 +42,6 @@ - - GalleryPages\AdvancedOpenGLGallery.cs - - - GalleryPages\BasicOpenGLGallery.cs - diff --git a/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj b/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj index 9596c55b7a69..3c73eca148a5 100644 --- a/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj +++ b/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj @@ -35,10 +35,6 @@ - - - - diff --git a/src/Compatibility/ControlGallery/src/iOS/PlatformSpecificCoreGalleryFactory.cs b/src/Compatibility/ControlGallery/src/iOS/PlatformSpecificCoreGalleryFactory.cs index a0fc10b98716..ac5ffc8f5167 100644 --- a/src/Compatibility/ControlGallery/src/iOS/PlatformSpecificCoreGalleryFactory.cs +++ b/src/Compatibility/ControlGallery/src/iOS/PlatformSpecificCoreGalleryFactory.cs @@ -16,11 +16,7 @@ public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFa public IEnumerable<(Func Create, string Title)> GetPages() { -#if HAVE_OPENTK - yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy"); -#else return null; -#endif } } } diff --git a/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageContainer.cs b/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageContainer.cs index 3f78667948e4..d1ae9d6c44e0 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageContainer.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/FlyoutPageContainer.cs @@ -222,7 +222,7 @@ protected override void Dispose(bool disposing) if (disposing) { - if (_currentFragment != null && !FragmentManager.IsDestroyed) + if (_currentFragment != null && !FragmentManager.IsDestroyed(Context)) { FragmentTransaction transaction = FragmentManager.BeginTransactionEx(); transaction.RemoveEx(_currentFragment); diff --git a/src/Compatibility/Core/src/Android/AppCompat/FormsAppCompatActivity.cs b/src/Compatibility/Core/src/Android/AppCompat/FormsAppCompatActivity.cs index 5cdce59371da..7a433c74536b 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/FormsAppCompatActivity.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/FormsAppCompatActivity.cs @@ -26,7 +26,9 @@ public enum ActivationFlags : long DisableSetStatusBarColor = 1 << 0, } +#pragma warning disable CA1815 // Override equals and operator equals on value types public struct ActivationOptions +#pragma warning restore CA1815 // Override equals and operator equals on value types { public ActivationOptions(Bundle bundle) { diff --git a/src/Compatibility/Core/src/Android/AppCompat/FormsFragmentPagerAdapter.cs b/src/Compatibility/Core/src/Android/AppCompat/FormsFragmentPagerAdapter.cs index 965aaed98ef5..992b18c70a8c 100644 --- a/src/Compatibility/Core/src/Android/AppCompat/FormsFragmentPagerAdapter.cs +++ b/src/Compatibility/Core/src/Android/AppCompat/FormsFragmentPagerAdapter.cs @@ -84,7 +84,7 @@ protected override void Dispose(bool disposing) _page = null; - if (!_fragmentManager.IsDestroyed) + if (!_fragmentManager.IsDestroyed(_page?.Handler?.MauiContext?.Context)) { FragmentTransaction transaction = _fragmentManager.BeginTransactionEx(); diff --git a/src/Compatibility/Core/src/Android/FastRenderers/AutomationPropertiesProvider.cs b/src/Compatibility/Core/src/Android/FastRenderers/AutomationPropertiesProvider.cs index c3a0c2c5f05a..d5db18c31acb 100644 --- a/src/Compatibility/Core/src/Android/FastRenderers/AutomationPropertiesProvider.cs +++ b/src/Compatibility/Core/src/Android/FastRenderers/AutomationPropertiesProvider.cs @@ -92,6 +92,7 @@ void OnElementChanged(object sender, VisualElementChangedEventArgs e) void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { +#pragma warning disable CS0618 // Type or member is obsolete if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName) { SetContentDescription(); @@ -108,6 +109,7 @@ void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { SetLabeledBy(); } +#pragma warning restore CS0618 // Type or member is obsolete } } } diff --git a/src/Compatibility/Core/src/Android/Forms.cs b/src/Compatibility/Core/src/Android/Forms.cs index 1d9e8ad73840..22821331f35f 100644 --- a/src/Compatibility/Core/src/Android/Forms.cs +++ b/src/Compatibility/Core/src/Android/Forms.cs @@ -29,9 +29,11 @@ namespace Microsoft.Maui.Controls.Compatibility { [Obsolete] +#pragma warning disable CA1815 // Override equals and operator equals on value types public struct InitializationOptions { public struct EffectScope +#pragma warning restore CA1815 // Override equals and operator equals on value types { public string Name; public ExportEffectAttribute[] Effects; diff --git a/src/Compatibility/Core/src/Android/Renderers/OpenGLViewRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/OpenGLViewRenderer.cs deleted file mode 100644 index 9ce5f95d6743..000000000000 --- a/src/Compatibility/Core/src/Android/Renderers/OpenGLViewRenderer.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.ComponentModel; -using Android.Content; -using Android.Opengl; -using Javax.Microedition.Khronos.Opengles; -using Microsoft.Maui.Controls.Platform; -using Microsoft.Maui.Graphics; -using EGLConfig = Javax.Microedition.Khronos.Egl.EGLConfig; -using Object = Java.Lang.Object; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.Android -{ - [Obsolete] - internal class OpenGLViewRenderer : ViewRenderer - { - bool _disposed; - - public OpenGLViewRenderer(Context context) : base(context) - { - AutoPackage = false; - } - - protected override void Dispose(bool disposing) - { - if (!_disposed && disposing) - { - _disposed = true; - - if (Element != null) - ((IOpenGlViewController)Element).DisplayRequested -= Render; - } - base.Dispose(disposing); - } - - protected override GLSurfaceView CreateNativeControl() - { - return new GLSurfaceView(Context); - } - - protected override void OnElementChanged(ElementChangedEventArgs e) - { - base.OnElementChanged(e); - - if (e.OldElement != null) - ((IOpenGlViewController)Element).DisplayRequested -= Render; - - if (e.NewElement != null) - { - GLSurfaceView surfaceView = Control; - if (surfaceView == null) - { - surfaceView = CreateNativeControl(); - surfaceView.SetEGLContextClientVersion(2); - SetNativeControl(surfaceView); - } - - ((IOpenGlViewController)Element).DisplayRequested += Render; - surfaceView.SetRenderer(new Renderer(Element)); - SetRenderMode(); - } - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) - { - base.OnElementPropertyChanged(sender, e); - - if (e.PropertyName == OpenGLView.HasRenderLoopProperty.PropertyName) - SetRenderMode(); - } - - void Render(object sender, EventArgs eventArgs) - { - if (Element.HasRenderLoop) - return; - Control.RequestRender(); - } - - void SetRenderMode() - { - Control.RenderMode = Element.HasRenderLoop ? Rendermode.Continuously : Rendermode.WhenDirty; - } - - class Renderer : Object, GLSurfaceView.IRenderer - { - readonly OpenGLView _model; - Rect _rect; - - public Renderer(OpenGLView model) - { - _model = model; - } - - public void OnDrawFrame(IGL10 gl) - { - Action onDisplay = _model.OnDisplay; - if (onDisplay == null) - return; - onDisplay(_rect); - } - - public void OnSurfaceChanged(IGL10 gl, int width, int height) - { - _rect = new Rect(0.0, 0.0, width, height); - } - - public void OnSurfaceCreated(IGL10 gl, EGLConfig config) - { - } - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/Android/VisualElementRenderer.cs b/src/Compatibility/Core/src/Android/VisualElementRenderer.cs index ed5fa9bfb339..335af78c9828 100644 --- a/src/Compatibility/Core/src/Android/VisualElementRenderer.cs +++ b/src/Compatibility/Core/src/Android/VisualElementRenderer.cs @@ -300,10 +300,10 @@ protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEv protected override void OnLayout(bool changed, int l, int t, int r, int b) { - if (Element == null) - return; - - UpdateLayout(((IElementController)Element).LogicalChildren); + if (Element is IElementController controller) + { + UpdateLayout(controller.LogicalChildren); + } } public override void Draw(Canvas canvas) diff --git a/src/Compatibility/Core/src/AppHostBuilderExtensions.Tizen.cs b/src/Compatibility/Core/src/AppHostBuilderExtensions.Tizen.cs index 16733fe69a85..f1ea9722b4c4 100644 --- a/src/Compatibility/Core/src/AppHostBuilderExtensions.Tizen.cs +++ b/src/Compatibility/Core/src/AppHostBuilderExtensions.Tizen.cs @@ -1,7 +1,7 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Maui.Controls.Compatibility; using Microsoft.Maui.Hosting; using Microsoft.Maui.LifecycleEvents; -using Microsoft.Maui.Controls.Compatibility; -using Microsoft.Extensions.DependencyInjection; using TDeviceInfo = Tizen.UIExtensions.Common.DeviceInfo; namespace Microsoft.Maui.Controls.Compatibility.Hosting diff --git a/src/Compatibility/Core/src/AppHostBuilderExtensions.cs b/src/Compatibility/Core/src/AppHostBuilderExtensions.cs index 0604c85e3165..a425c83983b6 100644 --- a/src/Compatibility/Core/src/AppHostBuilderExtensions.cs +++ b/src/Compatibility/Core/src/AppHostBuilderExtensions.cs @@ -36,7 +36,6 @@ #elif TIZEN using Microsoft.Maui.Controls.Compatibility.Platform.Tizen; using Microsoft.Maui.Graphics.Skia; -using OpenGLViewRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer; using StreamImagesourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.StreamImageSourceHandler; using ImageLoaderSourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.UriImageSourceHandler; using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer; @@ -77,11 +76,6 @@ public static MauiAppBuilder UseMauiCompatibility(this MauiAppBuilder builder) #if !WINDOWS #if !(MACCATALYST || MACOS) -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete - handlers.TryAddCompatibilityRenderer(typeof(OpenGLView), typeof(OpenGLViewRenderer)); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning restore CS0618 // Type or member is obsolete #endif #else #pragma warning disable CS0618 // Type or member is obsolete diff --git a/src/Compatibility/Core/src/Compatibility.csproj b/src/Compatibility/Core/src/Compatibility.csproj index 1bed9d1a8ea9..b3b37f710696 100644 --- a/src/Compatibility/Core/src/Compatibility.csproj +++ b/src/Compatibility/Core/src/Compatibility.csproj @@ -8,7 +8,7 @@ iOS\ Windows\ Tizen\ - false + true true true true @@ -20,7 +20,7 @@ $(DefineConstants);WINDOWS - + @@ -57,4 +57,6 @@ + + diff --git a/src/Compatibility/Core/src/GTK/Compatibility.GTK.csproj b/src/Compatibility/Core/src/GTK/Compatibility.GTK.csproj index 4175f802f74d..91693d8ab489 100644 --- a/src/Compatibility/Core/src/GTK/Compatibility.GTK.csproj +++ b/src/Compatibility/Core/src/GTK/Compatibility.GTK.csproj @@ -129,7 +129,6 @@ - @@ -197,7 +196,6 @@ - diff --git a/src/Compatibility/Core/src/GTK/Controls/OpenGLView.cs b/src/Compatibility/Core/src/GTK/Controls/OpenGLView.cs deleted file mode 100644 index ae39a222d3ca..000000000000 --- a/src/Compatibility/Core/src/GTK/Controls/OpenGLView.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using Gtk; -using OpenTK.GLWidget; -using OpenTK.Graphics; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.GTK.Controls -{ - public class OpenGLView : EventBox - { - private GLWidget _glWidget; - - private Action _action; - private bool _hasLoop; - protected uint _timerId; - - public OpenGLView() - { - if (!GtkOpenGL.IsInitialized) - throw new InvalidOperationException("call GtkOpenGL.Init() before use OpenGLView"); - - GraphicsMode graphicsMode = GraphicsMode.Default; - - _glWidget = new GLWidget(GraphicsMode.Default); - - _glWidget.SingleBuffer = true; - _glWidget.ColorBPP = graphicsMode.ColorFormat.BitsPerPixel; - _glWidget.AccumulatorBPP = graphicsMode.AccumulatorFormat.BitsPerPixel; - _glWidget.DepthBPP = graphicsMode.Depth; - _glWidget.Samples = graphicsMode.Samples; - _glWidget.StencilBPP = graphicsMode.Stencil; - _glWidget.Stereo = graphicsMode.Stereo; - _glWidget.GlVersionMajor = 2; - _glWidget.GlVersionMinor = 1; - _glWidget.CanFocus = true; - _glWidget.GraphicsContextFlags = GraphicsContextFlags.Default; - - _glWidget.Initialized += new EventHandler(OnGLWidgetInitialized); - _glWidget.RenderFrame += new EventHandler(OnGLWidgetRenderer); - _glWidget.Destroyed += new EventHandler(OnGLWidgetDestroy); - - _glWidget.AddEvents((int)Gdk.EventMask.AllEventsMask); - - Add(_glWidget); - - _glWidget.ShowAll(); - } - - public Action OnDisplay - { - get { return _action; } - set { _action = value; } - } - - public bool HasRenderLoop - { - get { return _hasLoop; } - set { _hasLoop = value; } - } - - protected void OnGLWidgetInitialized(object sender, EventArgs e) - { - _timerId = GLib.Timeout.Add(16, new GLib.TimeoutHandler(Render)); - } - - protected void OnGLWidgetRenderer(object sender, EventArgs e) - { - _timerId = GLib.Timeout.Add(16, new GLib.TimeoutHandler(Render)); - } - - protected void OnGLWidgetDestroy(object sender, EventArgs e) - { - GLib.Source.Remove(_timerId); - } - - public override void Destroy() - { - base.Destroy(); - - if (_glWidget != null) - { - _glWidget.Destroy(); - } - } - - private bool Render() - { - if (!HasRenderLoop) - { - return false; - } - else - { - OnDisplay(new Rectangle(0, 0, WidthRequest, HeightRequest)); - - return true; - } - } - } -} diff --git a/src/Compatibility/Core/src/GTK/Properties/AssemblyInfo.cs b/src/Compatibility/Core/src/GTK/Properties/AssemblyInfo.cs index a6aeaa384cb1..98b31b3afbee 100644 --- a/src/Compatibility/Core/src/GTK/Properties/AssemblyInfo.cs +++ b/src/Compatibility/Core/src/GTK/Properties/AssemblyInfo.cs @@ -28,7 +28,6 @@ #pragma warning restore CS0618 // Type or member is obsolete [assembly: ExportRenderer(typeof(FlyoutPage), typeof(FlyoutPageRenderer))] [assembly: ExportRenderer(typeof(NavigationPage), typeof(NavigationPageRenderer))] -[assembly: ExportRenderer(typeof(OpenGLView), typeof(OpenGLViewRenderer))] [assembly: ExportRenderer(typeof(Page), typeof(PageRenderer))] [assembly: ExportRenderer(typeof(Picker), typeof(PickerRenderer))] [assembly: ExportRenderer(typeof(ProgressBar), typeof(ProgressBarRenderer))] diff --git a/src/Compatibility/Core/src/GTK/Renderers/OpenGLViewRenderer.cs b/src/Compatibility/Core/src/GTK/Renderers/OpenGLViewRenderer.cs deleted file mode 100644 index ba030bbaa6bc..000000000000 --- a/src/Compatibility/Core/src/GTK/Renderers/OpenGLViewRenderer.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.ComponentModel; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.GTK.Renderers -{ - public class OpenGLViewRenderer : ViewRenderer - { - private Controls.OpenGLView _openGlView; - private bool _disposed; - - protected override void Dispose(bool disposing) - { - if (!_disposed && disposing) - { - _disposed = true; - - if (Element != null) - ((IOpenGlViewController)Element).DisplayRequested -= OnDisplay; - } - - base.Dispose(disposing); - } - - protected override void OnElementChanged(ElementChangedEventArgs e) - { - if (e.OldElement != null) - ((IOpenGlViewController)e.OldElement).DisplayRequested -= OnDisplay; - - if (e.NewElement != null) - { - // The Open Toolkit library is a low-level C# binding for OpenGL, OpenGL ES and OpenAL. - // Runs on Linux, macOS and Windows with GTK# (and more platforms). - _openGlView = new Controls.OpenGLView(); - SetNativeControl(_openGlView); - - ((IOpenGlViewController)e.NewElement).DisplayRequested += OnDisplay; - - SetRenderMode(); - SetupRenderAction(); - } - - base.OnElementChanged(e); - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) - { - base.OnElementPropertyChanged(sender, e); - - if (e.PropertyName == OpenGLView.HasRenderLoopProperty.PropertyName) - { - SetRenderMode(); - SetupRenderAction(); - } - } - - public void OnDisplay(object sender, EventArgs eventArgs) - { - if (Element.HasRenderLoop) - return; - - SetupRenderAction(); - } - - private void SetRenderMode() - { - Control.HasRenderLoop = Element.HasRenderLoop; - } - - private void SetupRenderAction() - { - if (!Element.HasRenderLoop) - return; - - var model = Element; - var onDisplay = model.OnDisplay; - - if (_openGlView != null) - { - _openGlView.OnDisplay = onDisplay; - } - } - } -} diff --git a/src/Compatibility/Core/src/MacOS/Compatibility.macOS.csproj b/src/Compatibility/Core/src/MacOS/Compatibility.macOS.csproj index 002a434d93a1..458ca5871531 100644 --- a/src/Compatibility/Core/src/MacOS/Compatibility.macOS.csproj +++ b/src/Compatibility/Core/src/MacOS/Compatibility.macOS.csproj @@ -131,8 +131,6 @@ - - diff --git a/src/Compatibility/Core/src/MacOS/Controls/MacOSOpenGLView.cs b/src/Compatibility/Core/src/MacOS/Controls/MacOSOpenGLView.cs deleted file mode 100644 index 47634acd5cd0..000000000000 --- a/src/Compatibility/Core/src/MacOS/Controls/MacOSOpenGLView.cs +++ /dev/null @@ -1,12 +0,0 @@ -using AppKit; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS -{ - //TODO: Still not implemented on macOS - public class MacOSOpenGLView : NSView - { - public MacOSOpenGLView() - { - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/MacOS/Properties/AssemblyInfo.cs b/src/Compatibility/Core/src/MacOS/Properties/AssemblyInfo.cs index e842345ef5de..300b18a9f65e 100644 --- a/src/Compatibility/Core/src/MacOS/Properties/AssemblyInfo.cs +++ b/src/Compatibility/Core/src/MacOS/Properties/AssemblyInfo.cs @@ -33,7 +33,6 @@ [assembly: ExportRenderer(typeof(Entry), typeof(EntryRenderer))] [assembly: ExportRenderer(typeof(Frame), typeof(FrameRenderer))] [assembly: ExportRenderer(typeof(Image), typeof(ImageRenderer))] -[assembly: ExportRenderer(typeof(OpenGLView), typeof(OpenGLViewRenderer))] [assembly: ExportRenderer(typeof(Picker), typeof(PickerRenderer))] [assembly: ExportRenderer(typeof(ProgressBar), typeof(ProgressBarRenderer))] [assembly: ExportRenderer(typeof(SearchBar), typeof(SearchBarRenderer))] diff --git a/src/Compatibility/Core/src/MacOS/Renderers/OpenGLViewRenderer.cs b/src/Compatibility/Core/src/MacOS/Renderers/OpenGLViewRenderer.cs deleted file mode 100644 index 86a7458f4945..000000000000 --- a/src/Compatibility/Core/src/MacOS/Renderers/OpenGLViewRenderer.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.ComponentModel; -using CoreVideo; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.MacOS -{ - // ReSharper disable once InconsistentNaming - internal class OpenGLViewRenderer : ViewRenderer - { - CVDisplayLink _displayLink; - - public void Display(object sender, EventArgs eventArgs) - { - if (Element.HasRenderLoop) - return; - SetupRenderLoop(true); - } - - protected override void Dispose(bool disposing) - { - if (_displayLink != null) - { - _displayLink.Dispose(); - _displayLink = null; - - if (Element != null) - Element.DisplayRequested -= Display; - } - - base.Dispose(disposing); - } - - protected override void OnElementChanged(ElementChangedEventArgs e) - { - if (e.OldElement != null) - e.OldElement.DisplayRequested -= Display; - - if (e.NewElement != null) - { - //var context = new EAGLContext(EAGLRenderingAPI.OpenGLES2); - //var glkView = new GLKView(RectangleF.Empty) { Context = context, DrawableDepthFormat = GLKViewDrawableDepthFormat.Format24, Delegate = new Delegate(e.NewElement) }; - var glkView = new MacOSOpenGLView(); - SetNativeControl(glkView); - - e.NewElement.DisplayRequested += Display; - - SetupRenderLoop(false); - } - - base.OnElementChanged(e); - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) - { - base.OnElementPropertyChanged(sender, e); - - if (e.PropertyName == OpenGLView.HasRenderLoopProperty.PropertyName) - SetupRenderLoop(false); - } - - void SetupRenderLoop(bool oneShot) - { - if (_displayLink != null) - return; - if (!oneShot && !Element.HasRenderLoop) - return; - - _displayLink = new CVDisplayLink(); - - //.Create(() => - //{ - // var control = Control; - // var model = Element; - // if (control != null) - // control.Display(); - // if (control == null || model == null || !model.HasRenderLoop) - // { - // _displayLink.Invalidate(); - // _displayLink.Dispose(); - // _displayLink = null; - // } - //}); - //_displayLink.(NSRunLoop.Current, NSRunLoop.NSDefaultRunLoopMode); - } - - //class Delegate : GLKViewDelegate - //{ - // readonly OpenGLView _model; - - // public Delegate(OpenGLView model) - // { - // _model = model; - // } - - // public override void DrawInRect(GLKView view, RectangleF rect) - // { - // var onDisplay = _model.OnDisplay; - // if (onDisplay == null) - // return; - // onDisplay(rect.ToRectangle()); - // } - //} - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/Tizen/Extensions/ColorExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/ColorExtensions.cs index eeddc6a3af62..36a3e6a60012 100644 --- a/src/Compatibility/Core/src/Tizen/Extensions/ColorExtensions.cs +++ b/src/Compatibility/Core/src/Tizen/Extensions/ColorExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Maui.Graphics; -using TColor = Tizen.UIExtensions.Common.Color; using NColor = Tizen.NUI.Color; +using TColor = Tizen.UIExtensions.Common.Color; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen { diff --git a/src/Compatibility/Core/src/Tizen/Extensions/DensityIndependentPixelExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/DensityIndependentPixelExtensions.cs index c67889f81364..eacaf83cce7a 100644 --- a/src/Compatibility/Core/src/Tizen/Extensions/DensityIndependentPixelExtensions.cs +++ b/src/Compatibility/Core/src/Tizen/Extensions/DensityIndependentPixelExtensions.cs @@ -1,8 +1,8 @@ using Microsoft.Maui.Graphics; +using NSize = Tizen.NUI.Size2D; using Rect = Microsoft.Maui.Graphics.Rect; using TRect = Tizen.UIExtensions.Common.Rect; using TSize = Tizen.UIExtensions.Common.Size; -using NSize = Tizen.NUI.Size2D; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen { diff --git a/src/Compatibility/Core/src/Tizen/Extensions/GeometryExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/GeometryExtensions.cs index ceb048763645..072d623e9399 100644 --- a/src/Compatibility/Core/src/Tizen/Extensions/GeometryExtensions.cs +++ b/src/Compatibility/Core/src/Tizen/Extensions/GeometryExtensions.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using SkiaSharp; using Microsoft.Maui.Controls.Shapes; -using Rect = Microsoft.Maui.Graphics.Rect; +using SkiaSharp; using Point = Microsoft.Maui.Graphics.Point; +using Rect = Microsoft.Maui.Graphics.Rect; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen diff --git a/src/Compatibility/Core/src/Tizen/Extensions/TransformExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/TransformExtensions.cs index 63805730a753..5615170bc18b 100644 --- a/src/Compatibility/Core/src/Tizen/Extensions/TransformExtensions.cs +++ b/src/Compatibility/Core/src/Tizen/Extensions/TransformExtensions.cs @@ -1,5 +1,5 @@ -using SkiaSharp; using Microsoft.Maui.Controls.Shapes; +using SkiaSharp; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen { diff --git a/src/Compatibility/Core/src/Tizen/Forms.cs b/src/Compatibility/Core/src/Tizen/Forms.cs index 52ba88f09b07..be2a65eeff8a 100644 --- a/src/Compatibility/Core/src/Tizen/Forms.cs +++ b/src/Compatibility/Core/src/Tizen/Forms.cs @@ -5,12 +5,12 @@ using System.Reflection; using Microsoft.Maui.Controls.Compatibility.Platform.Tizen; using Microsoft.Maui.Controls.Internals; -using Tizen.Applications; using Microsoft.Maui.Devices; +using Tizen.Applications; using Color = Microsoft.Maui.Graphics.Color; using NView = Tizen.NUI.BaseComponents.View; -using TDeviceInfo = Tizen.UIExtensions.Common.DeviceInfo; using Size = Microsoft.Maui.Graphics.Size; +using TDeviceInfo = Tizen.UIExtensions.Common.DeviceInfo; namespace Microsoft.Maui.Controls.Compatibility { @@ -28,6 +28,7 @@ public enum PlatformType } [Obsolete] +#pragma warning disable CA1815 // Override equals and operator equals on value types public class InitializationOptions { public CoreApplication Context { get; set; } @@ -47,6 +48,7 @@ public class InitializationOptions public DisplayResolutionUnit DisplayResolutionUnit { get; set; } public struct EffectScope +#pragma warning restore CA1815 // Override equals and operator equals on value types { public string Name; public ExportEffectAttribute[] Effects; diff --git a/src/Compatibility/Core/src/Tizen/Gesture/PanGestureHandler.cs b/src/Compatibility/Core/src/Tizen/Gesture/PanGestureHandler.cs index ec2a1e435ce1..a996a314ba05 100644 --- a/src/Compatibility/Core/src/Tizen/Gesture/PanGestureHandler.cs +++ b/src/Compatibility/Core/src/Tizen/Gesture/PanGestureHandler.cs @@ -1,6 +1,6 @@ +using GestureStateType = Tizen.NUI.Gesture.StateType; using NGestureDetector = Tizen.NUI.GestureDetector; using PanGestureDetector = Tizen.NUI.PanGestureDetector; -using GestureStateType = Tizen.NUI.Gesture.StateType; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen { diff --git a/src/Compatibility/Core/src/Tizen/Renderers/BoxViewRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/BoxViewRenderer.cs index cd7fae1bd551..f89378221de6 100644 --- a/src/Compatibility/Core/src/Tizen/Renderers/BoxViewRenderer.cs +++ b/src/Compatibility/Core/src/Tizen/Renderers/BoxViewRenderer.cs @@ -1,6 +1,6 @@ -using NView = Tizen.NUI.BaseComponents.View; -using Tizen.UIExtensions.NUI; using Microsoft.Maui.Controls.Platform; +using Tizen.UIExtensions.NUI; +using NView = Tizen.NUI.BaseComponents.View; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen { diff --git a/src/Compatibility/Core/src/Tizen/Renderers/VisualElementRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/VisualElementRenderer.cs index 01a64986dfbf..316657eed71a 100644 --- a/src/Compatibility/Core/src/Tizen/Renderers/VisualElementRenderer.cs +++ b/src/Compatibility/Core/src/Tizen/Renderers/VisualElementRenderer.cs @@ -3,17 +3,17 @@ using System.ComponentModel; using System.Linq; using Microsoft.Maui.Controls.Internals; -using Size = Microsoft.Maui.Graphics.Size; -using Rect = Microsoft.Maui.Graphics.Rect; -using Point = Microsoft.Maui.Graphics.Point; using Microsoft.Maui.Controls.Platform; using Tizen.NUI; using Tizen.UIExtensions.Common; -using Specific = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific.VisualElement; -using XFocusDirection = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific.FocusDirection; +using Tizen.UIExtensions.NUI; using NView = Tizen.NUI.BaseComponents.View; +using Point = Microsoft.Maui.Graphics.Point; +using Rect = Microsoft.Maui.Graphics.Rect; +using Size = Microsoft.Maui.Graphics.Size; +using Specific = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific.VisualElement; using TPoint = Tizen.UIExtensions.Common.Point; -using Tizen.UIExtensions.NUI; +using XFocusDirection = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific.FocusDirection; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen { diff --git a/src/Compatibility/Core/src/WPF/Properties/AssemblyInfo.cs b/src/Compatibility/Core/src/WPF/Properties/AssemblyInfo.cs index f4118d8b322b..7e336e347ee7 100644 --- a/src/Compatibility/Core/src/WPF/Properties/AssemblyInfo.cs +++ b/src/Compatibility/Core/src/WPF/Properties/AssemblyInfo.cs @@ -32,7 +32,6 @@ [assembly: ExportRenderer(typeof(ActivityIndicator), typeof(ActivityIndicatorRenderer))] [assembly: ExportRenderer(typeof(Frame), typeof(FrameRenderer))] [assembly: ExportRenderer(typeof(ListView), typeof(ListViewRenderer))] -[assembly: ExportRenderer(typeof(OpenGLView), typeof(OpenGLViewRenderer))] [assembly: ExportRenderer(typeof(ImageButton), typeof(ImageButtonRenderer))] [assembly: ExportRenderer(typeof(EmbeddedFont), typeof(EmbeddedFontLoader))] [assembly: ExportRenderer(typeof(Path), typeof(PathRenderer))] diff --git a/src/Compatibility/Core/src/WPF/Renderers/OpenGLViewRenderer.cs b/src/Compatibility/Core/src/WPF/Renderers/OpenGLViewRenderer.cs deleted file mode 100644 index d65b6d66f138..000000000000 --- a/src/Compatibility/Core/src/WPF/Renderers/OpenGLViewRenderer.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using System.ComponentModel; -using System.Windows.Forms; -using System.Windows.Forms.Integration; -using System.Windows.Threading; -using OpenTK; -using OpenTK.Graphics; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.WPF -{ - public class OpenGLViewRenderer : ViewRenderer - { - private GLControl _glControl; - private DispatcherTimer _timer; - private Action _action; - private bool _hasRenderLoop; - private bool _disposed; - - public Action Action - { - get { return _action; } - set { _action = value; } - } - - public bool HasRenderLoop - { - get { return _hasRenderLoop; } - set { _hasRenderLoop = value; } - } - - protected override void Dispose(bool disposing) - { - if (!_disposed && disposing) - { - _disposed = true; - - if (Element != null) - ((IOpenGlViewController)Element).DisplayRequested -= Render; - - if (_glControl != null) - _glControl.Paint -= OnPaint; - - if (_timer != null) - _timer.Tick -= OnTick; - } - - base.Dispose(disposing); - } - - protected override void OnElementChanged(ElementChangedEventArgs e) - { - if (e.OldElement != null) - ((IOpenGlViewController)e.OldElement).DisplayRequested -= Render; - - if (e.NewElement != null) - { - var windowsFormsHost = new WindowsFormsHost(); - _glControl = new GLControl(new GraphicsMode(32, 24), 2, 0, GraphicsContextFlags.Default); - _glControl.MakeCurrent(); - _glControl.Dock = DockStyle.Fill; - - _glControl.Paint += OnPaint; - - windowsFormsHost.Child = _glControl; - SetNativeControl(windowsFormsHost); - - _timer = new DispatcherTimer(); - _timer.Interval = TimeSpan.FromMilliseconds(16); - _timer.Tick += OnTick; - _timer.Start(); - - ((IOpenGlViewController)e.NewElement).DisplayRequested += Render; - - SetRenderMode(); - SetupRenderAction(); - } - - base.OnElementChanged(e); - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) - { - base.OnElementPropertyChanged(sender, e); - - if (e.PropertyName == OpenGLView.HasRenderLoopProperty.PropertyName) - { - SetRenderMode(); - SetupRenderAction(); - } - } - - public void Render(object sender, EventArgs eventArgs) - { - if (HasRenderLoop) - return; - - SetupRenderAction(); - } - - private void SetRenderMode() - { - HasRenderLoop = Element.HasRenderLoop; - } - - private void SetupRenderAction() - { - var model = Element; - var onDisplay = model.OnDisplay; - - Action = onDisplay; - } - - private void OnPaint(object sender, PaintEventArgs e) - { - if (_glControl == null) - { - return; - } - - _glControl.MakeCurrent(); - Action.Invoke(new Rectangle(0, 0, _glControl.Width, _glControl.Height)); - _glControl.SwapBuffers(); - } - - private void OnTick(object sender, EventArgs e) - { - if (!HasRenderLoop) - return; - - _glControl.Invalidate(); - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/Windows/AccessibilityExtensions.cs b/src/Compatibility/Core/src/Windows/AccessibilityExtensions.cs index 32b334ac86ab..dbabe5c488a7 100644 --- a/src/Compatibility/Core/src/Windows/AccessibilityExtensions.cs +++ b/src/Compatibility/Core/src/Windows/AccessibilityExtensions.cs @@ -22,9 +22,13 @@ static string ConcatenateNameAndHint(Element Element) { string separator; +#pragma warning disable CS0618 // Type or member is obsolete var name = (string)Element.GetValue(AutomationProperties.NameProperty); +#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning disable CS0618 // Type or member is obsolete var hint = (string)Element.GetValue(AutomationProperties.HelpTextProperty); +#pragma warning restore CS0618 // Type or member is obsolete if (string.IsNullOrWhiteSpace(name) || string.IsNullOrWhiteSpace(hint)) diff --git a/src/Compatibility/Core/src/Windows/Forms.cs b/src/Compatibility/Core/src/Windows/Forms.cs index 03f2af910ed0..b9d42d490fd5 100644 --- a/src/Compatibility/Core/src/Windows/Forms.cs +++ b/src/Compatibility/Core/src/Windows/Forms.cs @@ -13,7 +13,9 @@ namespace Microsoft.Maui.Controls.Compatibility { [Obsolete] +#pragma warning disable CA1815 // Override equals and operator equals on value types public struct InitializationOptions +#pragma warning restore CA1815 // Override equals and operator equals on value types { public InitializationOptions(UI.Xaml.LaunchActivatedEventArgs args) { diff --git a/src/Compatibility/Core/src/iOS/Forms.cs b/src/Compatibility/Core/src/iOS/Forms.cs index ca1031f43363..ab1b97cec3b4 100644 --- a/src/Compatibility/Core/src/iOS/Forms.cs +++ b/src/Compatibility/Core/src/iOS/Forms.cs @@ -33,7 +33,9 @@ namespace Microsoft.Maui.Controls.Compatibility { [Obsolete] +#pragma warning disable CA1815 // Override equals and operator equals on value types public struct InitializationOptions +#pragma warning restore CA1815 // Override equals and operator equals on value types { public InitializationFlags Flags; } diff --git a/src/Compatibility/Core/src/iOS/Renderers/OpenGLViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/OpenGLViewRenderer.cs deleted file mode 100644 index d667cd1c2aa8..000000000000 --- a/src/Compatibility/Core/src/iOS/Renderers/OpenGLViewRenderer.cs +++ /dev/null @@ -1,123 +0,0 @@ -#if !(MACCATALYST || MACOS) -using System; -using System.ComponentModel; -using System.Runtime.Versioning; -using CoreAnimation; -using Foundation; -using GLKit; -using Microsoft.Maui.Controls.Platform; -using OpenGLES; -using RectangleF = CoreGraphics.CGRect; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS -{ - [System.Obsolete] - [UnsupportedOSPlatform("ios12.0")] - [UnsupportedOSPlatform("tvos12.0")] - internal class OpenGLViewRenderer : ViewRenderer - { - CADisplayLink _displayLink; - - [Microsoft.Maui.Controls.Internals.Preserve(Conditional = true)] - public OpenGLViewRenderer() - { - - } - - public void Display(object sender, EventArgs eventArgs) - { - if (Element.HasRenderLoop) - return; - SetupRenderLoop(true); - } - - protected override void Dispose(bool disposing) - { - if (_displayLink != null) - { - _displayLink.Invalidate(); - _displayLink.Dispose(); - _displayLink = null; - - if (Element != null) - Element.DisplayRequested -= Display; - } - - base.Dispose(disposing); - } - - protected override void OnElementChanged(ElementChangedEventArgs e) - { - if (e.OldElement != null) - e.OldElement.DisplayRequested -= Display; - - if (e.NewElement != null) - { - var context = new EAGLContext(EAGLRenderingAPI.OpenGLES2); - var glkView = new GLKView(RectangleF.Empty) - { - Context = context, - DrawableDepthFormat = GLKViewDrawableDepthFormat.Format24, - Delegate = new Delegate(e.NewElement) - }; - SetNativeControl(glkView); - - e.NewElement.DisplayRequested += Display; - - SetupRenderLoop(false); - } - - base.OnElementChanged(e); - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) - { - base.OnElementPropertyChanged(sender, e); - - if (e.PropertyName == OpenGLView.HasRenderLoopProperty.PropertyName) - SetupRenderLoop(false); - } - - void SetupRenderLoop(bool oneShot) - { - if (_displayLink != null) - return; - if (!oneShot && !Element.HasRenderLoop) - return; - - _displayLink = CADisplayLink.Create(() => - { - var control = Control; - var model = Element; - if (control != null) - control.Display(); - if (control == null || model == null || !model.HasRenderLoop) - { - _displayLink?.Invalidate(); - _displayLink?.Dispose(); - _displayLink = null; - } - }); - _displayLink.AddToRunLoop(NSRunLoop.Current, NSRunLoopMode.Common); - } - - class Delegate : GLKViewDelegate, IGLKViewDelegate - { - readonly OpenGLView _model; - - public Delegate(OpenGLView model) - { - _model = model; - } - - public override void DrawInRect(GLKView view, RectangleF rect) - { - var onDisplay = _model.OnDisplay; - if (onDisplay == null) - return; - onDisplay(rect.ToRectangle()); - } - } - } -} -#endif \ No newline at end of file diff --git a/src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj b/src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj index f5000b20f3f2..36553b5090eb 100644 --- a/src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj +++ b/src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Controls/Foldable/src/Controls.Foldable.csproj b/src/Controls/Foldable/src/Controls.Foldable.csproj index 48cc66a92b56..05d41821f0c9 100644 --- a/src/Controls/Foldable/src/Controls.Foldable.csproj +++ b/src/Controls/Foldable/src/Controls.Foldable.csproj @@ -17,7 +17,7 @@ .NET MAUI Foldable provides additional APIs to better support foldable mobile devices. icon.png - + @@ -41,4 +41,6 @@ + + diff --git a/src/Controls/Maps/src/Controls.Maps.csproj b/src/Controls/Maps/src/Controls.Maps.csproj index a1e02d622a5e..f9ae195f6822 100644 --- a/src/Controls/Maps/src/Controls.Maps.csproj +++ b/src/Controls/Maps/src/Controls.Maps.csproj @@ -31,4 +31,7 @@ + + + \ No newline at end of file diff --git a/src/Controls/docs/Microsoft.Maui.Controls/OpenGLView.xml b/src/Controls/docs/Microsoft.Maui.Controls/OpenGLView.xml deleted file mode 100644 index 417a4d53bf3b..000000000000 --- a/src/Controls/docs/Microsoft.Maui.Controls/OpenGLView.xml +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - - Microsoft.Maui.Controls.Core - 0.0.0.0 - 1.0.0.0 - 1.1.0.0 - 1.2.0.0 - 1.3.0.0 - 1.4.0.0 - 1.5.0.0 - 2.0.0.0 - - - Microsoft.Maui.Controls.View - - - - Microsoft.Maui.Controls.IElementConfiguration<Microsoft.Maui.Controls.OpenGLView> - - - Microsoft.Maui.Controls.IElementController - - - Microsoft.Maui.Controls.IOpenGlViewController - - - Microsoft.Maui.Controls.IViewController - - - Microsoft.Maui.Controls.IVisualElementController - - - - - Microsoft.Maui.Controls.RenderWith(typeof(Microsoft.Maui.Controls.Platform._OpenGLViewRenderer)) - - - - A that displays OpenGL content. - - - s are easiest to program using Shared Projects, in which case the reference to OpenTK is straightforward. The following example shows a simple OpenGL app with a render loop: - - { - - GL.ClearColor (red, green, blue, 1.0f); - GL.Clear ((ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit)); - - red += 0.01f; - if (red >= 1.0f) - red -= 1.0f; - green += 0.02f; - if (green >= 1.0f) - green -= 1.0f; - blue += 0.03f; - if (blue >= 1.0f) - blue -= 1.0f; - }; - - toggle.Toggled += (s, a) => { - view.HasRenderLoop = toggle.IsToggled; - }; - button.Clicked += (s, a) => view.Display (); - - var stack = new StackLayout { - Padding = new Size (20, 20), - Children = {view, toggle, button} - }; - - Content = stack; - } - } -} - - ]]> - - - - - - - - - - - - Constructor - - 0.0.0.0 - 1.0.0.0 - 1.1.0.0 - 1.2.0.0 - 1.3.0.0 - 1.4.0.0 - 1.5.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - - Creates a new object with default values. - To be added. - - - - - - - - Method - - 0.0.0.0 - 1.0.0.0 - 1.1.0.0 - 1.2.0.0 - 1.3.0.0 - 1.4.0.0 - 1.5.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - System.Void - - - - Called prior to rendering. - To be added. - - - - - - - - Event - - E:Microsoft.Maui.Controls.IOpenGlViewController.DisplayRequested - - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - - System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never) - - - - System.EventHandler - - - For internal use by the Microsoft.Maui.Controls platform. - To be added. - - - - - - - - Property - - 0.0.0.0 - 1.0.0.0 - 1.1.0.0 - 1.2.0.0 - 1.3.0.0 - 1.4.0.0 - 1.5.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - System.Boolean - - - Whether this has a custom rendering loop. - To be added. - To be added. - - - - - - - - Field - - 0.0.0.0 - 1.0.0.0 - 1.1.0.0 - 1.2.0.0 - 1.3.0.0 - 1.4.0.0 - 1.5.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - Microsoft.Maui.Controls.BindableProperty - - - Identifies the bindable property. - To be added. - - - - - - - - Method - - M:Microsoft.Maui.Controls.IElementConfiguration`1.On``1 - - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - Microsoft.Maui.Controls.IPlatformElementConfiguration<T,Microsoft.Maui.Controls.OpenGLView> - - - - - Microsoft.Maui.Controls.IConfigPlatform - - - - - - To be added. - Returns the platform-specific instance of this , on which a platform-specific method may be called. - To be added. - To be added. - - - - - - - - Property - - 0.0.0.0 - 1.0.0.0 - 1.1.0.0 - 1.2.0.0 - 1.3.0.0 - 1.4.0.0 - 1.5.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - System.Action<Microsoft.Maui.Controls.Shapes.Rectangle> - - - Overridden to create a custom rendering loop. - To be added. - - When overridden, creates a custom renderer: - - { - - GL.ClearColor (red, green, blue, 1.0f); - GL.Clear ((ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit)); - - red += 0.01f; - if (red >= 1.0f) - red -= 1.0f; - green += 0.02f; - if (green >= 1.0f) - green -= 1.0f; - blue += 0.03f; - if (blue >= 1.0f) - blue -= 1.0f; - }; - ]]> - - - - - - diff --git a/src/Controls/samples/Controls.Sample.Profiling/Maui.Controls.Sample.Profiling.csproj b/src/Controls/samples/Controls.Sample.Profiling/Maui.Controls.Sample.Profiling.csproj index 703d0b08be71..2dbb53f863ea 100644 --- a/src/Controls/samples/Controls.Sample.Profiling/Maui.Controls.Sample.Profiling.csproj +++ b/src/Controls/samples/Controls.Sample.Profiling/Maui.Controls.Sample.Profiling.csproj @@ -11,6 +11,8 @@ 1 false true + + maccatalyst-x64 diff --git a/src/Controls/samples/Controls.Sample.Sandbox/Maui.Controls.Sample.Sandbox.csproj b/src/Controls/samples/Controls.Sample.Sandbox/Maui.Controls.Sample.Sandbox.csproj index 66419a33a81f..ada765a27dd2 100644 --- a/src/Controls/samples/Controls.Sample.Sandbox/Maui.Controls.Sample.Sandbox.csproj +++ b/src/Controls/samples/Controls.Sample.Sandbox/Maui.Controls.Sample.Sandbox.csproj @@ -5,6 +5,8 @@ Exe true false + + maccatalyst-x64 diff --git a/src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj b/src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj index 7a6944e5632c..1bc3648494a3 100644 --- a/src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj +++ b/src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj @@ -8,6 +8,8 @@ Maui.Controls.Sample false $(NoWarn),CA1416 + + maccatalyst-x64 @@ -63,6 +65,7 @@ + diff --git a/src/Controls/samples/Controls.Sample/Pages/AppShell.xaml b/src/Controls/samples/Controls.Sample/Pages/AppShell.xaml index 474becca6092..389713023101 100644 --- a/src/Controls/samples/Controls.Sample/Pages/AppShell.xaml +++ b/src/Controls/samples/Controls.Sample/Pages/AppShell.xaml @@ -6,8 +6,36 @@ xmlns:pages="using:Maui.Controls.Sample.Pages" xmlns:shellPages="clr-namespace:Maui.Controls.Sample.Pages.ShellGalleries" FlyoutBackground="{AppThemeBinding Dark=Black, Light=White}" - Title="Welcome to Shell" - > + Title="{Binding ShellTitle}"> + + + + + + +