Xamarin Present and Future Community Toolkit: Q&A with Gerald Versluis

0


[ad_1]

Key points to remember

  • Support for Xamarin Community Toolkit will follow the same support timeline as Xamarin.Forms
  • The Xamarin Community Toolkit .NET MAUI Compat version will have everything the XCT has and is compatible with .NET MAUI
  • We can share code where possible, we can have .NET MAUI and Windows specific code if needed and it is possible to extend the CommunityToolkit family in the future with … CommunityToolkit.Blazor? CommunityToolkit.WinForms? Who knows!
  • Essentials does not have anything that shows a user interface. Not just any user interface at least. If it displays a user interface from the operating system it is running on. Essentials is to access sensors, media, and other functionality that is unrelated to the user interface.
  • All new developments will be incorporated into the .NET MAUI Community Toolkit.

The Xamarin Community Toolkit is a collection of reusable elements for mobile development with Xamarin.Forms, including animations, behaviors, converters, effects, and wizards. It simplifies and illustrates common developer tasks when building iOS, Android, macOS, WPF, and Universal Windows Platform (UWP) applications using Xamarin.Forms. The Xamarin Community Toolkit is available as a Visual Studio NuGet package for new or existing Xamarin.Forms projects.

As Xamarin.Forms evolves to .NET MAUI, the Xamarin Community Toolkit (XCT) is also preparing for the transition. In this Q&A, InfoQ decided to interview Gerald Versluis. He is a software engineer at Microsoft in the Netherlands. He is a senior software engineer at Microsoft and is part of the core team involved in the development and maintenance of Xamarin Community Toolkit. In this interview, we’ll talk about XCT, the MAUI transition and their future roadmap.

InfoQ: What features would you like to see in XCT in the future?

Gerald Versluis: There are so many awesome, community-driven commands and libraries hidden gems, it would be great to add a few to our little toolbox. I think there is still a lot of room for improvement for the Xamarin.Forms and .NET MAUI ecosystem looking at the monitoring suite. A lot of people ask for some sort of data grid or auto-suggestion check and other things as well. So either we are looking to create them ourselves or we can ask a manager of an existing library if they want to work with us and add it to the toolbox.

This way everyone wins: the maintainer does not have to bear the burden of maintaining a library alone, less dispersed libraries, it will be added to an active library, supported by Microsoft, and better known. That said; 3rd party vendors do a great job with their control suites, it will be hard to match them, but they usually get paid so not for everyone. This way we have options and everyone can use whatever commands they want.

But why stop there? I think one of the great things about the toolkit is that we’ve also collected a lot of converters that people are using. If you’ve worked with Xamarin.Forms, you’re probably familiar with at least 1 converter that you need in each project. But instead of wrapping it in a library it’s too small for that, you copy and paste it over and over. Maybe edit it in one project and all of a sudden you have multiple versions going around. By centralizing these in the toolbox, we make maintenance easier, you can simply drop into this one-stop library which is now your one-stop-shop for anything Xamarin.Forms related. And we hope to continue with .NET MAUI.

InfoQ: .NET MAUI Community Toolkit is introduced, but what are the future plans for the Xamarin Community Toolkit?

Versluis: Everything we do in the Xamarin Community Toolkit (XCT) is something we need to (re) evaluate for the .NET MAUI Community (MCT) Toolkit. As we get closer and closer to the release of .NET MAUI, we will be increasingly reluctant to introduce new features.

We are following pretty much the same path for Xamarin.Forms and .NET MAUI. The XCT, like Forms, will mostly receive bug fixes and minor service improvements at this time. At the same time, we are preparing the MCT to see what features we would like to bring and what features we could leave out.

In fact, this means that we will make sure that XCT continues to work with Xamarin.Forms and that new iOS, Android and UWP versions come out, but no new features will be added. When support for Forms ends, support for XCT will also end.

Getting back to the features we might be leaving for the MCT, don’t worry! We also have a .NET MAUI Compat (short for compatible) version of the XCT. If you know a little about .NET MAUI by now, you know that you can always enable a compatibility layer so that your Xamarin.Forms and other renderers can still be used in .NET MAUI until you have the time to rewrite them in the new architecture. .

The XCT .NET MAUI Compat version will have everything the XCT has but is compatible with .NET MAUI. So we have solutions for every scenario and you will never miss any features you could use today.

