I have a windows phone class library that is built for windows phone 7.0(coded in c#). Is it possible to port the same class library to windows 10 mobile sdk?. Or, do I need to write the entire class library from scratch to support windows 10 mobile.
It is possible to port it, but not in an automated way.
- UI components should be relatively easy, as long as not a lot of
third party controls such as Telerik for Windows Phone were used.
Third party libraries need to have been ported to the WinRT platform
(or UWP, as it it called now) as well, which is not always the case.
Most of the XAML can be re-used, but some namespaces, events and properties are named differently (eg: Tap becomes Tapped).
Some layouts may need to be reworked a bit due to a different approach in scaling (Silverlight scaled everything up, as it pretended a screen is always 480px wide).
- HTTP calls: This is probably going to have to change a lot, depending
on how they were implemented in your WP7 library. Webclient no longer
exits in WinRT, HttpClient or creating your own HttpWebRequest is the
way to go. Since WP7 apps did not have async/await by default, I
would suggest rewriting this part.
- XML parsing: This should be compatible (maybe some small syntax changes)
- I/O operations: Probably massive changes. WP7 used the Isolated Storage mechanism, which has been replaced. Capturing images with the CameraCaptureTask, and basically all use of sensors will have to be rewritten.
- Local Database is not longer supported. Use Sqlite if you want to use a database in your app.
- The application lifecycle is also completely different in WinRT. Pages in the backstack are not cached automatically and a lot of events in a page work differently, or might not occur at the same time as they were in Silverlight applications
for more info: Move from Windows Phone Silverlight to UWP