_companyInfo will only fire an event, if you change the object reference, not if you change any of its properties. you need to change the PYEModel class to an observable object whose properties you can bind to.
.Net Maui Validate Property of a Model in the ViewModel Class
Tom Meier
260
Reputation points
I am using MVVM along with the MVVM Community Toolkit.
I have a Constructor in my .Net Maui ViewModel
public EmployeeEditViewModel()
{
CompanyInfo= new PYEModel();
}
I have an Observable property in the .Net Maui ViewModel
[ObservableProperty]
PYEModel _companyInfo;
These events are in the Code Generated Community Toolkit.
OnCompanyInfoChanging
OnPropertyChanging
OnCompanyInfoChanged
OnPropertyChanged
For some reason I can't get any of these events to fire when I change a property of the CompanyInfo Observable Property.