Fix Crash on iOS when using MediaElement inside a CarouselView#2187
Conversation
|
I am very happy to see this PR! I just finished testing it in IOS and for Mac Catalyst. It works as intended and everything is fully working now. The only thing I could think of that could be done in a different PR maybe is adding another page and testing |
ne0rrmatrix
left a comment
There was a problem hiding this comment.
As I said in the comment. It all looks good. I am also very happy to report I tested it against a mac and ipad. No issues on either CaraouselView or regular MediaElement. My only wish is to now either have you add another sample page with CollectionView. If you don't want to I would be happy to do it.
Sure - go for it! I'll go ahead and merge this PR in the meantime to get the bug fix into the code base. You can assign your PR adding a CollectionView sample to me when it's ready for review 👍 |
|
@brminnick I also just wanted to express my gratitude for the fix - thank you!! 🥳 |
Description of Change
This Pull Request adds support for MediaElement inside of DataTemplate.
This Pull Request also adds
MediaElementCarouselViewPageto the Sample App.Linked Issues
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information
This fix requires reflection because the Controller property that we need to reference when
MediaElementis inside of aDataTemplateis aprotected internalproperty in the ItemsViewContoller class: https://github.com/dotnet/maui/blob/cf002538cb73db4bf187a51e4786d7478a7025ee/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.iOS.cs#L39Because this uses reflection, it is important to manually test the
MediaElementCarouselViewPagewhenever we update our .NET MAUI Workload (egnet8.0-ios->net9.0-ios) to ensure there are no breaking changes caused by reflection and/or the renaming of internal properties.