Categories
.NET .NET 8 .NET 9 .NET MAUI Android Behaviors Blazor C# Code Desktop Developer Hybrid iOS MVVM NuGet Quick Fix Toolkit Web Windows Xamarin Xamarin.Forms

.NET MAUI Community Toolkit v10.0: How to Fix BindingContext Issues with Behaviors

Yesterday marked the official release of the highly anticipated .NET MAUI Toolkit (CommunityToolkit.Maui) package v10.0, introducing native support for .NET 9.

Though it is the extended arm of .NET MAUI app development, for newcomers, this officially supported toolkit offers a comprehensive collection of essential components—such as Alerts, Behaviors, Converters, Extensions, Layouts, and Views—that are crucial for developing real-world apps.

This new release has some breaking changes, with the most notable being aligning with the design change introduced in .NET MAUI 9, where Behaviors no longer automatically inherit the BindingContext of their parent (a major shift from the original Xamarin.Forms design).

Categories
.NET .NET 8 .NET 9 .NET MAUI Android Behaviors Blazor C# Code Commands Desktop Developer General Hybrid iOS Made Easy Mobile MVVM Toolkit Windows Xamarin Xamarin.Forms

Handling UI Events with MVVM Commands in .NET MAUI using EventToCommandBehavior

This article is part of the MVVM – Made Easy series, focusing on handling UI events with ViewModel commands.

This series comprises articles that provide insights into working with the MVVM design pattern, to make it a delightful experience. All the articles in this series can be accessed from here – MVVM – Made Easy

The View serves as the user interface, while the ViewModel is composed of Properties and Commands that encapsulate the underlying logic. This architectural layering offers the distinct advantage of enabling independent development and testing of both components. Data Binding functions as the cohesive element that interlinks these two layers.

An event represents a significant mechanism for notifying state changes, such as a button click, to other components that have a vested interest in the occurrence.

The receiver component is capable of responding to the event by subscribing to it through a method whose signature corresponds with the delegate of the event ensuring type safety. And that method is generally referred to as an event handler.

However, the challenge emerges during the testing of the ViewModel, as the event is closely intertwined with the View. Business logic can’t be independently tested.

Categories
.NET .NET 8 .NET 9 .NET MAUI Android Blazor C# Code Desktop Developer General Hybrid iOS macOS Mobile Shell Tips Visual Studio VS Code Web Windows Xamarin Xamarin.Forms

.NET MAUI: Managing Query Parameters with Shell Navigation

This is an article in the Developer Tips series, which offers concise hints to enhance productivity. You can access all the articles in this series here.

The Shell feature in .NET MAUI is extensive, offering numerous capabilities. This article will focus on managing query parameters within shell navigation in .NET MAUI.

Incorporating query parameters during navigation is paramount in real-world apps, as they enable the transfer of data in scenarios such as transitioning from a list page to a details page, thereby preserving the contextual relevance.

The GoToAsync() method serves as the comprehensive solution for all your navigation needs in Shell and is overloaded to cater various requirements.

Categories
.NET .NET 8 .NET 9 .NET MAUI Blazor C# Code Desktop Developer General Hybrid Mobile MVVM NuGet Quick Fix Windows Windows 10 Windows 11 WinUI 3 Xamarin Xamarin.Forms

CommunityToolkit.Mvvm: Resolving Windows 10 MVVM Project Build Issues

Undoubtedly, CommunityToolkit.Mvvm, aka Microsoft MVVM Toolkit, has recently become one of the most popular NuGet packages among MVVM developers.

It effectively abstracts away the boilerplate code, enabling developers to concentrate exclusively on the task.

However, after the release of package version 8.3 and later, while building the project referencing this Toolkit has encountered failures, accompanied by perplexing error messages like System.TypeInitializationException or Found conflicts between different versions of 'WinRT.Runtime' that could not be resolved. when targeting the Windows 10 platform.

Categories
.NET .NET 8 .NET 9 .NET MAUI Android Blazor C# Code Desktop Developer Getting Started Hybrid iOS Learn macOS Mobile Tips Web Windows Xamarin Xamarin.Forms

.NET MAUI – BindableLayout

This is the second article in the newly started series titled Developer Tips, which offers concise hints to enhance productivity. The inaugural article is about Margin and Padding. All the articles in this series can be accessed fromĀ here.

The BindableLayout functions as an item repeater, enabling an ILayout to interact with a data-bound IEnumerable.