https://github.com/theblubb14/blubbichanged
Automatically generate code to add INotifyPropertyChanged and INotifyPropertyChanging to your properties.
https://github.com/theblubb14/blubbichanged
csharp csharp-sourcegenerator inotifypropertychanged inotifypropertychanging mvvm source-code-generator wpf
Last synced: 28 days ago
JSON representation
Automatically generate code to add INotifyPropertyChanged and INotifyPropertyChanging to your properties.
- Host: GitHub
- URL: https://github.com/theblubb14/blubbichanged
- Owner: TheBlubb14
- License: mit
- Created: 2021-07-27T20:26:52.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-15T21:15:11.000Z (over 4 years ago)
- Last Synced: 2026-02-17T05:02:00.882Z (4 months ago)
- Topics: csharp, csharp-sourcegenerator, inotifypropertychanged, inotifypropertychanging, mvvm, source-code-generator, wpf
- Language: C#
- Homepage: https://www.nuget.org/packages/BlubbiChanged/
- Size: 89.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BlubbiChanged
Automatically generate code to add INotifyPropertyChanged and INotifyPropertyChanging to your properties.
#### What you write
``` cs
partial class Program
{
///
/// That is my name
///
[AutoNotify]
private string myName;
}
```
#### What will be generated
``` cs
partial class Program : System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
{
///
public event global::System.ComponentModel.PropertyChangingEventHandler PropertyChanging;
///
public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
///
/// That is my name
///
public string MyName
{
get => this.myName;
set
{
if (global::System.Collections.Generic.EqualityComparer.Default.Equals(this.myName, value))
return;
this.PropertyChanging?.Invoke(this, new global::System.ComponentModel.PropertyChangingEventArgs("MyName"));
this.myName = value;
this.PropertyChanged?.Invoke(this, new global::System.ComponentModel.PropertyChangedEventArgs("MyName"));
}
}
}
```