Skip to content
| Marketplace
Sign in
Visual Studio>Tools>ValueChangedGanerator.Vsix
ValueChangedGanerator.Vsix

ValueChangedGanerator.Vsix

iwanaga

|
1,322 installs
| (0) | Free
Roslyn Code Fix provider for generating PropertyChanged from inner struct members.
Download

A Code Fix provider for generating PropertyChanged from inner struct members.

This VSIX inlcudes an analyzer created by using .NET Compiler Platform (Roslyn).

Requirement

Requires Visual Studio 2015.

NuGet Package

You can also download the analyzer from NuGet, RecordConstructorGenerator(https://www.nuget.org/packages/ValueChangedGanerator/)

  • PM> Install-Package ValueChangedGanerator

Usage

  • Insert an inner struct named NotifyRecord into a class that you want to generete its properties.
  • Use 'Quick Action' (Lightbulb) to fix the code

Sample

original source:

 

C#
スクリプトの編集|Remove
csharp
class Point : BindableBase {     struct NotifyRecord     {         public int X;         public int Y;         public int Z => X * Y;          /// <summary>         /// Name.         /// </summary>         public string Name;     } }
class Point : BindableBase  {      struct NotifyRecord      {          public int X;          public int Y;          public int Z => X * Y;            /// <summary>          /// Name.          /// </summary>          public string Name;      }  }
 

 

fixed result of the original source (partial modifier added):

 

C#
スクリプトの編集|Remove
csharp
partial class Point : BindableBase {     struct NotifyRecord     {         public int X;         public int Y;         public int Z => X * Y;          /// <summary>         /// Name.         /// </summary>         public string Name;     } }
partial class Point : BindableBase  {      struct NotifyRecord      {          public int X;          public int Y;          public int Z => X * Y;            /// <summary>          /// Name.          /// </summary>          public string Name;      }  }
 

 

the generetated source code:

 

C#
スクリプトの編集|Remove
csharp
using System.ComponentModel;  partial class Point {     private NotifyRecord _value;      public int X { get { return _value.X; } set { SetProperty(ref _value.X, value, XProperty); OnPropertyChanged(ZProperty); } }     private static readonly PropertyChangedEventArgs XProperty = new PropertyChangedEventArgs(nameof(X));     public int Y { get { return _value.Y; } set { SetProperty(ref _value.Y, value, YProperty); OnPropertyChanged(ZProperty); } }     private static readonly PropertyChangedEventArgs YProperty = new PropertyChangedEventArgs(nameof(Y));      /// <summary>     /// Name.     /// </summary>     public string Name { get { return _value.Name; } set { SetProperty(ref _value.Name, value, NameProperty); } }     private static readonly PropertyChangedEventArgs NameProperty = new PropertyChangedEventArgs(nameof(Name));     public int Z => _value.Z;     private static readonly PropertyChangedEventArgs ZProperty = new PropertyChangedEventArgs(nameof(Z)); }
using System.ComponentModel;    partial class Point  {      private NotifyRecord _value;        public int X { get { return _value.X; } set { SetProperty(ref _value.X, value, XProperty); OnPropertyChanged(ZProperty); } }      private static readonly PropertyChangedEventArgs XProperty = new PropertyChangedEventArgs(nameof(X));      public int Y { get { return _value.Y; } set { SetProperty(ref _value.Y, value, YProperty); OnPropertyChanged(ZProperty); } }      private static readonly PropertyChangedEventArgs YProperty = new PropertyChangedEventArgs(nameof(Y));        /// <summary>      /// Name.      /// </summary>      public string Name { get { return _value.Name; } set { SetProperty(ref _value.Name, value, NameProperty); } }      private static readonly PropertyChangedEventArgs NameProperty = new PropertyChangedEventArgs(nameof(Name));      public int Z => _value.Z;      private static readonly PropertyChangedEventArgs ZProperty = new PropertyChangedEventArgs(nameof(Z));  }
 

 

 



  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft