Repository navigation
Was [IViewFor] generation removed? #4555
|
Hello there, I've been working through a migration from v20 to v26. Its been quite the change but I have a running application again. My question is about the Was it removed or am I supposed to reference the SourceGenerator package directly for that? I found some docs that said the source generators are all included in the core package now (and certainly many of them are working). Here are my related packages: <PackageVersion Include="ReactiveUI.Validation.Reactive" Version="8.1.0" />
<PackageVersion Include="ReactiveUI.WPF.Reactive" Version="26.0.1" />
<PackageVersion Include="ReactiveUI.Reactive" Version="26.0.1" />
<PackageVersion Include="ReactiveUI.Binding.Wpf.Reactive" Version="9.1.0" />
<PackageVersion Include="Splat.Microsoft.Extensions.DependencyInjection" Version="21.0.0" />
<PackageVersion Include="System.Reactive" Version="7.0.0" />
|
Replies: 1 comment 1 reply
|
It was removed. ReactiveUI.SourceGenerators 4.0.0 dropped The docs you found are ahead of the release. It was added back on main in #524 (" Until it does, the 4.2.0 README says to write the implementation yourself or derive from public partial class ExampleView : UserControl, IViewFor<ExampleViewModel>
{
public ExampleViewModel? ViewModel { get; set; }
object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (ExampleViewModel?)value; }
}For WPF bindings to I checked this by building against ReactiveUI.Reactive 26.0.1 on net10.0 (not WPF): the hand-written form builds and runs, and |
It was removed. ReactiveUI.SourceGenerators 4.0.0 dropped
[IViewFor]in favour of ReactiveUI.Binding (#502, listed under breaking changes in the v4.0.0 release). ReactiveUI 26.0.1 brings in SourceGenerators 4.2.0, and the attribute library in that package hasReactive,ReactiveCommand,IReactiveObject,BindableDerivedList,ReactiveCollectionand the WinForms hosts, but noIViewForAttribute. Referencing the package directly won't help, 4.2.0 is the latest on NuGet.The docs you found are ahead of the release. It was added back on main in #524 ("
[IViewFor],[IViewFor<T>]and[IViewFor("TypeName")]are back"), which is what the current README describes, but that hasn't shipped yet.Until it …