Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Aug 9, 2024
1 parent 5d2fe98 commit bef98d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ Injects code which raises the [`PropertyChanged` event](https://msdn.microsoft.c

**It is expected that all developers using Fody [become a Patron on OpenCollective](https://opencollective.com/fody/contribute/patron-3059). [See Licensing/Patron FAQ](https://github.com/Fody/Home/blob/master/pages/licensing-patron-faq.md) for more information.**


## Usage

See also [Fody usage](https://github.com/Fody/Home/blob/master/pages/usage.md).


### NuGet installation

Install the [PropertyChanged.Fody NuGet package](https://nuget.org/packages/PropertyChanged.Fody/) and update the [Fody NuGet package](https://nuget.org/packages/Fody/):
Expand All @@ -27,6 +29,7 @@ PM> Install-Package PropertyChanged.Fody

The `Install-Package Fody` is required since NuGet always defaults to the oldest, and most buggy, version of any dependency.


### Add to FodyWeavers.xml

Add `<PropertyChanged/>` to [FodyWeavers.xml](https://github.com/Fody/Home/blob/master/pages/usage.md#add-fodyweaversxml)
Expand All @@ -37,6 +40,7 @@ Add `<PropertyChanged/>` to [FodyWeavers.xml](https://github.com/Fody/Home/blob/
</Weavers>
```


## Overview

**NOTE: All classes that implement `INotifyPropertyChanged` will have notification code injected into property setters.**
Expand Down Expand Up @@ -109,6 +113,7 @@ internal static class InternalEventArgsCache

(the actual injected type and method names are different)


## Code Generator

Starting with version 4 PropertyChanged.Fody ships with a C# code generator that can even more simplify your code by generating
Expand Down Expand Up @@ -164,6 +169,7 @@ You can configure the code generator via properties in your project file:
- *IsCodeGeneratorDisabled*: Set to `true` to switch off the code generator.
- *EventInvokerName*: Change the name of the event invoker method from `OnPropertyChanged` to your favorite name.


### Workaround for WPF projects targeting multiple frameworks:

WPF projects targeting multiple frameworks may fail during the compilation of the `*_wpftmp.csproj` with
Expand All @@ -189,6 +195,7 @@ This can be fixed by adding this build target to your project:

---


## Notes

- **Dependent properties** — In the above sample, the getter for `FullName` depends on the getters for `GivenName` and `FamilyName`. Therefore, when either `GivenName` or `FamilyName` is set, `PropertyChanged` is raised for `FullName` as well. This behavior can be configured manually using the [`AlsoNotifyFor` attribute](https://github.com/Fody/PropertyChanged/wiki/Attributes#alsonotifyforattribute) on the source property, or the [`DependsOn` attribute](https://github.com/Fody/PropertyChanged/wiki/Attributes#dependsonattribute) on the target property).
Expand All @@ -207,6 +214,7 @@ This can be fixed by adding this build target to your project:

For more information, see the [wiki pages](https://github.com/Fody/PropertyChanged/wiki).


## Icon

Icon courtesy of [The Noun Project](https://thenounproject.com)

0 comments on commit bef98d1

Please sign in to comment.