xamarin-forms-wpf icon indicating copy to clipboard operation
xamarin-forms-wpf copied to clipboard

Why was the WPF assembly named: Xamarin.Forms.Platform.WP8?

Open ghost opened this issue 9 years ago • 5 comments

Very nice work.

Can you explain why you named the WPF assembly Xamarin.Forms.Platform.WP8?

Was this a workaround to get Xamarin to load it?

I"m very interested in pursuing rendering to WPF.

Much appreciated!

Karl

ghost avatar Jun 02 '16 18:06 ghost

Hello, this is a proof-of-concept project, showing Xamarin.Forms backed by WPF, Xamarin.Forms, as it was when I created this project, did not expose the required methods to implement a custom platform, to prevent custom platforms they used "internal" modifiers on those methods, and added [InternalsVisibleTo("Xamarin.Forms.Platform.WP8")] [InternalsVisibleTo("Xamarin.Forms.Platform.Android")] [InternalsVisibleTo("Xamarin.Forms.Platform.iOS")]

So they could use those methods on those platforms.

Unfortunatelly Xamarin.Forms.Platform.WPF do not have access to these methods / required classes. Using reflection to access internal methods proved to be challenging, so it was easier to simply disguise my assembly as WP8 (Windows phone 8), and have access to everything I needed.

Maybe on the latest Xamarin.Forms this API is exposed somehow, but it wasn't at the time.

Miguel de Icaza informed on a hangout that they are about to release a full WPF implementation, if I did understand it correctly. Also a MAC backend is being tested by them.

If you want to implement a custom platform, you should check if the required API is public, or exposed somehow, or use this ugly trick.

jvlppm avatar Jun 02 '16 20:06 jvlppm

Thank you very much for the information.

Have a great day,

Karl

ghost avatar Jun 02 '16 20:06 ghost

@kdawg1406 i recommend you to use the mailing list to talk about a possible wpf backend

rmarinho avatar Jun 02 '16 21:06 rmarinho

@rmarinho what mailing list are you referring to?

ghost avatar Jun 03 '16 10:06 ghost

Xamarin Forms one :

http://lists.ximian.com/mailman/listinfo/forms-devel

rmarinho avatar Jun 03 '16 10:06 rmarinho