From Zero to .NET MAUI: Seeking One Codebase to Run Everywhere
The promise of writing one codebase and running it everywhere has never really panned out for developers. However, using XAML and .NET MAUI, you come much closer.
.NET MAUI is described by Microsoft as the "evolution" of Xamarin.Forms in that it adds support for creating desktop apps in addition to the traditional Xamarin mobile targets, iOS and Android.
That means developers using .NET MAUI can create business applications that run on Windows, Android, Mac and iPhone platforms.
If you want to learn how to use one set of code and have that code run on multiple platforms, Paul Sheriff will teach you. He has long been a consultant who teaches and mentors through various mediums such as video courses, blogs, articles and speaking engagements at user groups and conferences around the world.
He will tackle From Zero to .NET MAUI next month in a two-day, hands-on, virtual training seminar put on by Visual Studio Live!
"Whether you're an aspiring developer or a seasoned pro, this hands-on seminar caters to individuals looking to build business applications using XAML and .NET MAUI effectively," says the description of the March 19-20 event. "If you are a C# Windows Forms developer or a WPF developer who wants to learn to use XAML in .NET MAUI applications, this is the course for you. If you are a development manager or a QA person who works with developers creating XAML applications, after attending this course you will be better equipped to work with those developers."
Specifically, attendees are promised to learn:
- All about XAML and .NET MAUI
- About data binding, DI, Commanding, and the MVVM design pattern
- How to creat an N-Tier application to be used beyond .NET MAUI
We caught up with Sheriff to learn more about his upcoming presentation in a short Q&A.
VisualStudioMagazine: What inspired you to present a session on this topic?
Sheriff: I have been using .NET MAUI for a while, and with .NET 8 there is a lot more stability in the product, so I figured the time was right for people to jump into this exciting technology. I am covering XAML for .NET MAUI, however, XAML is used in WPF and other technologies, so even if you are thinking of using XAML somewhere else, this course can still provide you with some great fundamentals of XAML.
What are some of the key takeaways that attendees can expect from this seminar?
Throughout the course, attendees learn how to use XAML to build UIs that can be reused across Windows, Android, and iOS operating systems. We start with the basics of XAML and .NET MAUI, then quickly progress to cover the most important controls used to build business applications.
"The attendees create a Minimal Web API server that the .NET MAUI application uses to interact with the database, so this is also a good example of a real-world application."
Paul Sheriff, Consultant, Teacher and Mentor
The attendees create a Minimal Web API server that the .NET MAUI application uses to interact with the database, so this is also a good example of a real-world application.
Considering that .NET MAUI experienced some development problems and many developers complained it shipped too soon, how would you assess the current state of the framework?
With the release of .NET 8, the .NET MAUI framework has improved in stability and performance, so this is huge step forward in this version of .NET MAUI. The team at Microsoft is continuously working on improvements that will be coming the various service packs over the next year or so.
What are a few of your favorite features of the framework?
I really like the seamless way the Model-View View-Model (MVVM), Dependency Injection (DI), and Commanding are integrated into the product. If you have been using MVVM for any length of time, you should be able to use your data layer, entity layer, and MVVM layer with little to no changes within your .NET MAUI applications. I have been very successful at moving my previous data, entity, and MVVM assemblies forward into .NET MAUI.
Attendees are promised to learn how to create an N-Tier application to be used beyond .NET MAUI. Can you provide an example of such an application and briefly describe how it works?
Throughout the course, the attendees build upon the same application which is based upon the Adventure Works sample database Microsoft has had for many years. We build a Product add, edit, delete, and search screen that integrates with the sample database. We use the DI system to inject different data layers into the MVVM classes. One data layer communicates using an HTTP client to talk to the Minimal Web API server. The other data layer uses the Entity Framework to talk to the database. This shows an excellent example of Interfaces and DI to get truly reusable code.
Your demos will be backed up with more than 60 hands-on labs. Can you tell us more?
What is important in the labs is that each one builds upon the last. The application is built step-by-step into the final application which is the N-Tier application we just discussed. This process ensures the attendee understands how to put together an application one step at a time.
You say the promise of writing one set of code and running it everywhere has never really panned out for developers, though the combination of XAML and .NET MAUI comes close. What's missing?
Each operating system has different features that are very hard to abstract. Thus, there will always be cases where you must use conditional compilation to target some of your code to one OS or another. I am not sure this can ever be abstracted away, so we will probably always have to do this to some degree or another when attempting to build native applications.
How should developers prepare for this seminar?
If you have a good knowledge of C#, OOP, Visual Studio, Entity Framework, and creating Web APIs, you are already there. I will be using the Minimal Web APIs to build the Web Server. If you find you need a refresher on any of these, I do have over 100 videos up on my YouTube channel @pauldsheriff that can help you come up to speed. If you can spend a little time learning XAML, that would be helpful, but I will be covering XAML in detail in this course.
Note: Those wishing to attend the hands-on seminar can save money by registering early, according to the event's pricing information. "Register for 'From Zero to .NET MAUI' by March 1 to save $150 with Early Bird Registration," said the organizer of the two-day training seminar, which is being presented by the parent company of Visual Studio Magazine.
David Ramel is an editor and writer for Converge360.