Skip to content

Commit 1e0ab56

Browse files
authored
Updated to use Source Generators (#102)
1 parent c8b5af1 commit 1e0ab56

File tree

7 files changed

+36
-31
lines changed

7 files changed

+36
-31
lines changed

src/ReactiveMvvm.Avalonia/ReactiveMvvm.Avalonia.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5-
<AvaloniaVersion>11.0.7</AvaloniaVersion>
5+
<AvaloniaVersion>11.1.1</AvaloniaVersion>
66
</PropertyGroup>
77
<ItemGroup>
88
<Compile Update="**\*.xaml.cs">

src/ReactiveMvvm.Blazor.Wasm/ReactiveMvvm.Blazor.Wasm.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.6" />
11-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.6" PrivateAssets="all" />
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

src/ReactiveMvvm.Blazor/ReactiveMvvm.Blazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageReference Include="ReactiveUI.Blazor" Version="20.1.1" />
8-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.6" />
8+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.7" />
99
</ItemGroup>
1010
<ItemGroup>
1111
<ProjectReference Include="..\ReactiveMvvm\ReactiveMvvm.csproj" />

src/ReactiveMvvm.Terminal/ReactiveMvvm.Terminal.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="JetBrains.Annotations" Version="[2024.2.0,)" PrivateAssets="all" />
7+
<PackageReference Include="JetBrains.Annotations" Version="[2024.2.0,)" PrivateAssets="all" />
88
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" />
9-
<PackageReference Include="System.Text.Json" Version="8.0.4" />
109
<PackageReference Include="Terminal.Gui" Version="2.0.0-prealpha.1829" />
11-
<PackageReference Include="NStack.Core" Version="1.1.1" />
10+
<PackageReference Include="NStack.Core" Version="1.1.1" />
1211
</ItemGroup>
1312
<ItemGroup>
1413
<ProjectReference Include="..\ReactiveMvvm\ReactiveMvvm.csproj" />

src/ReactiveMvvm/FodyWeavers.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFramework>netstandard2.0</TargetFramework>
4-
</PropertyGroup>
5-
<ItemGroup>
6-
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
7-
<PackageReference Include="ReactiveUI" Version="20.1.1" />
8-
</ItemGroup>
2+
<PropertyGroup>
3+
<TargetFramework>netstandard2.0</TargetFramework>
4+
<LangVersion>latest</LangVersion>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageReference Include="ReactiveUI" Version="20.1.1" />
8+
<PackageReference Include="ReactiveUI.SourceGenerators" Version="1.0.3" PrivateAssets="all" />
9+
<PackageReference Include="System.Text.Json" Version="8.0.4" />
10+
</ItemGroup>
911
</Project>

src/ReactiveMvvm/ViewModels/FeedbackViewModel.cs

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,38 @@
33
using System.Reactive.Linq;
44
using System.Reactive.Disposables;
55
using ReactiveMvvm.Interfaces;
6-
using ReactiveUI.Fody.Helpers;
6+
using ReactiveUI.SourceGenerators;
77
using ReactiveUI;
88

99
namespace ReactiveMvvm.ViewModels
1010
{
11-
public sealed class FeedbackViewModel : ReactiveObject, IActivatableViewModel
11+
public partial class FeedbackViewModel : ReactiveObject, IActivatableViewModel
1212
{
13+
[Reactive]
14+
private bool _hasErrors;
15+
[Reactive]
16+
private string _elapsed = string.Empty;
17+
[Reactive]
18+
private string _title = string.Empty;
19+
[Reactive]
20+
private int _titleLength;
21+
[Reactive]
22+
private string _message = string.Empty;
23+
[Reactive]
24+
private int _messageLength;
25+
[Reactive]
26+
private int _section;
27+
[Reactive]
28+
private bool _issue = true;
29+
[Reactive]
30+
private bool _idea;
31+
1332
public ViewModelActivator Activator { get; } = new ViewModelActivator();
1433
public ReactiveCommand<Unit, Unit> Submit { get; }
15-
16-
[Reactive] public bool HasErrors { get; private set; }
17-
[Reactive] public string Elapsed { get; private set; } = string.Empty;
1834

19-
[Reactive] public string Title { get; set; } = string.Empty;
20-
[Reactive] public int TitleLength { get; private set; }
2135
public int TitleLengthMax { get; } = 15;
2236

23-
[Reactive] public string Message { get; set; } = string.Empty;
24-
[Reactive] public int MessageLength { get; private set; }
2537
public int MessageLengthMax { get; } = 30;
26-
27-
[Reactive] public int Section { get; set; }
28-
[Reactive] public bool Issue { get; set; } = true;
29-
[Reactive] public bool Idea { get; set; }
3038

3139
public FeedbackViewModel(ISender sender, IClock clock)
3240
{

0 commit comments

Comments
 (0)