-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Create better helpers for attaching and fix Window #14772
Conversation
"src\\Controls\\tests\\Xaml.UnitTests.InternalsHiddenAssembly\\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj", | ||
"src\\Controls\\tests\\Xaml.UnitTests.InternalsVisibleAssembly\\Controls.Xaml.UnitTests.InternalsVisibleAssembly.csproj", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason VS keeps wanting to move this so, I'm hoping if we check this in then it'll just be content.
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the crash in #14742
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 1 or 2 places where things are not consistent - like some use the AttachAndRun(view) and the others use view.AttachAndRun(context) but this is super nitty and we can fix that as we see them. Maybe there was a reason for some or maybe not. But they all go to the same place and we can merge this PR
Description of Change
This is the next version of this PR.
AttachAndRun
on Windows so that theWindow
is created through theMauiContext
. This is important because we have a few places inside our handlers where the window is retrieved via theMauiContext
so those windows have to align.InitializingBackgroundUpdatesBackground
that useCreateHandlerAndAddToWindow
and then make use ofAttachAndRun
. This allowsAttachAndRun
to retrieve the correct window as part of its code.AttachAndRun
so that we don't have to always go through the ceremony ofcreatehandler/invokeonuithread/attachplatformview
. Now you can just callAttachAndRun
on theIView
and it'll take care of marshalling and creating for you.Known issues
The
WebViewHandler
tests in core on windows are still crashing. Those will be addressed with a different PR because those crashes aren't really related to the changes here.