You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.ComponentModel.NotifyParentPropertyAttribute can only decorate a property but a ObservableProperty must be defined as a field so that a property can be generated automatically.
To allow them to work together, we should either provide a CommunityToolkit implementation of NotifyParentPropertyAttribute or allow ObservablePropertyAttribute to be used with a partial property (#555).
For now, the latter is infeasible as C# does not allow partial properties.
When the Child.Name property gets updated, the ParentModel should be notified for the change of the Child property, i.e., OnPropertyChanged(nameof(Child)) should be called.
varparentModel=newParentModel();parentModel.Child.Name="something";// should call OnPropertyChanged(nameof(Child))
Breaking change?
No
Alternatives
Currently one has to choose between [NotifyParentChanged(true)] and [ObservableProperty].
Additional context
No response
Help us help you
Yes, but only if others can assist
The text was updated successfully, but these errors were encountered:
Overview
System.ComponentModel.NotifyParentPropertyAttribute
can only decorate a property but aObservableProperty
must be defined as a field so that a property can be generated automatically.To allow them to work together, we should either provide a CommunityToolkit implementation of
NotifyParentPropertyAttribute
or allowObservablePropertyAttribute
to be used with a partial property (#555).For now, the latter is infeasible as C# does not allow partial properties.
API breakdown
Usage example
When the
Child.Name
property gets updated, theParentModel
should be notified for the change of theChild
property, i.e.,OnPropertyChanged(nameof(Child))
should be called.Breaking change?
No
Alternatives
Currently one has to choose between
[NotifyParentChanged(true)]
and[ObservableProperty]
.Additional context
No response
Help us help you
Yes, but only if others can assist
The text was updated successfully, but these errors were encountered: