.NET MAUI : Write multilingual apps easily

This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.If you need a solution to create multilingual applications without the hassle of implementing all kinds of code, I have good news for you. I’ve migrated my Xamarin.Forms package to .NET MAUI, and you can easily build multilingual applications with MAUI. No need to restart the application, the language takes effect immediately and works on all platforms. You can also use it from XAML, and C# code. It can handle multiple resource files at the same time. It can store the last language set by the user, and the next time you restart it, it will use the same language as the last time the user set it. But instead of letters, watch this video to see what exactly it can do: Let’s get started This project is available on GitHub: https://github.com/banditoth/MAUI.Packages To start with, I’ve put together a demo app for you for the sake of demonstration. There is no extra functionality, just 4 buttons. Three of them are to change the language of the application, and one of them is to give us a pop-up window. There is no logic to it yet, but together we will build on the article. Create translation files The first thing you will need are files containing multilingual translations. If you are familiar with Xamarin Forms, I will not surprise you: we…

Configure CI pipeline with .NET MAUI Release candidate (for NuGets)

This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.In order to do automated builds in Azure DevOps with the .NET MAUI Release Candidate release, we need a few extra steps in the pipeline configuration. I used these steps to ensure that the NuGet packages I develop are automatically compiled and uploaded to NuGet.org. In this article I won’t go into detail about how to create a CI pipeline, I just want to show you the difference from a normal CI pipeline. I haven’t tried building and deploying applications in the cloud at the moment, but it can probably be done. Also, I don’t go into how to make the package automatically go to NuGet.org, for that I recommend an earlier article (and also how to create a CI/CD pipeline): https://www.banditoth.net/2021/11/09/azure-devops-setup-private-nuget-feed-with-ci/ Since a final version of .NET MAUI has not been released as of today, in order to build our applications in the cloud, we need to install the MAUI Workload on the Agent.If we do not do this, we may encounter the following error: Adjust your pipeline In order to install the workload on our build agent, create a new task at the very beginning in the pipeline file, which is executes a command in the command line: This will result the following task in the yaml file: The installation of the workload will take about 5 minutes….

.NET MAUI RC1 is available with VS for Mac support

This content has 3 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.Good news for .NET MAUI fans. We’ll soon have a stable version from the wonderful developers at Microsoft, but in the meantime, here we have the first RC version of .NET MAUI.There’s a lot of new features in this version, including integration with the Essentials package, much more customizable styles, etc.But today I want to talk about the most important thing for me, which is the support for Visual Studio for Mac. Well, it’s not so official yet, and it’s not so usable, but we can see progress. VS for Mac 2022 is no longer a stranger to MAUI projects. Unfortunately, I couldn’t get the debugging to work, but you can now start the project on almost any platform. Let’s use MAUI in Visual Studio 2022 for Mac First and most importantly, and I experienced it first hand.If the IDE you want to use throws the following errors: And you can’t install the recommended packages because the following error is displayed: Then be sure to install .NET version 6.0.3XX. You can do this from this url and select the appropriate processor architecture. https://github.com/dotnet/installer To check which version is installed, you can check in the terminal with the following paranncs: If you have installed the required version of .NET 6.0, issue the following command: You can then use MAUI in Visual…

The easiest and best MVVM toolkit also for .NET MAUI.

This content has 3 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.Guys, this is unbelievable. Microsoft Community toolkit has added a tool that means you never have to worry about which MVVM framework you’re voting for. None can be as good as this one. It can be used not only for .NET MAUI, but also for other technologies (e.g. WPF). But before I sing your praises, let’s look at what this package has to offer us: Introducing CommunityToolkit.Mvvm First of all, you don’t need to implement INotifyPropertyChanged in ViewModels. And by that I mean not even its parent classes. Since this component is a code generator, it’s enough to make your classes partial, and the INotifyPropertyChanged implementation is done by it, instead of you. This means that your class will be supplemented with the best implementation so that you can easily use common methods like SetProperty in the setter branch of your properties. Okay, okay, but almost any MVVM framework could do this, and you didn’t even need to use a code generator, just simply derive from a parent class. I’ll do you one better: what if you didn’t have to write the setter and getter branches of the properties at all? What if the toolkit made them itself? If you could implement a property declaration from two lines of code?Well, that’s what makes this toolkit good: It does all that…