我通过nuget将最新的ReactiveUI(5.0.2)下载到基于.NET 4.5的项目中.
我用一个属性创建了简单的视图模型类:
using System;
using System.Threading;
using System.Windows;
using ReactiveUI.Xaml;
namespace ReactiveUI.Study.ViewModels
{
public class ShellViewModel : ReactiveObject
{
#region Properties
private string _login;
public string Login
{
get
{
return _login;
}
set
{
this.RaiseAndSetIfChanged(x => x.Login, value);
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试编译我的项目时,我得到了异常
Cannot convert lambda expression to type 'ref string' because it is not a delegate type
Run Code Online (Sandbox Code Playgroud)
我刚开始学习我不知道这个问题的根源在哪里,因为我使用来自https://github.com/reactiveui/ReactiveUI.Samples/blob/master/ReactiveUI_4Only.Samples.sln的样本
并且所有项目都基于.NET 4.0,并且还使用旧版本的ReactiveUI.
谢谢