-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Android] Fix RadioButton using ContentPresenter not rendering #25947
Conversation
@@ -9,7 +9,7 @@ | |||
namespace Microsoft.Maui.Controls | |||
{ | |||
/// <include file="../../docs/Microsoft.Maui.Controls/RadioButton.xml" path="Type[@FullName='Microsoft.Maui.Controls.RadioButton']/Docs/*" /> | |||
public partial class RadioButton : TemplatedView, IElementConfiguration<RadioButton>, ITextElement, IFontElement, IBorderElement, IRadioButton | |||
public partial class RadioButton : TemplatedView, IElementConfiguration<RadioButton>, IContentView, ITextElement, IFontElement, IBorderElement, IRadioButton |
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.
To get the RadioButton working with the compiled binding in ContentPresenter, needs to implement IContentView.Content
.
To get ContentPresenter
correctly working in all the cases, we must apply the same changes to:
- TitleBar
- IndicatorView
Classes from Controls that inherit from TemplatedView
.
Waiting for feedback to proceed and also include tests related to those classes, or just keep what is related to RadioButton here.
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.
Alternative c6c2cee
Just revert the binding change in the ContentPresenter, but this change was necessary to make MAUI trimmable.
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.
I've modified the PR slightly
I think it's still relevant even with the alternative changes.
With Simons changes RB will still fall through to the unsafe path, so we need it to still react correctly and not go the unsafe path with warnings.
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.
So I think @mattleibow is on to something here.
It does feel like this should work
#24949 (comment)
I tested locally real quick and it didn't work, but, there might just be something simple that needs to be added/fixed
/backport to release/9.0.1xx |
Started backporting to release/9.0.1xx: https://github.com/dotnet/maui/actions/runs/11958376858 |
Description of Change
Fix RadioButton using ContentPresenter not rendering on Android. Found the cause of the problem. The binding from ContentPresenter changed here 4c3a09c#diff-f01d408e1d2b3cd4a4c1bcf731586c215c9d57d4585d6815d5c89118a1ef3f44R20 (changes to allow trimming).
This PR apply changes to implement
IContentView.Content
in the RadioButton class.Issues Fixed
Fixes #25887
The changes here, will also fix #24949