Skip to content

[net9.0] Merge main to net9.0#26001

Merged
rmarinho merged 15 commits intonet9.0from
merge-main-net9
Nov 21, 2024
Merged

[net9.0] Merge main to net9.0#26001
rmarinho merged 15 commits intonet9.0from
merge-main-net9

Conversation

@rmarinho
Copy link
Copy Markdown
Member

Description of Change

Bring latest changes from main to net9.0

Mike Corsaro and others added 15 commits November 1, 2024 13:21
### Description of Change

Fixes a long-standing crash when navigating pages:

1. Manually clear the `ContentPresenter.Content` property.

When navigating pages it was discovered that the `Content` property of
the `ContentPresenter` sometimes was not being detached from the parent
`ContentPresenter` (the `ContentPresenter` itself does detach from the
Page). A workaround for this was to manually clear the `Content`
property.

**The actual cause of this bug:** I suspect that something causing the
lifecycle tracking to be messed up. I'm still not sure what this is, but
for now this will help our customers more than nothing.

## Workaround

The following can be used as a workaround. Place it in the `Loaded`
event for your `AppShell`:

```csharp
private void AppShell_Loaded(object? sender, EventArgs e)
{
    Loaded -= AppShell_Loaded;

#if WINDOWS
    if (Handler != null && Handler.PlatformView is ShellView shellView &&
        shellView.Content is MauiNavigationView nv &&
        nv.Content is Microsoft.UI.Xaml.Controls.Frame frame)
    {
        frame.Navigating += (s, e) =>
        {
            if (frame.Content is Microsoft.UI.Xaml.Controls.Page page)
            {
                page.Unloaded += PageUnloaded;

                void PageUnloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
                {
                    page.Unloaded -= PageUnloaded;
                    if (page.Content is Microsoft.UI.Xaml.Controls.ContentPresenter presenter)
                    {
                        presenter.Content = null;
                    }
                };
            }
        };
    }
#endif
}
```

### Issues Fixed

Fixes #22790 #18441 #22131
* Changes in randomly failing UITests

* Updated snapshots
don't get the property on the array type but on the element type

- fixes #25819
* Fix signing fonts

* update public yaml

* Add _RunAsPublic

* With rename

* again

* again

* again

* Comment

* Dont validate sigining

* Try again
* Add maui-template-steps

* fix naming

* Try to provision on devdiv

try

fix

Try provision on devdiv

More provision

Do provisioning on devdiv

try again

fix

Try with secrets

* Try centralize demands

* fix demands

* fix

* Fix pool

* Use a global variable

* try again

* teste

* try

* this works

* Try again

* use for templates

* Try more variable for provisionator

* See if it works like this on xamarin

* Add condition for mactemplates

* Fix provisioning device tests

* Fix pool
@rmarinho rmarinho added this to the .NET 9 SR1.1 milestone Nov 20, 2024
@rmarinho rmarinho requested a review from a team as a code owner November 20, 2024 22:08
@rmarinho rmarinho enabled auto-merge November 20, 2024 22:08
@rmarinho rmarinho requested review from jsuarezruiz and removed request for tj-devel709 November 20, 2024 22:09
@rmarinho rmarinho disabled auto-merge November 21, 2024 01:27
@rmarinho rmarinho merged commit 4f7f21f into net9.0 Nov 21, 2024
@rmarinho rmarinho deleted the merge-main-net9 branch November 21, 2024 01:27
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Dec 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

fixed-in-net9.0-nightly This may be available in a nightly release! t/housekeeping ♻︎

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants