-
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
Moved IPlatformServices.GetNamedSize into a separate service #4570
Conversation
This will be removed eventiallu, but we need to firstclear up the old Device and Forns.Init things and that means removing the IPlatformServices interface.
# Conflicts: # src/Compatibility/Core/src/Android/Forms.cs # src/Compatibility/Core/src/Windows/WindowsPlatformServices.cs # src/Compatibility/Core/src/iOS/Forms.cs # src/Controls/tests/Core.UnitTests/MockPlatformServices.cs
using Microsoft.Maui.Controls.Internals; | ||
using Microsoft.Maui.Controls.Platform; | ||
|
||
[assembly: Microsoft.Maui.Controls.Dependency(typeof(Microsoft.Maui.Controls.Compatibility.Platform.UWP.FontNamedSizeService))] |
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.
Were we trying to avoid assembly attributes for dependency declarations?
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.
We are, but for tests, this is how it is still used. For normal apps, it is registered and locked as part of the build with an explicit registration.
I am doing this now so I can reduce the churn on the test code. In another PR I will remove these attributes altogether and have each test register the required services.
But in order for that to work, we need to get rid of the Device's reliance on IPlatformServices. Also, this is just living in compatibility.
Description of Change
This will be removed eventually, but we need to first clear up the old
Device
andForns.Init
things - and that means removing theIPlatformServices
interface.This PR moves the implementation into a compatibility dependency service so that they are not only decoupled, but the logic is clearly compatibility. This API might be useful still, so we don't remove it. And, at a later date, we can merge this or similar into Core.
Implements #1965
Fixes #3948
Additions made
IFontNamedSizeService
IPlatformServices.GetNamedSize
PR Checklist
Does this PR touch anything that might affect accessibility?
If any of the above checkboxes apply to your PR, then the PR will need to provide testing to demonstrate that accessibility still works.