Voodoo Magic for WPF.
C#
Latest commit e1540ca Jun 7, 2016 @neuecc Update ReadMe.md
Permalink
Failed to load latest commit information.
ObserveEveryValueChanged changed namespace Jun 7, 2016
WpfSample changed namespace Jun 7, 2016
.gitignore Init Jun 6, 2016
ObserveEveryValueChanged.sln Init Jun 6, 2016
ReadMe.md Update ReadMe.md Jun 7, 2016

ReadMe.md

ObserveEveryValueChanged

Voodoo Magic for WPF.

You can observe all properties that is not implements INotifyPropertyChanged.

Sample

using Reactive.Bindings.Extensions;

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        this.ObserveEveryValueChanged(x => x.Width).Subscribe(x => WidthText.Text = x.ToString());
        this.ObserveEveryValueChanged(x => x.Height).Subscribe(x => HeightText.Text = x.ToString());
    }
}

wpfgif

ObserveEveryValueChanged(propertySelector). That's all.

with ReactiveProperty, you can create bindable notify property changed value.

ReactiveProperty v2.7.3 includes this extensions

public class MyClass
{
    public int MyProperty { get; set; }
}


public partial class MainWindow : Window
{
    MyClass model;
    public IReadOnlyReactiveProperty<int> MyClassMyProperty { get; }

    public MainWindow()
    {
        InitializeComponent();

        model = new MyClass();
        this.MyClassMyProperty = model.ObserveEveryValueChanged(x => x.MyProperty).ToReadOnlyReactiveProperty();
    }
}