.NET MAUI 6.0 - Why I Like .NET MAUI
Mac Mini Fund
At least 90% of all new contributions and access fees goes to the fund.
This article introduces the .NET MAUI 6.0 framework selector and an article series about the implementation of .NET MAUI 6.0 with Visual Studio 2022. I developed KH Authenticator, a .NET MAUI App for Windows and Android which registers and authenticates a user without a password or email address. See KH Authenticator Server.
.NET MAUI 6.0 Introduction Series
This article series is about the implementation of .NET MAUI 6.0 with Visual Studio 2022. Almost 10 years ago, I developed and published an Android Studio project with Java programming. I bought a Mac Mini and researched Xcode and Swift programming. VS 2022 and .NET MAUI projects compile C# programming for iOS, Android, macOS, and Windows operating systems. See .NET Multi-platform App UI (.NET MAUI) | .NET (microsoft.com).
- .NET MAUI 6.0 - Why I Like .NET MAUI
- .NET MAUI 6.0 - Sideloading
- .NET MAUI 6.0 - Emulators And Simulators
- .NET MAUI 6.0 - Data Binding
- .NET MAUI 6.0 - SQLite Database
- .NET MAUI 6.0 - Navigation
- .NET MAUI 6.0 - Async Void Methods
Updated with links as the articles become published.
I have dreamed about a cross-platform application to authenticate a user's login. I researched Bluetooth, Android Studio, APIs, and SignalR. My dreams have come true with KH Authenticator, a .NET MAUI App for Windows and Android which registers and authenticates a user without a password or email address. Now I dream about the iOS and macOS versions.
.NET MAUI may seem brand new but is an evolution of Xamarin.Forms. .NET MAUI implements C# and XAML markup as partial classes, a little like WebForms. You can bind View elements in markup to properties in code. When considering .NET MAUI, you first need to determine your audience. Do you want to distribute the application to just Windows users on your team or do you want to list the application in the Microsoft Store, Google Play, Amazon Appstore and Apple Store. This series describes a few vital implementations to get past considering to coding.
The distribution and publishing methods for each target operating system vary greatly. You don't normally consider distribution until after you have developed the application, but you should and need to manage expectations and milestones. Sideloading allows a limited and controlled way of distributing the application. I describe Windows and Android sideloading of the KH Authenticator app from the KH Authenticator Server.
Emulators And Simulators
If you have used Android Studio then you will recognize the Android Device Manager and Android emulators installed with the .NET Muti-platform App UI development workload. VS 2022 and .NET MAUI projects compile to Mac Catalyst. Building native iOS applications using .NET Multi-platform App UI (.NET MAUI) requires access to Apple's build tools, which only run on a Mac. Because of this, Visual Studio 2022 must connect to a network-accessible Mac to build .NET MAUI iOS apps. See MSDocs - Pair to Mac for iOS development.
Data binding is the technique of linking properties of two objects so that changes in one property are automatically reflected in the other property. One of the two objects involved in a data binding is almost always an element that derives from View and forms part of the visual interface of a page. The other object is either another View derivative, usually on the same page or an object in a code file. See MSDocs - .NET MAUI Data binding.
The SQLite database engine allows .NET Multi-platform App UI (.NET MAUI) apps to load and save data objects in shared code. You can integrate SQLite.NET into .NET MAUI apps, to store and retrieve information in a local database. See MSDocs - .NET MAUI local databases.
.NET MAUI launches a main page which is always loaded. Navigation from the main page can be a flyout page or a shell page loaded on the navigational page stack. Deciding and committing to a shell or flyout navigation scheme is an early and major design milestone.
Async Void Methods
Button click event handlers must return void and have a signature like: void ButtonClicked(object sender, EventArgs e). To execute asynchronous calls within the button click event, the signature becomes: async void ButtonClicked(object sender, EventArgs e). Async void methods can be used for long running tasks or fire and forget operations.