Voodoo Magic for WPF.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ObserveEveryValueChanged changed namespace Jun 7, 2016
WpfSample
.gitignore
ObserveEveryValueChanged.sln
ReadMe.md

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();
    }
}