From the course: .NET 9 Maui: Enhanced Features for Cross-Platform Development

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Partial properties and indexers

Partial properties and indexers

- [Instructor] Another new capability for C#13 is the ability to make partial properties and indexers. This is particularly useful to Maui developers as we use partial classes as a way to handle per platform code with per platform implementations of the partial classes. The advantage of partial properties and indexers is it allows us to define a property or indexer in the class and call it, but define the implementation in the other half of the partial class. We're going to take a look at how we can do this. And so we're going to start by opening the new view model for this video. And that is called partial property view model. And the view model is a standard class with an indexer that is a two dimensional array and a property. We want to have a per platform implementation. So you're going to mark the class property and indexer all as being partial. So instead of a public class, we're going to go a public partial class. And we could do this part before. What's going to be new is to…

Contents