ReactiveProperty 在 Reactive Extensions 中提供了 MVVM 和异步支持功能。目标框架包括 .NET 6+、.NET Framework 4.7.2 和 .NET Standar。
ReactiveProperty 在 Reactive Extensions 中提供了 MVVM 和异步支持功能。目标框架包括 .NET 6+、.NET Framework 4.7.2 和 .NET Standar。
ReactiveProperty 在 Reactive Extensions 中提供了 MVVM 和异步支持功能。目标框架为 .NET 8.0+、.NET Framework 4.7.2 和 .NET Standard 2.0。
如果您正在开发新的应用程序,可以考虑使用 R3 而不是 ReactiveProperty。R3 由原作者重新设计,符合当前的 .NET 生态系统,并提供了 ReactiveProperty 中的大部分功能。
ReactiveProperty 是一款非常强大且简单的库。 此示例应用的 ViewModel 代码如下:
public class MainPageViewModel
{
public ReactivePropertySlim Input { get; }
public ReadOnlyReactivePropertySlim Output { get; }
public MainPageViewModel()
{
Input = new ReactivePropertySlim("");
Output = Input
.Delay(TimeSpan.FromSeconds(1))
.Select(x => x.ToUpper())
.ObserveOnDispatcher()
.ToReadOnlyReactivePropertySlim();
}
}这真的很简单且易于理解(我认为!)。因为没有基类和接口。只需要在输入属性和输出属性之间写出声明性代码。所有步骤都写在了ReactiveProperty 文档中的"入门"部分。ReactiveProperty 的概念很简单,它是一个核心类,名为 ReactiveProperty[Slim],它只是一个包装类,具有一个值,并实现了 IObservable 和 INotifyPropertyChanged。IObservable 用于将属性值的变化事件连接到 Rx LINQ 方法通道中,INotifyPropertyChanged 用于数据绑定系统,如 WPF、WinUI 和 MAUI。
ReactiveProperty 的一个重要概念是"有趣的编程"。使用 ReactiveProperty 的 ViewModel 代码非常简单。
暂无开放 Issues,或尚未同步最近议题。