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
From the course: .NET 9 Maui: Enhanced Features for Cross-Platform Development
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
-
-
-
-
-
-
(Locked)
Params collections4m 6s
-
(Locked)
New lock type and semantics3m 53s
-
(Locked)
New escape sequence: \e1m 48s
-
(Locked)
Method group natural type improvements4m 18s
-
(Locked)
Implicit indexer access in object initializers2m 49s
-
(Locked)
Enable ref locals and unsafe contexts in iterators and async methods3m 55s
-
(Locked)
Enable ref struct types to implement interfaces4m 43s
-
(Locked)
Allow ref struct types as arguments for type parameters in generics5m 50s
-
(Locked)
Partial properties and indexers6m 21s
-
(Locked)
Overload resolution priority4m 4s
-
(Locked)
-
-