InfoQ: Currently there are a few community toolkits, do you think they should become one?

Versluis: With the move to the .NET MAUI Community Toolkit, we’re sort of becoming one. The other most notable toolkit is the Windows Community Toolkit. We’ve been in close contact with them since the start of the Xamarin Community Toolkit, but back then it was more difficult to combine our efforts.

Now, with a rewrite of the Toolkit from scratch, we’ve had the unique opportunity to work with the Windows Community Toolkit to work more closely together. This means that we get a unified name: CommunityToolkit.Maui and CommunityToolkit.Windows, we share a GitHub organization where all our code resides and wherever we can we will share the code so that we don’t repeat ourselves.

Will they one day become a large library? I do not think so. No more than what I just described. For that, I think it’s good to understand what the different SDKs are and how they fit together. The Windows Community Toolkit (WCT) targets UWP, or rather Windows. .NET MAUI targets UWP, but also iOS, Android, macOS, etc. So in terms of controls, for example, that would mean that we have to match every control that is now in the WCT. And they already have a lot of controls, but also a lot of controls that work great on desktop but less so on mobile.

Besides the controls, the WCT also took MvvmLight and made it its own evolution in CommunityToolkit.Mvvm, which is great! Since Windows and .NET MAUI share many concepts through XAML, we can now share this MVVM framework in our two toolkits. And in doing so, we can remove some concepts from our toolbox that ourselves came close to implementing an MVVM framework, which we don’t want to do. Now we can extract our ObservableCollection improvements and other items from our toolkit, in the CommunityToolkit.Mvvm package. This way, people who are not interested in MVVM will not get any code that they do not use, but can still add it very easily.

A large library also has a big downside in terms of dependencies. Especially on Android, different commands live in different Android packages. Having everything in one library would mean people would get a lot of dependencies that they would probably never use. It’s a fine line that we’re already trying to balance with the XCT and MCT.

The way we organized it now allows us to really mix and match. We can share code where possible, we can have .NET MAUI and Windows specific code if needed and it is possible to extend the CommunityToolkit family in the future with … CommunityToolkit.Blazor? CommunityToolkit.WinForms? Who knows!

InfoQ: MAUI Essentials is introduced, are there any known policies for which features will go in Community Toolkit and which for Essentials?

Versluis: We have no formal agreements or guidelines on this. But looking at what’s in Essentials and what’s in the Toolbox, the separation is pretty clear. It all starts with: Toolkit has a hard dependency on Xamarin.Forms, Essentials doesn’t. You can use all the Essentials APIs on a Xamarin.Android or Xamarin.iOS project if that’s what you want. It’s basically an abstraction layer over native APIs to make them more .NET style.

The other thing is: the toolkit has a lot of UI features. Whether it’s feature support for working with XAML or full controls now. Essentials does not have anything that shows a user interface. Not just any user interface at least. If it displays a user interface from the operating system it is running on. Essentials is to access sensors, media, and other functionality that is unrelated to the user interface.

There’s always a gray area where there’s some overlap, but the Essentials, .NET MAUI, and Toolkit teams are pretty close to each other, so we can sort things out really quickly and easily.

InfoQ: Looking ahead, will all the features that are implemented in the .NET MAUI Community Toolkit also be implemented in the Xamarin Community Toolkit?

Versluis: If you mean if we plan to backport new features from the MCT to the XCT, the answer will be pretty simple: it won’t happen. As already mentioned; we will follow the same path with the XCT as Xamarin.Forms. The “real” development has stopped, we are now focused on bug fixing and maintenance to keep the XCT compatible with Xamarin.Forms and the OS targets they run on so you can enjoy it for the longest time. possible, but nothing new will be added.

All new developments will be incorporated into the .NET MAUI Community Toolkit.

About the interviewee

Gerald Versluis is a software engineer at Microsoft for the Xamarin.Forms / .NET MAUI team. After years of experience with Azure, ASP.NET, DevOps, Xamarin, and other .NET technologies, he has been involved in a number of different projects and created several real world applications and solutions. Not only does he enjoy coding, he’s also passionate about spreading his knowledge – as well as acquiring some on top of that. Gerald is involved by speaking, providing training sessions (video) and writing blogs and articles, answering questions about Stack Overflow and contributing to open source projects in his spare time.

[ad_2]

Leave A Reply

Your email address will not be published.