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

fixed sample application crashed with MediaElement for Windows #1870

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

olekssokol
Copy link
Member

Sample application crashed in MediaElement page when the "Tab" key switches the active state to the "Change Aspect" button, and then the "Space" key executes it.
In this case, the problem is due to the DisplayActionSheet call from the Microsoft.Maui.Controls package, it should display the window and return the pressed button, but instead of the window, it immediately returns null, which was not handled in the Sample project.

@olekssokol
Copy link
Member Author

@dotnet-policy-service agree

@brminnick
Copy link
Collaborator

Adding the blocked tag.

Do not merge this PR until Microsoft.Maui.Controls v8.0.21 is included in the Visual Studio (stable) release.

@brminnick brminnick added do not merge Do not merge this PR approved This Proposal has been approved and is ready to be added to the Toolkit labels May 9, 2024
brminnick
brminnick previously approved these changes Jun 6, 2024
Copy link
Collaborator

@brminnick brminnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that the templates for the current release of Visual Studio (stable) are using Microsoft.Maui.Controls v8.0.21

@brminnick brminnick removed do not merge Do not merge this PR blocked labels Jun 6, 2024
@brminnick brminnick enabled auto-merge (squash) June 6, 2024 00:15
@brminnick
Copy link
Collaborator

Dang - in Microsoft.Maui.Controls v8.0.21 there is a breaking change in how Application is loaded which is breaking our Unit Tests. There's an internal field in Application that needs to be initialized before our tests can run: readonly Lazy<IResourceDictionary> _systemResources;. Currently it is throwing a NullReferenceException.

@brminnick
Copy link
Collaborator

Dang - in Microsoft.Maui.Controls v8.0.21 there is a breaking change in how Application is loaded which is breaking our Unit Tests. There's an internal field in Application that needs to be initialized before our tests can run: readonly Lazy<IResourceDictionary> _systemResources;. Currently it is throwing a NullReferenceException.

I was able to use reflection as a workaround.

The root cause of this bug fix is that .NET MAUI is now using partial classes for Application, and the .NET Standard implementation of Application doesn't initialize the _systemResources field.

brminnick
brminnick previously approved these changes Jun 14, 2024
@brminnick
Copy link
Collaborator

Ok - there's one more bug we need to fix with the AppTheme test now.

I just spent the last few hours digging into it and couldn't figure it out. @olekssokol any chance you could take a look?

@olekssokol
Copy link
Member Author

Yes, of course, I'll take a look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This Proposal has been approved and is ready to be added to the Toolkit
Projects
None yet
3 participants