Skip to content

Warn if invoking with eventargs #133

Open
@JohanLarsson

Description

@JohanLarsson
public class ViewModel : INotifyPropertyChanged
{
	private int bar;

	public event PropertyChangedEventHandler PropertyChanged;

	public int Bar
	{
		get { return this.bar; }
		set
		{
			if (value == this.bar)
			{
				this.bar = value;this.OnPropertyChanged(new PropertyChangedEventArgs(nameof(Bar)));
			}
		}
	}

	protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
	{
		this.PropertyChanged?.Invoke(this, e);
	}
}

Clumsy and inefficient.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions