Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Visual Tree Helper (Based on #1820) #1845

Merged
merged 44 commits into from Jul 29, 2021
Merged

Add Visual Tree Helper (Based on #1820) #1845

merged 44 commits into from Jul 29, 2021

Conversation

drasticactions
Copy link
Contributor

@drasticactions drasticactions commented Jul 28, 2021

Description of Change

This adds an interface and implementation of the IVisualTreeHelper. Originally set up by @StephaneDelcroix and lightly modified by myself.

This should give initial support for getting a list of visual children for a given Maui.IElement, with workarounds for some other related elements. Some elements like TableView are not supported since they don't use IElement, and we'll need to figure that out so we can properly support it.

Fixes #584

Additions made

  • Adds

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)
  • Targets a single property for a single control (or intertwined few properties)
  • Adds the property to the appropriate interface
  • Avoids any changes not essential to the handler property
  • Adds the mapping to the PropertyMapper in the handler
  • Adds the mapping method to the Android, iOS, and Standard aspects of the handler
  • Implements the actual property updates (usually in extension methods in the Platform section of Core)
  • Tags ported renderer methods with [PortHandler]
  • Adds an example of the property to the sample project (MainPage)
  • Adds the property to the stub class
  • Implements basic property tests in DeviceTests

Does this PR touch anything that might affect accessibility?

  • Does this PR introduce a new control? (If yes, add an example using SemanticProperties to the SemanticsPage)
  • APIs that modify focusability?
  • APIs that modify any text property on a control?
  • Does this PR modify view nesting or view arrangement in anyway?
  • Is there the smallest possibility that your PR will change accessibility?
  • I'm not sure, please help me

If any of the above checkboxes apply to your PR, then the PR will need to provide testing to demonstrate that accessibility still works.

@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen added this to the 6.0.100-preview.7 milestone Jul 28, 2021
mattleibow
mattleibow previously approved these changes Jul 28, 2021
src/Controls/src/Core/Element.cs Outdated Show resolved Hide resolved
src/Core/src/Core/IVisualTreeHelper.cs Outdated Show resolved Hide resolved
src/Controls/src/Core/Application.cs Outdated Show resolved Hide resolved
@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

drasticactions and others added 4 commits July 29, 2021 12:49
* Add net6.0 to the projects

* additive

* ws
Co-authored-by: Stephane Delcroix <stephane@delcroix.org>
* Move navhost bits to core

* - windows

* - fix IEnumerable calls

* - fix up ios

* - revert to renderer
jonathanpeppers and others added 21 commits July 29, 2021 12:56
* [workload] support $(UseMaui) from a net6.0 TFM

If you try to enable `$(UseMaui)` in a `net6.0` project, you get
errors during `restore` like:

    error NU1101: Unable to find package Microsoft.Maui.Core.Ref.. No packages exist with this id in source(s):
    C:\src\maui\bin\dotnet\library-packs, dotnet-eng, dotnet-public, dotnet6, xamarin

Note the `..` is caused by `$(_MauiPlatformName)` being blank in
`BundledVersions.targets`.

The solution here is to an `any` pack for all `.Ref` and `.Runtime`
packs. Unfortunately, we will need `net6.0` versions of all assemblies
in order to do this.

This is blocked until `net6.0` can be added to `$(MauiPlatforms)`:

https://github.com/dotnet/maui/blob/f95c2e5c9a6e19817c75ddb93fae98ca8739399f/Directory.Build.props#L13

I would do it myself, but there are many C# compiler errors I don't
know about. It appears that the `$(DefineConstants)` in place expect
some platform to be there.

The remaining changes here *should* get `net6.0` working in a
workload, but I can't test it yet.

* No need for Controls.Sample.NoPlatform

The main sample app is now net6 friendly

* okays

* Add the .any packs to the manifest

* add to the workload

* Don't include "design" assemblies in FrameworkList.xml

Otherwise, they get included as references.

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
…ild 20210726.8 (#1822)

Microsoft.macOS.Sdk , Microsoft.MacCatalyst.Sdk , Microsoft.iOS.Sdk , Microsoft.tvOS.Sdk
 From Version 12.0.100-preview.7208 -> To Version 12.0.100-preview.7209

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Commit 41a42d1 added a new stage for releases that will wait for up to
two days for approval before timing out.  In most cases, this will cause
the `maui-release` and `maui-nightly` release definitions to wait the
full two days before they trigger automatically.  This is only avoided
if someone approves or rejects the `VS Insertion` stage in the pipeline
before the default timeout occurs.

We can reduce the timeout to 30 minutes to speed up the majority of post
build efforts, as the `VS Insertion` stage can still be re-ran after it
is rejected.
)

The fix is to prevent a wrong TFM being flowed to the "inner build" of iOS/Android/MacCatalyst MAUI projects so that a referenced RCL is built only with its actual TFM and not the referencing project's TFM.

Fixes #1771
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Dick <jond@hey.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
* Add initial code for ExcludedWithChildren property

* Update SemanticsPage sample

AutomationProperties still needs to be wired up for proper testing. For now, comment out Button and Label handler registration in AppHostBuilderExtensions

* Tweak sample further
* Add traits to iOS Checkbox so it reads as Switch

* - fix up sample

* - remove label

* - remove extra checkbox
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview7-d306ec847373bedc8995de8a17fd4e482697e824-1

Microsoft.Android.Sdk.Windows
 From Version 30.0.100-preview.7.100 -> To Version 30.0.100-preview.7.104

Dependency coherency updates

Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,System.CodeDom
 From Version 6.0.0-preview.7.21373.17 -> To Version 6.0.0-preview.7.21376.17 (parent: Microsoft.AspNetCore.App.Runtime.win-x64

* [android] ignore warnings for PreserveAttribute

We were hitting this in one file:

  src\Core\src\Platform\Android\NavigationLayout.cs(11,4): error CS0618: 'PreserveAttribute' is obsolete: 'Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]'
  src\Core\src\Platform\Android\NavigationLayout.cs(16,4): error CS0618: 'PreserveAttribute' is obsolete: 'Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]'
  src\Core\src\Platform\Android\NavigationLayout.cs(21,4): error CS0618: 'PreserveAttribute' is obsolete: 'Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]'
  src\Core\src\Platform\Android\NavigationLayout.cs(26,4): error CS0618: 'PreserveAttribute' is obsolete: 'Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]'

For now, let's disable this warning. We probably don't want to add
this to `$(NoWarn)`, because turning off CS0618 would disable too
much. You'd still want warnings for other obsolete APIs.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
…ild 20210727.61 (#1841)

Microsoft.macOS.Sdk , Microsoft.MacCatalyst.Sdk , Microsoft.iOS.Sdk , Microsoft.tvOS.Sdk
 From Version 12.0.100-preview.7209 -> To Version 12.0.100-preview.7217

Dependency coherency updates

Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,System.CodeDom
 From Version 6.0.0-preview.7.21373.17 -> To Version 6.0.0-preview.7.21376.17 (parent: Microsoft.AspNetCore.App.Runtime.win-x64

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Introduce SetSemanticFocus API

* Clean up code

* Update Android to use ViewFocused instead

* - fix up extension methods

* - adjust checkbox traits

* - fix checkbox

* - fix comments

Co-authored-by: Rachel Kang <rachelkang@microsoft.com>
* Fix iOS so if you remove more than one page it's able to remove them successfully

* - add file from Control gallery

* Don't set the width of the TitleView to the width of the status bar (#14290)

* Fix width measure on TitleView

* - fix test

* Update ShellPageRendererTracker.cs

* Update ShellTitleView.cs
# Conflicts:
#	Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ShellTitleView.cs
#	Xamarin.Forms.Platform.iOS/Renderers/ShellPageRendererTracker.cs

* - fix up issue

* - merge shell accessibility fixes

* Route Navigation.(Push/Pop)Modal through Shell Navigation Manager (#14080)

* Route Navigation.(Push/Pop)Modal through Shell Navigation Mananger

* - fix SO error

* Update ShellNavigationManager.cs
# Conflicts:
#	Xamarin.Forms.Core.UnitTests/ShellModalTests.cs
#	Xamarin.Forms.Core.UnitTests/ShellNavigatingTests.cs
#	Xamarin.Forms.Core/Routing.cs
#	Xamarin.Forms.Core/Shell/RouteRequestBuilder.cs
#	Xamarin.Forms.Core/Shell/ShellNavigationManager.cs
#	Xamarin.Forms.Core/Shell/ShellSection.cs
#	Xamarin.Forms.Core/Shell/ShellUriHandler.cs

* - fix shell section

* - fix issue test

* - fix namespace

* - formatting changes

* - fix naming
* Move Legacy layouts into Compatibility and new layouts out of Layout2

* Checkpoint; waiting on IContainer List<IView> change to move forward

* Rebase fixups and ScrollView layout reordering

* Update BindableLayout/Indicator stuff for Windows

* Fix various build errors

* Update unit tests to use proper layout versions

* More unit test updates

* Remove old comment

* - fix namespace for Contraint Converter

* Remove the shim subclasses

* More test fixups

* Restore test page code

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
…uild 6.0.1xx-preview7-ce2830613a0123d3fd8207e97e5ec7483706409e-1 (#1853)

Microsoft.Android.Sdk.Windows
 From Version 30.0.100-preview.7.104 -> To Version 30.0.100-preview.7.106

Dependency coherency updates

Microsoft.NETCore.App.Ref,Microsoft.Dotnet.Sdk.Internal,Microsoft.Extensions.Primitives,Microsoft.AspNetCore.App.Runtime.win-x64,Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,Microsoft.Extensions.FileProviders.Embedded,Microsoft.AspNetCore.Authorization,Microsoft.AspNetCore.Components.WebView,Microsoft.AspNetCore.Components.Web,Microsoft.JSInterop,Microsoft.WindowsDesktop.App.Runtime.win-x64,System.CodeDom
 From Version 6.0.0-preview.7.21376.17 -> To Version 6.0.0-preview.7.21377.12 (parent: Microsoft.Dotnet.Sdk.Internal

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
# Conflicts:
#	src/Controls/src/Core/Layout/Layout.cs
@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mattleibow mattleibow mentioned this pull request Jul 29, 2021
18 tasks
@mattleibow mattleibow merged commit aa817b5 into dotnet:main Jul 29, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement][P0] XAML Hot Reload need VisualTreeHelper.GetChildren and VisualTreeHelper.GetChild