Skip to content

Commit

Permalink
Updated to use Source Generators
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPulman committed Jul 29, 2024
1 parent d63a04b commit ed0bdc6
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/ReactiveMvvm.Avalonia/ReactiveMvvm.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<AvaloniaVersion>11.0.7</AvaloniaVersion>
<AvaloniaVersion>11.1.1</AvaloniaVersion>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
Expand Down
4 changes: 2 additions & 2 deletions src/ReactiveMvvm.Blazor.Wasm/ReactiveMvvm.Blazor.Wasm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveMvvm.Blazor/ReactiveMvvm.Blazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ReactiveUI.Blazor" Version="20.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.7" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ReactiveMvvm\ReactiveMvvm.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveMvvm.Terminal/ReactiveMvvm.Terminal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" />
<PackageReference Include="Terminal.Gui" Version="2.0.0-pre.251" />
<PackageReference Include="Terminal.Gui" Version="2.0.0-prealpha.1829" />
<PackageReference Include="NStack.Core" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions src/ReactiveMvvm/FodyWeavers.xml

This file was deleted.

16 changes: 9 additions & 7 deletions src/ReactiveMvvm/ReactiveMvvm.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageReference Include="ReactiveUI" Version="20.1.1" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ReactiveUI" Version="20.1.1" />
<PackageReference Include="ReactiveUI.SourceGenerators" Version="1.0.3" PrivateAssets="all" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>
</Project>
34 changes: 21 additions & 13 deletions src/ReactiveMvvm/ViewModels/FeedbackViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,38 @@
using System.Reactive.Linq;
using System.Reactive.Disposables;
using ReactiveMvvm.Interfaces;
using ReactiveUI.Fody.Helpers;
using ReactiveUI.SourceGenerators;
using ReactiveUI;

namespace ReactiveMvvm.ViewModels
{
public sealed class FeedbackViewModel : ReactiveObject, IActivatableViewModel
public partial class FeedbackViewModel : ReactiveObject, IActivatableViewModel
{
[Reactive]
private bool _hasErrors;
[Reactive]
private string _elapsed = string.Empty;
[Reactive]
private string _title = string.Empty;
[Reactive]
private int _titleLength;
[Reactive]
private string _message = string.Empty;
[Reactive]
private int _messageLength;
[Reactive]
private int _section;
[Reactive]
private bool _issue = true;
[Reactive]
private bool _idea;

public ViewModelActivator Activator { get; } = new ViewModelActivator();
public ReactiveCommand<Unit, Unit> Submit { get; }

[Reactive] public bool HasErrors { get; private set; }
[Reactive] public string Elapsed { get; private set; } = string.Empty;

[Reactive] public string Title { get; set; } = string.Empty;
[Reactive] public int TitleLength { get; private set; }
public int TitleLengthMax { get; } = 15;

[Reactive] public string Message { get; set; } = string.Empty;
[Reactive] public int MessageLength { get; private set; }
public int MessageLengthMax { get; } = 30;

[Reactive] public int Section { get; set; }
[Reactive] public bool Issue { get; set; } = true;
[Reactive] public bool Idea { get; set; }

public FeedbackViewModel(ISender sender, IClock clock)
{
Expand Down

0 comments on commit ed0bdc6

Please sign in to comment.