zwalsh57
zwalsh57

Reputation: 53

How can I inform an owning object of changes to a child's properties in a MAUI application?

Background

The Problem

My Question


The Code In Question

SpeedDooMainPage.xaml and SpeedDooMainPage.xaml.cs

SqlObjectView - (ContentView)

SqlObjectCollectionView - (ContentView)


So far, I've tried the following things

Upvotes: 0

Views: 1326

Answers (1)

You can try using an ObservableProperty from the CommunityToolkit.Mvvm.ComponentModel:

Change the:

private UserAccount _sessionUser;
public UserAccount SessionUser
{
    get => _sessionUser;
    private set => SetField(ref _sessionUser, value);
}

For:

using CommunityToolkit.Mvvm.ComponentModel;

[ObservableProperty] private UserAccount sessionUser;

This will automatically create a public property SessionUser.

Check the documentation for more details: ObservableProperty attribute

Upvotes: 0

Related Questions