GrossumRed 0.0.1-a37
Requires NuGet 2.5 or higher.
dotnet add package GrossumRed --version 0.0.1-a37
NuGet\Install-Package GrossumRed -Version 0.0.1-a37
<PackageReference Include="GrossumRed" Version="0.0.1-a37" />
<PackageVersion Include="GrossumRed" Version="0.0.1-a37" />
<PackageReference Include="GrossumRed" />
paket add GrossumRed --version 0.0.1-a37
#r "nuget: GrossumRed, 0.0.1-a37"
#addin nuget:?package=GrossumRed&version=0.0.1-a37&prerelease
#tool nuget:?package=GrossumRed&version=0.0.1-a37&prerelease
GrossumRed generates csharp code which inherits INotifyPropertyChanged from POCO.
Example
Input VmCls.vm.cs:
using System;
namespace Hoge
{
public class VmCls: System.Object
{
public int PropertyA { get; set; }
public string PropertyB { get; set; }
}
}
Output VmCls.vm.g.cs:
For readability, I removed some extra code (such as #line) and indented.
using System;
namespace Hoge
{
public class VmCls : System.Object, System.ComponentModel.INotifyPropertyChanged
{
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
public int PropertyA
{
get { return __PropertyA; }
set
{
if (Object.ReferenceEquals(__PropertyA, value)) return;
if (Object.ReferenceEquals(__PropertyA, null) || !__PropertyA.Equals(value))
{
__PropertyA = value;
if (PropertyChanged != null)
{
PropertyChanged.Invoke(
this,
new System.ComponentModel.PropertyChangedEventArgs("PropertyA"));
}
}
}
}
private int __PropertyA;
public string PropertyB
{
get { return __PropertyB; }
set
{
if (Object.ReferenceEquals(__PropertyB, value)) return;
if (Object.ReferenceEquals(__PropertyB, null) || !__PropertyB.Equals(value))
{
__PropertyB = value;
if (PropertyChanged != null)
{
PropertyChanged.Invoke(
this,
new System.ComponentModel.PropertyChangedEventArgs("PropertyB"));
}
}
}
}
private string __PropertyB;
}
}
How to use
You will need to reload your project for the 'GrossumVwMdl' build action to be recognized.
Once you marked file as 'GrossumVwMdl' in your project,
this file will be compiled to their respective .g.cs
parser classes before every build.
These classes will be automatically included in compilation.
If you mark .cs file, you may unregister from compiler target.
WpfSmple.csproj:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net45</TargetFrameworks>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<Compile Remove="MainWindowViewModel.vm.cs" />
<GrossumVwMdl Include="MainWindowViewModel.vm.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="GrossumRed" Version="0.0.1-a15" />
</ItemGroup>
</Project>
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.