question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement INotifyPropertyChanged on data types

See original GitHub issue

The types generated are not implementing INotifyPropertyChanged. Example on .net:

public partial class MyEntity : ... System.ComponentModel.INotifyPropertyChanged {
        ...
        [System.Runtime.Serialization.DataMemberAttribute()]
        public bool MyProperty {
            get {
                return this.MyPropertyField;
            }
            set {
                if ((this.MyPropertyField.Equals(value) != true)) {
                    this.MyPropertyField = value;
                    this.RaisePropertyChanged("MyPropertyField");
                }
            }
        }
        ...
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }

Currently this is generated in a netstandard2.0 project:

public partial class MyEntity
{
        ...
        [System.Runtime.Serialization.DataMemberAttribute()]
        public bool MyProperty
        {
            get
            {
                return this.MyPropertyField;
            }
            set
            {
                this.MyPropertyField= value;
            }
        }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
dasetsercommented, May 8, 2019

Closing since this is supported by dotnet-svcutil. This doesn’t seem like a very common scenario so I don’t think we need to add this to the WCF Web Service Reference Provider UI.

If there’s a reason you need to use the UI instead of dotnet-svcutil you can get it to generate with this by adding the service reference normally, modifying the the ConnectedService.json file to add the option, then updating the service reference. The line you need to add to the json file is:

“enableDataBinding”: true,

4reactions
jnm2commented, Jun 14, 2020

Please add an ‘Implement INotifyPropertyChanged’ checkbox in the UI. INotifyPropertyChanged isn’t only for data binding.

A UI option will help people who are porting applications to .NET Core.

Read more comments on GitHub >

github_iconTop Results From Across the Web

INotifyPropertyChanged Interface (System.ComponentModel)
Notifies clients that a property value has changed. ... the Person type implements the INotifyPropertyChanged interface and raises a PropertyChanged event ...
Read more >
In MVVM model should the model implement ...
Implementing INotifyPropertyChanged in Models is totally acceptable -. Typically, the model implements the facilities that make it easy to ...
Read more >
Data Binding With INotifyPropertyChanged Interface
The object must fire the “PropertyChanged” event whenever the value of one of its public properties changes. So, first of all we'd like...
Read more >
Type-Safe Two-Way Data Binding with INotifyPropertyChanged
The reason for this is that Person needs to inform the binding that the Age property has changed so that it can get...
Read more >
A base class which implements INotifyPropertyChanged
I created an abstract class called BindableObject which implements INotifyPropertyChanged and provides all the goodies promised above. At the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found