Skip to content

Commit 875f74d

Browse files
committed
Housekeeping Update readme to reflect changes made
1 parent 3441e3f commit 875f74d

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ This documentation covers using ReactiveUI Source Generators to simplify and enh
1111

1212
ReactiveUI Source Generators automatically generate ReactiveUI objects to streamline your code. These Source Generators are designed to work with ReactiveUI V19.5.31+ and support the following features:
1313

14-
- `[Reactive]` With field and access modifiers, partial property support (C# 13 Visual Studio Version 17.12.0)
14+
- `[Reactive]` With field and access modifiers, partial property support (C# 13 Visual Studio Version 17.12.0), partial properties with initializer support (C# preview only)
15+
- `[Reactive(SetModifier = AccessModifier.Protected)]` With field and access modifiers.
16+
- `[Reactive(Inheritance = InheritanceModifier.Virtual)]` With field and access modifiers. This will generate a virtual property.
17+
- `[Reactive(UseRequired = true)]` With field and access modifiers. This will generate a required property.
1518
- `[ObservableAsProperty]` With field, method, Observable property and partial property support (C# 13 Visual Studio Version 17.12.0)
1619
- `[ObservableAsProperty(ReadOnly = false)]` Removes readonly keyword from the generated helper field
1720
- `[ObservableAsProperty(PropertyName = "ReadOnlyPropertyName")]`
@@ -151,6 +154,20 @@ public partial class MyReactiveClass : ReactiveObject
151154
}
152155
```
153156

157+
### Usage Reactive property from partial property with default value
158+
Partial properties with initial value are supported in C# preview and Visual Studio 17.12.0 and later.
159+
Both the getter and setter must be empty, and the `[Reactive]` attribute must be placed on the property.
160+
Override and Virtual properties are supported.
161+
Set Access Modifier is also supported on partial properties.
162+
```csharp
163+
using ReactiveUI.SourceGenerators;
164+
public partial class MyReactiveClass : ReactiveObject
165+
{
166+
[Reactive]
167+
public partial string MyProperty { get; set; } = "Default Value"
168+
}
169+
```
170+
154171
## Usage ObservableAsPropertyHelper `[ObservableAsProperty]`
155172

156173
ObservableAsPropertyHelper is used to create a read-only property from an IObservable. The generated code will create a backing field and a property that returns the value of the backing field. The backing field is initialized with the value of the IObservable when the class is instantiated.

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "2.1",
3+
"version": "2.2",
44
"publicReleaseRefSpec": [
55
"^refs/heads/master$", // we release out of master
66
"^refs/heads/main$",

0 commit comments

Comments
 (0)