Reputation: 1
Does anyone have experience with Xamarin trying to use allready existing .NET code? Especially Form.Elements - or do they have to be redesigned for java(Android)?
My second question is, whether it is possible to build an Xamarin-Library to use system.Forms elements?
Upvotes: 0
Views: 240
Reputation: 1503579
No, you can't use Windows Forms code in Xamarin.
The idea of Xamarin is that it uses the UI framework which is native to the OS you're writing for - so that isn't portable - but you can share the business logic which will be common to all of your implementations.
So long as you have a clear delineation between UI and business logic, you can create a portable class library containing the business logic and share that very easily between any "normal" .NET environment and Xamarin.iOS / Xamarin.Android. (There may be other platform-specific parts too, such as local storage - again, it's a matter of isolating that and abstracting it where appropriate, so that your business logic may be able to say "Get me storage record X" and it will use whatever storage provider you've plugged in.)
Upvotes: 1