I’m settling in to create my first real application and after a few false starts with Java’s Swing and JavaFX frameworks, I looked into WinForms.. and finally settled on WPF. I appreciate that it’s got more of a CSS feel to control features… and apparently it’s the most modern iteration of desktop application development in C#.

What recommendations do you have to someone creating their first full-fledged desktop application using WPF?
App details for those curious: It’s going to be a running app to track overall goals, develop training plans, see what runs are planned for the week along with predicted weather, allow for analysis of routes and segments, etc.
It’ll have 6 distinct pages, will have an android companion app to track live runs and access most of the info available in the desktop app, and I hope to build this out into a website someday, too.
I would try a few apps first but going model-view-viewmodel helps keep things clean.
Avoid putting database stuff directly in your ViewModel and have a good database layer for that. If you do port it to the web your model and data layer should just slide over, some of your ViewModel as well potentially, UI obviously will need to be rewritten.
WPF is not the most modern stack for C# desktop apps. It’s UWP. But it only supports Win10.
Since you’ll also be doing a mobile app, I’d suggest looking at Xamarin.Forms, which lets you develop desktop and mobile apps simultaneously for iOS, Android, Win10, macOS, watchOS, and Tizen.
Use patterns like MVVM and IoC/DI, and don’t code shared biz logic in the desktop/mobile apps if it’s likely it’ll be shared with the web app. Of course, that would mean adding an AspNetCore Web API project to your todo list.
Build small experimental apps to learn about the various stacks and patterns (and make your obligatory mistakes there) before implementing the project code.
Good luck.
Yeah, that’s why I kinda wanna do the desktop app first.. I don’t need to figure out website hosting, etc, and xan just work out ‘does this concept work’ while learning more about the basics.
I just heard a podcast today about IoC and Dependency Injection… new terms to me. Sounds like I should dig deeper there!
C# devs
null reference exceptions

source