-
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
Fix the BackgroundColor to Background update #6372
Conversation
I see @jsuarezruiz did this, but in another way: #5706 Not sure if changing to IView is good or bad? @PureWeen ? |
public static IPropertyMapper<IView, IViewHandler> ControlsVisualElementMapper = new PropertyMapper<View, IViewHandler>(Element.ControlsElementMapper) | ||
{ | ||
[nameof(BackgroundColor)] = MapBackgroundColor, | ||
}; | ||
public static IPropertyMapper<IView, IViewHandler> ControlsVisualElementMapper = | ||
new PropertyMapper<IView, IViewHandler>(Element.ControlsElementMapper) | ||
{ | ||
[nameof(BackgroundColor)] = MapBackgroundColor, | ||
}; |
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.
This is the actual fix: View
-> IView
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.
no tests ?
Still working on that. |
I changed the Page BackgroundColor to Background in the template styles - should we change that back with this fix? Or should either work fine now? |
@rachelkang I would change it back. Since setting Background makes BackgroundColor unusable it's unfortunately confusing if we're setting Background in our styles and they go to set BackgroundColor |
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.
Blazor related changes look good.
Can't comment on other changes!
|
||
public static CommandMapper<IPicker, IContentViewHandler> CommandMapper = new(ViewCommandMapper) |
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.
oops for the IPicker :(
in https://github.dev/dotnet/maui/blob/main/src/Controls/src/Core/Compatibility/Handlers/VisualElementRenderer.cs shouldn't be? #if IOS |
Description of Change
The reason setting the BackgroundColor of a Page did not update the Background was due to the "inheritance" of the handlers. The PageHandler effectively inherits from ViewHandler, however, we remap some things in Controls and this caused an issue because we used the wrong type.
The VisualElement.RemapForControls assumed that all VisualElements are Views, and this is not true for the case of Page. However, this is true for the case of IView.
Issues Fixed