Skip to content

Commit 712db9c

Browse files
committed
Migrate to ReactiveUI.SourceGenerators and update dependencies
Replaces ReactiveUI.Fody with ReactiveUI.SourceGenerators for property change notifications and updates related code to use source generators. Removes FodyWeavers files and Fody package references. Updates Avalonia and Svg.Skia package versions, improves nullability annotations, and enhances scaling logic in grid rendering. Refactors Skia icon drawing to use SVG path data for improved visuals and antialiasing.
1 parent a3809a5 commit 712db9c

16 files changed

Lines changed: 179 additions & 316 deletions

src/Demo.AvaloniaApplication.Desktop/Demo.AvaloniaApplication.Desktop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Avalonia.Desktop" Version="11.3.4" />
14+
<PackageReference Include="Avalonia.Desktop" Version="11.3.5" />
1515
<PackageReference Include="System.Text.Json" Version="9.0.8" />
1616
</ItemGroup>
1717

src/Demo.AvaloniaApplication/Demo.AvaloniaApplication.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<Content Include="Resources\**" CopyToOutputDirectory="Always"/>
13+
<Content Include="Resources\**" CopyToOutputDirectory="Always" />
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Avalonia" Version="11.3.4" />
18-
<PackageReference Include="Avalonia.Desktop" Version="11.3.4" />
19-
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.4" />
20-
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.4" />
21-
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.4" />
17+
<PackageReference Include="Avalonia" Version="11.3.5" />
18+
<PackageReference Include="Avalonia.Desktop" Version="11.3.5" />
19+
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.5" />
20+
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.5" />
21+
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.5" />
2222
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
23-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.4" />
23+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.5" />
2424
<PackageReference Include="Splat.DependencyInjection.SourceGenerator" Version="1.2.3">
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/HierarchyGrid.Avalonia/FodyWeavers.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/HierarchyGrid.Avalonia/FodyWeavers.xsd

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/HierarchyGrid.Avalonia/Grid.axaml.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ GridSplitter GetSplitter(int idx)
575575
{
576576
var (coord, def) = c;
577577
var splitter = GetSplitter(splitterCount++);
578-
splitter.Height = coord.Height;
578+
splitter.Height = coord.Height * viewModel.Scale;
579579
splitter.Width = 2;
580580
splitter.ResizeDirection = GridResizeDirection.Columns;
581581

@@ -589,8 +589,8 @@ GridSplitter GetSplitter(int idx)
589589
.Subscribe();
590590
viewModel.ResizeObservables.Enqueue(dsp);
591591

592-
Canvas.SetTop(splitter, coord.Top);
593-
Canvas.SetLeft(splitter, coord.Right - 2);
592+
Canvas.SetTop(splitter, coord.Top * viewModel.Scale);
593+
Canvas.SetLeft(splitter, (coord.Right - 2) * viewModel.Scale);
594594
}
595595

596596
var currentX = 0d;
@@ -604,7 +604,7 @@ GridSplitter GetSplitter(int idx)
604604
var currentIndex = i;
605605
var width = viewModel.RowsHeadersWidth[currentIndex];
606606
var splitter = GetSplitter(splitterCount++);
607-
splitter.Height = height;
607+
splitter.Height = height * viewModel.Scale;
608608
splitter.Width = 2;
609609
splitter.ResizeDirection = GridResizeDirection.Columns;
610610
currentX += width;
@@ -620,8 +620,8 @@ GridSplitter GetSplitter(int idx)
620620
.Subscribe();
621621
viewModel.ResizeObservables.Enqueue(dsp);
622622

623-
Canvas.SetTop(splitter, currentY);
624-
Canvas.SetLeft(splitter, currentX - 2);
623+
Canvas.SetTop(splitter, currentY * viewModel.Scale);
624+
Canvas.SetLeft(splitter, (currentX - 2) * viewModel.Scale);
625625
}
626626

627627
var exceeding = splitters.Skip(splitterCount).ToArray();

src/HierarchyGrid.Avalonia/HierarchyGrid.Avalonia.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.4" />
23-
<PackageReference Include="Avalonia.Skia" Version="11.3.4" />
22+
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.5" />
23+
<PackageReference Include="Avalonia.Skia" Version="11.3.5" />
2424
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
25-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.4" />
25+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.5" />
2626
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" PrivateAssets="all" />
27-
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
2827
<PackageReference Include="SkiaSharp.Views" Version="3.119.0" />
2928
<PackageReference Include="System.Text.Json" Version="9.0.8" />
3029
</ItemGroup>

src/HierarchyGrid.Definitions/FodyWeavers.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/HierarchyGrid.Definitions/FodyWeavers.xsd

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/HierarchyGrid.Definitions/HierarchyDefinition.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
using System.Linq;
55
using DynamicData;
66
using ReactiveUI;
7-
using ReactiveUI.Fody.Helpers;
7+
using ReactiveUI.SourceGenerators;
88

99
namespace HierarchyGrid.Definitions;
1010

11-
public abstract class HierarchyDefinition
11+
public abstract partial class HierarchyDefinition
1212
: ReactiveObject,
1313
IActivatableViewModel,
1414
IComparable<HierarchyDefinition>,
@@ -253,10 +253,10 @@ public bool IsExpanded
253253
}
254254

255255
[Reactive]
256-
public bool CanToggle { get; set; } = true;
256+
public partial bool CanToggle { get; set; } = true;
257257

258258
[Reactive]
259-
public bool IsHighlighted { get; set; }
259+
public partial bool IsHighlighted { get; set; }
260260

261261
/// <summary>
262262
/// Sets state to expanded for current element and all its children.

src/HierarchyGrid.Definitions/HierarchyGrid.Definitions.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>default</LangVersion>
5+
<LangVersion>preview</LangVersion>
66
</PropertyGroup>
77

88
<PropertyGroup>
@@ -32,7 +32,11 @@
3232
<ItemGroup>
3333
<PackageReference Include="LanguageExt.Core" Version="4.4.9" />
3434
<PackageReference Include="morelinq" Version="4.4.0" />
35-
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
35+
<PackageReference Include="ReactiveUI" Version="20.4.1" />
36+
<PackageReference Include="ReactiveUI.SourceGenerators" Version="2.4.1">
37+
<PrivateAssets>all</PrivateAssets>
38+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
39+
</PackageReference>
3640
<PackageReference Include="System.Text.Json" Version="9.0.8" />
3741
</ItemGroup>
3842
</Project>

0 commit comments

Comments
 (0)