Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove INotifyPropertyChanged #1061

Merged
merged 2 commits into from
May 16, 2024
Merged

Remove INotifyPropertyChanged #1061

merged 2 commits into from
May 16, 2024

Conversation

badcel
Copy link
Member

@badcel badcel commented May 16, 2024

  • I agree that my contribution may be licensed either under MIT or any version of LGPL license.

Fixes: #718

badcel added 2 commits May 16, 2024 21:07
Implementing INotifyPropertyChanged seems not to be helpful currently. The interface was implemented since the very beginning of GirCore but the PropertyChanged event was never raised. As there were no complaints there is probably no need for this interface.

Implementing it would mean that every object has 2 different ways of notifying about property changes (1. Notify event, 2. PropertyChanged) which seems a bit odd in the first place. As the notify event is the native system it should be preferred.

While considering a possible implementation it came to mind that the PropertyChanged event should contain the managed name of the property. This would be the only sensible way for a C# dev, so the instance could potentially be compatible to other frameworks which require an instance of INotifyPropertyChanged and access the property via reflection.

To raise the PropertyChanged event every object would always be required to subscribe to the Notify signal and forward it to PropertyChanged (after some property name mapping happend, which could get non trivial, too). If a user does need the INotifyPropertyChanged interface it could be implemented manually as a subclass and the mapping could be implemented manually.
@badcel badcel changed the title Remove notifypropertychanged Remove INotifyPropertyChanged May 16, 2024
@badcel badcel merged commit 9c0214b into main May 16, 2024
3 checks passed
@badcel badcel deleted the remove-notifypropertychanged branch May 16, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify enabling INotifyPropertyChanged
1 participant