I'm just wondering the easiest way to transfer my application into a mobile friendly version that I would be able to put onto android phones. Any help and pointers would be appreciated.
. NET 5 is s unified platform to write code once and run anywhere.
“WPF would be dead in 2022 because Microsoft doesn't need to be promoting non-mobile and non-cloud technology. But WPF might be alive in that sense if it's the best solution for fulfilling specific customer needs today. Therefore, having a hefty desktop application needs to run on Windows 7 PCs with IE 8.
You can build apps for Android, iOS, and Windows devices by using Visual Studio. As you design your app, use tools in Visual Studio to easily add connected services such as Microsoft 365, Azure App Service, and Application Insights. Build your apps by using C# and the . NET Framework, HTML and JavaScript, or C++.
Xamarin - it's the best way. Keeps your code in C# with loads of code re-use.
Assuming you developed your WPF app using the MVVM design pattern then porting it to Android might not be that hard. You just need to ensure all your non-UI code is portable (as in it uses the subset of the .Net framework that is available to a portable class library) and move anything device specific to an Android library. If you have been using dependency injection/IoC then this should be relatively simple.
The other option with Xamarin is Xamarin.Forms. Like WPF you define your UI in Xaml and there are controls available from the big control vendors like DevExpress. The output of Xamarin.Forms is a cross platform app so will run on Android, iOS and UWP depending on what platform specific features you need to use - and there are plenty of plug-ins to help with all this.
Once you have the core business logic (the VM and M of MVVM) in a portable class library then you just need to write the UI layer on Android, and from there it's not too hard to add a, iOS or UWP UI layer as well.
Also if you are using MVVM how have you implemented it? If you are using PRISM, MVVMCross or MVVMLight then these support Xamarin apps.
A good blog post showing how to do something similar is on the Xamarin Blog here: https://devblogs.microsoft.com/xamarin/porting-existing-net-apps-to-android/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With