-
-
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
[XF] Xamarin has deprecated OnPlatform #1025
Comments
Agreed but there is another change coming with OnPlatform which is the introduction of Default like the following: <OnPlatform x:TypeArguments="string" Default="Foo">
<On Platform="UWP, WinPhone" Value="Bar" />
</OnPlatform> |
I'm not sure the Prism API's will have to change, only the implementation. |
Actually we never actually use OnPlatform in the registration extensions. We do however use the |
What about the IDeviceService? |
forgot all about that ;) |
Since Xamarin has changed the way OnPlatform works (XAML friendly only) and added a new RuntimePlatform property of type string, this is what I am thinking. First create an Enum that wraps the string property of RuntimePlatform.
Then in the IDeviceService deprecate the OnPlatform methods and add a new property of type RuntimePlatform Enum
Next deprecate the RegisterTypeForNavigationOnPlatform methods for the containers. This means that you will now be required to manually check the Device.RuntimePlatform property value to register different views based on the result. Thoughts? |
Please check out PR #1043 to see if this is an acceptable solution to the deprecation of the OnPlatform API. Notable changes: Add new Enum to replace the string-based RuntimePlatform:
IDeviceService
RegisterTypeForNavigationOnPlatform Extensions
I would like your feedback on this new API. |
Hi Brian, API changes make sense to me. I take it UWP will return when running on Windows10 etc or Windows 10 on a mobile device? |
Just curious how this will play with Forms 2.3.4 as macOS is only supported in 2.3.5-pre? Does it just return unknown? |
@mackayn not sure, I haven't fully tested their API. This is mimicking Xamairn.Forms API exactly as-is. |
@mackayn since this is abstracting away using the XF Device class, the result should vary based on the version of XF that you use. So with 2.3.4 you'll never get macOS or UWP. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Since Xamarin has marked OnPlatform obsolete, we need to update Prism to remove the deprecated methods in favor of the new APIs.
http://motzcod.es/post/159463651162/device-os-xamarin-forms-obsolete-runtime-os
http://motzcod.es/post/159684940967/important-onplatform-changes-xamarin-forms?utm_content=bufferf80db&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer
The text was updated successfully, but these errors were encountered: