All Projects → runceel → Reactiveproperty

runceel / Reactiveproperty

Licence: mit
ReactiveProperty provides MVVM and asynchronous support features under Reactive Extensions. Target framework is .NET Standard 2.0.

Projects that are alternatives of or similar to Reactiveproperty

Reactiveui
An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
Stars: ✭ 6,709 (+1012.6%)
Mutual labels:  reactive-extensions, xamarin, uwp, mvvm, wpf
Mvvmvalidation
Lightweight library that helps reduce boilerplate when implementing validation in XAML MVVM applications
Stars: ✭ 141 (-76.62%)
Mutual labels:  xamarin, uwp, mvvm, wpf, xaml
Uno
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
Stars: ✭ 6,029 (+899.83%)
Mutual labels:  xamarin, uwp, mvvm, xaml
Xaml Code Experiences
A collection of the experiences I have collected during days of Xamarin and Wpf, while following the MVVM design pattern.
Stars: ✭ 114 (-81.09%)
Mutual labels:  xamarin, mvvm, wpf, xaml
Mvvmcross
The .NET MVVM framework for cross-platform solutions, including Xamarin.iOS, Xamarin.Android, Windows and Mac.
Stars: ✭ 3,594 (+496.02%)
Mutual labels:  xamarin, uwp, mvvm, wpf
Xamarin Forms Gtk Movies Sample
The Movie DB Xamarin.Forms Sample
Stars: ✭ 83 (-86.24%)
Mutual labels:  xamarin, uwp, wpf, xaml
Reactivemvvm
Cross-platform ReactiveUI sample app built for a talk at MSK .NET conf.
Stars: ✭ 94 (-84.41%)
Mutual labels:  xamarin, uwp, mvvm, wpf
Arcgis Runtime Samples Dotnet
Sample code for ArcGIS Runtime SDK for .NET – UWP, WPF, Xamarin.Android, Xamarin.iOS, and Xamarin.Forms
Stars: ✭ 274 (-54.56%)
Mutual labels:  xamarin, uwp, wpf, xaml
Arcgis Toolkit Dotnet
Toolkit for ArcGIS Runtime SDK for .NET
Stars: ✭ 125 (-79.27%)
Mutual labels:  xamarin, uwp, wpf, xaml
Xamarin Demos
This repository contains the Syncfusion Xamarin UI control’s samples and the guide to use them.
Stars: ✭ 218 (-63.85%)
Mutual labels:  xamarin, uwp, mvvm, xaml
Caliburn.micro
A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability.
Stars: ✭ 2,404 (+298.67%)
Mutual labels:  xamarin, uwp, mvvm, wpf
Ammyui
Ammy language repository
Stars: ✭ 356 (-40.96%)
Mutual labels:  xamarin, uwp, wpf, xaml
Mvvmlight
The main purpose of the toolkit is to accelerate the creation and development of MVVM applications in Xamarin.Android, Xamarin.iOS, Xamarin.Forms, Windows 10 UWP, Windows Presentation Foundation (WPF), Silverlight, Windows Phone.
Stars: ✭ 973 (+61.36%)
Mutual labels:  xamarin, uwp, mvvm, wpf
Adaptivecards
A new way for developers to exchange card content in a common and consistent way.
Stars: ✭ 950 (+57.55%)
Mutual labels:  xamarin, uwp, wpf, xaml
arcgis-runtime-demos-dotnet
Demo applications provided by the ArcGIS Runtime SDK for .NET Team
Stars: ✭ 51 (-91.54%)
Mutual labels:  xaml, xamarin, uwp, wpf
Catel
An application development platform
Stars: ✭ 616 (+2.16%)
Mutual labels:  xamarin, uwp, mvvm, wpf
Windowscommunitytoolkit
The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building UWP and .NET apps for Windows 10. The toolkit is part of the .NET Foundation.
Stars: ✭ 4,654 (+671.81%)
Mutual labels:  uwp, mvvm, wpf, xaml
Waf
Win Application Framework (WAF) is a lightweight Framework that helps you to create well structured XAML Applications.
Stars: ✭ 539 (-10.61%)
Mutual labels:  xamarin, uwp, mvvm, wpf
ModernKeePass
KDBX password manager for the Windows Store
Stars: ✭ 29 (-95.19%)
Mutual labels:  xaml, uwp, mvvm
Uno.Themes
This library is designed to help you use the material design system with the Uno Platform
Stars: ✭ 112 (-81.43%)
Mutual labels:  xaml, xamarin, uwp

Japanese

ReactiveProperty

ReactiveProperty provides MVVM and asynchronous support features under Reactive Extensions. Target framework is .NET Standard 2.0.

Build and Release

ReactiveProperty overview

ReactiveProperty is a very powerful and simple library.

Delay and Select

This sample app's ViewModel code is as below:

public class MainPageViewModel
{
    public ReactiveProperty<string> Input { get; }
    public ReadOnlyReactiveProperty<string> Output { get; }
    public MainPageViewModel()
    {
        Input = new ReactiveProperty<string>("");
        Output = Input
            .Delay(TimeSpan.FromSeconds(1))
            .Select(x => x.ToUpper())
            .ToReadOnlyReactiveProperty();
    }
}

It's LINQ and Rx magic.

All steps are written in the "Getting Started" section in the ReactiveProperty documentation.

This library's concept is "Fun programing". ViewModel code using ReactiveProperties is very simple.

ViewModel's popular implementation:

public class AViewModel : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;

    private string _name;
    public string Name
    {
        get => _name;
        set
        {
            _name = value;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Name)));

            // Update a command status
            DoSomethingCommand.RaiseCanExecuteChanged();
        }
    }

    private string _memo;
    public string Memo
    {
        get => _memo;
        set
        {
            _memo = value;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Memo)));

            // Update a command status
            DoSomethingCommand.RaiseCanExecuteChanged();
        }
    }

    // DelegateCommand is plane ICommand implementation.
    public DelegateCommand DoSomethingCommand { get; }

    public AViewModel()
    {
        DoSomethingCommand = new DelegateCommand(
            () => { ... },
            () => !string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Memo)
        );
    }
}

Binding code:

<TextBlock Text="{Binding Name}">
<TextBlock Text="{Binding Memo}">

ViewModel's implementation using ReactiveProperty:

public class AViewModel
{
    public ReactiveProperty<string> Name { get; }
    public ReactiveProperty<string> Memo { get; }
    public ReactiveCommand DoSomethingCommand { get; }

    public AViewModel()
    {
        Name = new ReactiveProperty<string>()
            .SetValidateNotifyError(x => string.IsNullOrEmpty(x) ? "Invalid value" : null);
        Memo = new ReactiveProperty<string>()
            .SetValidateNotifyError(x => string.IsNullOrEmpty(x) ? "Invalid value" : null);
        DoSomethingCommand = new[]
            {
                Name.ObserveHasErrors,
                Memo.ObserveHasErrors,
            }
            .CombineLatestValuesAreAllFalse()
            .ToReactiveCommand()
            .WithSubscribe(() => { ... });
    }
}

Binding code:

<TextBlock Text="{Binding Name.Value}">
<TextBlock Text="{Binding Memo.Value}">

It's very simple.

ReactiveProperty doesn't provide base class by ViewModel, which means that ReactiveProperty can be used together with another MVVM library like Prism, MVVMLight, etc...

Help support ReactiveProperty

Name GitHub Sponsors
runceel https://github.com/sponsors/runceel

Documentation

ReactiveProperty documentation

NuGet packages

Package Id Version and downloads Description
ReactiveProperty The package includes all core features, and the target platform is .NET Standard 2.0. It fits almost all situations.
ReactiveProperty.Core The package includes minimum classes such as ReactivePropertySlim<T> and ReadOnlyReactivePropertySlim<T>. And this doesn't have any dependency even System.Reactive. If you don't need Rx features, then it fits.
ReactiveProperty.WPF The package includes EventToReactiveProperty and EventToReactiveCommand for WPF. This is for .NET Core 3.0 or later and .NET Framework 4.6.1 or later.
ReactiveProperty.UWP The package includes EventToReactiveProperty and EventToReactiveCommand for UWP.
ReactiveProperty.XamarinAndroid The package includes many extension methods to create IObservable from events for Xamarin.Android native.
ReactiveProperty.XamariniOS The package includes many extension methods to bind ReactiveProperty and ReactiveCommand to Xamarin.iOS native controls.

Support

I'm not watching StackOverflow and other forums to support ReactiveProperty, so please feel free to post questions at Github issues. I'm available Japanese(1st language) and English(2nd language).

If too many questions are posted, then I plan to separate posting place about feature requests, issues, questions.

Author info

Yoshifumi Kawai a.k.a. @neuecc is Founder/CEO/CTO of Cysharp, Inc in Tokyo, Japan. Awarded Microsoft MVP for Visual Studio and Development Technologies since April, 2011. He is an original owner of ReactiveProperty.

Takaaki Suzuki a.k.a. @xin9le software developer in Tokyo, Japan. Awarded Microsoft MVP for Visual Studio and Development Technologies since July, 2012.

Kazuki Ota a.k.a. @okazuki software developer in Tokyo, Japan. Awarded Microsoft MVP for Windows Development since July 2011 to Feb 2017. Now, working at Microsoft Japan.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].