dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

ContentPresenter just rendering component string in .Net9 #25887

Closed DrJShoff closed 7 hours ago

DrJShoff commented 6 days ago

Description

Im using ContentPresenter to redifine RadioButton appearance. This has stopped working on Android after upgrading to .Net9.

Steps to Reproduce

  1. Create new MAUI project.
  2. Follow this example to reproduce: https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/radiobutton?view=net-maui-9.0#redefine-radiobutton-appearance

Image

Expected behavior is to get the components rendered correctly

Link to public reproduction project repository

No response

Version with bug

9.0.10 SR1

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

It renders correctly if targeting .Net8

Relevant log output

ninachen03 commented 3 days ago

I can repro this issue at Android platform on the latest 17.13.0 Preview 1.0(9.0.10 &9.0.0), but it worked for (8.0.100). It's a regression from .NET 8 to .NET 9.

Image

jsuarezruiz commented 3 days ago

I can repro this issue at Android platform on the latest 17.13.0 Preview 1.0(9.0.10 &9.0.0), but it worked for (8.0.100). It's a regression from .NET 8 to .NET 9.

Image

Happens using the Content property, ControlTemplate property or both?

jsuarezruiz commented 2 days ago

I can repro this issue at Android platform on the latest 17.13.0 Preview 1.0(9.0.10 &9.0.0), but it worked for (8.0.100). It's a regression from .NET 8 to .NET 9. Image

Happens using the Content property, ControlTemplate property or both?

Already tested, happens using ContentPresenter.

jsuarezruiz commented 2 days ago

Found the cause of the problem. The binding from ContentPresenter changed here https://github.com/dotnet/maui/commit/4c3a09c249f0b6a0980c99e160a9985749c761bb#diff-f01d408e1d2b3cd4a4c1bcf731586c215c9d57d4585d6815d5c89118a1ef3f44R20 (changes to allow trimming).