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.

MIT License

Stars
7.9K
Committers
193

Bot releases are hidden (Show)

ReactiveUI - ReactiveUI 6.0.6

Published by anaisbetts about 10 years ago

What's New

  • Enable activation for NSViewControllers via hacky hax (#706, thanks @mteper)
ReactiveUI - ReactiveUI 6.0.5

Published by anaisbetts about 10 years ago

What's New

ToProperty and ReactiveCommand are no longer lazy in a test runner

In certain situations, tests that appear to be reasonable would fail, due to a View not being bound to the ViewModel under test. This is due to an optimization that was added in the RxUI 6.0 era, where subscriptions would not be created until the value was requested for the first time.

While the behavior is correct, it also resulted in tricky-to-debug test failures. Now, in the unit test runner, we disable this feature and eagerly subscribe to the source. Check out #705 for more information.

Bug Fixes

  • ReactiveUI is now built using the Xamarin Stable branch, which means that RxUI-Events for iOS is now based on iOS 7.x instead of being based on the iOS 8 Beta
  • Fixed typo in error message (#704, thanks @mteper)
ReactiveUI - ReactiveUI 6.0.4

Published by anaisbetts about 10 years ago

What's New

Bug Fixes

  • Fix SupportLib NuGet package (#692, thanks @shiftkey)
  • Fix bug in WhenActivated where deactivation wouldn't run (#690, thanks @jlaanstra)
  • Ensure SetItem fires the correct notification (#693, thanks @TheGrandUser)
  • Fix activation on NSWindowController (#696, thanks @mteper)
  • Use ExecuteAsync in InvokeCommand (#700, #701, thanks @jlaanstra + @timmit93)
  • Ensure ToProperty properties fire Changing notification (#703)
  • Don't set the Scheduler in Xamarin.Forms in the test runner.
  • Link Xamarin.Mac to NuGet Rx binaries instead of ones shipped in the framework, since Mono no longer ships them.
ReactiveUI - ReactiveUI 6.0.3

Published by anaisbetts about 10 years ago

What's New

Bug Fixes

  • Fixed an issue where subscribing to Changed could cause weird crashes (#665, thanks @sickboy + @mteper)
  • Fix a bug where ReactiveCommand wouldn't correctly marshal exceptions (#686, thanks @flagbug)
  • Don't leak an event to IsHitTestVisible when using WhenActivated (#689, thanks @jlaanstra)
ReactiveUI - ReactiveUI 6.0.2

Published by anaisbetts about 10 years ago

What's New

Bug Fixes

  • Improvements to iOS collection views (#678, #681, thanks @tberman)
  • Fix exception in WeakEventHandler when adding an element twice (#679, thanks @jlaanstra)
  • Update to Rx 2.2.5 to support Universal PCL Profile259 (#676, thanks @jlaanstra)
ReactiveUI - ReactiveUI 6.0.1

Published by anaisbetts over 10 years ago

What's New

Bug Fixes

  • Update Xamarin Forms to have correct metadata (#662, thanks @nestalk)
  • Fix issue with Android platform on startup (#659)
  • Fix design-time issue on WPF with RoutedViewHost
  • Fix issue with bindings disappearing on WPF (#672, thanks @jlaanstra)
  • Update Android Support Library to v20
ReactiveUI - ReactiveUI 6.0

Published by anaisbetts over 10 years ago

Welcome to ReactiveUI 6.0

After 8 months of work, 878 commits, and 1032 files changed, ReactiveUI 6.0 is finally released, the biggest RxUI release ever! A huge thanks to our contributers for this release:

  • Johan Laanstra
  • Oren Novotny
  • Todd Berman
  • Michael Teper
  • Felipe Lessa
  • Amy Palamountain
  • Dennis Daume
  • Rik Bosch
  • James Nugent
  • Phil Haack
  • Maratoss
  • David Lechner
  • Justin Manus
  • Keith Dahlby
  • Markus Olsson

In particular, a huge thanks goes to Johan, who has done an enormous amount of great work on this release. Thank you so much!

Migrating from existing code

We've written a migration guide to help existing application authors migrate their 5.x applications to ReactiveUI 6.0. Check out this document before updating your dependencies to get a heads-up as to what you're in for.

What's New in ReactiveUI 6.0

Over 120 new features were merged into ReactiveUI 6.0, trying to sum them all up is a huge undertaking! Here are some of the highlights:

Universal Windows Phone app and Xamarin Forms Support

ReactiveUI 6.0 has great support for all of the latest developer platforms, including WinRT Universal Apps as well as support for the new Xamarin Forms UI toolkit via the new ReactiveUI-XamForms NuGet package. Use either the updated Portable Library support, or use the new Shared Projects tooling in Visual Studio.

Existing support for Android and iOS has also been greatly improved, including support for unit test runners on those platforms, as well as creating Observable abstractions for all events via the ReactiveUI-Events package. Helpers for the Android Support Library are now also provided, via the ReactiveUI-AndroidSupport package.

ReactiveUI 6.0 supports the following platforms (In order of personal developer joy):

  • Xamarin.Android
  • Xamarin.iOS
  • Xamarin.Mac
  • Xamarin Forms (iOS + Android + WP8)
  • .NET 4.5 (WPF and Windows Forms, via ReactiveUI-WinForms)
  • Universal Windows Apps (WPA81)
  • Windows Phone 8.0 Apps (Silverlight-based)
  • Windows Store Apps (WinRT)

ReactiveUI makes creating list-based views a snap

We've added great support for recycling list-based views on iOS and Android (UICollectionView and UITableView on iOS, ListAdapter on Android). These new adapter classes allow you to map a ReactiveList of ViewModel objects and automatically create and recycle the associated views, for high-performance lists without writing a ton of boilerplate code.

On iOS, added and removed items will even be automatically animated in and out. On Android, we help you easily implement the ViewHolder pattern to limit the amount of work done while scrolling.

Large Application Performance

One of the focuses of this release has been performance and memory usage in large applications. ReactiveUI 6.0 is much less prone to creating memory leaks in application code via WeakEventManager, as well as more performant by eliminating scheduling latency as much as possible. Other features, such as View and ViewModel Activation, allow you to create and clean-up objects only when the View is actually visible on-screen, saving a lot of unnecessary work.

While some of these changes will require you to update your application and unit tests, the end result is an application that uses less memory and feels more responsive.

The same Rx, Everywhere

ReactiveUI 5.x used a separate installation of the Reactive Extensions for .NET for Xamarin projects, which made creating proper Portable Libraries more difficult. RxUI 6.0 now resolves this completely, and you can now build ViewModels that work on every supported platform.

Questions, Comments, Concerns?

There are three great venues for problems / questions related to this release:

ReactiveUI - ReactiveUI 6.0 Preview 7

Published by anaisbetts over 10 years ago

What's New

This is a prerelease version of ReactiveUI 6.0 - use at your own release, we make no guarantees that this works for you or even at all.

Check the Ship PR for more info

ReactiveUI - ReactiveUI 5.5.1

Published by anaisbetts over 10 years ago

What's New

  • Fix a glitch in XAML-based apps where WhenAny'ing DependencyProperties sometimes wouldn't work (Backport of #558)
  • Bump the version of Rx on MonoMac to the one currently shipping in Mono
ReactiveUI - ReactiveUI 6.0 Preview 6

Published by anaisbetts over 10 years ago

What's New

This is a prerelease version of ReactiveUI 6.0 - use at your own release, we make no guarantees that this works for you or even at all.

Check the Ship PR for more info

ReactiveUI - ReactiveUI 5.5

Published by anaisbetts over 10 years ago

What's New

Bug Fixes

  • Command bindings in WinForms now affect Enabled (#443, thanks @rzhw)
  • Ensure that common WinForms controls don't get trumped by WPF (#447, thanks @rzhw)
  • Enable BindCommand to work with nested ViewModels (#450, thanks @onovotny!)
  • Attempt to prevent the Mono linker from stripping things we need (#455, thanks @onovotny!)
  • Improvements to iOS binding (#473, #496, thanks @tberman)

Activation

Thanks to the great work by @jen20, the View / ViewModel activation from ReactiveUI 6.0 has been backported to 5.x. Normally large features aren't backported, but due to discovering that DependencyProperties leak memory in bindings without this feature, we decided to backport it.

What do you mean, leaks?

The following code, in a sane world, wouldn't leak:

public MyCoolUserControl()
{
    this.OneWayBind(ViewModel, x => x.FirstName, x => x.FirstName.Text);
}

Normally, when both the View and the ViewModel go out of scope, the GC would clean them both up and everything would be great. However, because of the Dependency Property system, this isn't true. Every time you WhenAny or Bind through a DependencyProperty, you must explicitly clean it up by Disposing. To help out with this, a new method has been created on Views and ViewModels.

Consider the following ViewModel constructor:

public MyBrokenViewModel()
{
    UserError.RegisterHandler(x => {
        // NB: Stuff
    });
}

This is broken because every time we create MyBrokenViewModel, we create another error handler. What Do? What we really want for certain global things like UserError, is for UserError to be subscribed only when the View associated with the ViewModel is visible. However, that information isn't available to ViewModels, and even if it was, it's not super obvious. Let's fix it

How does this work:

Activation allows you, for both Views and ViewModels, to set up the things that should be active when the View is visible. Here's how you do it for ViewModels:

public class MyWorkingViewModel : ReactiveObject, ISupportsActivation
{
    public ViewModelActivator Activator { get; protected set; }

    public ActivatingViewModel()
    {
        Activator = this.WhenActivated(d => {
            // d() registers a Disposable to be cleaned up when
            // the View is deactivated / removed
            d(UserError.RegisterHandler(x => {
                // NB: Stuff
            }));
        });
    }
}

Here's how it works for Views:

public class MyWorkingView : UserControl, IViewFor<MyWorkingViewModel>
{
    public ActivatingView()
    {
        this.WhenActivated(d => {
            Console.WriteLine("Helloooooo Nurse!")
            d(Disposable.Create(() => Console.WriteLine("Goodbye, Cruel World")));
        });
    }
}

Note that calling WhenActivated in a View automatically means that the associated ViewModel gets notified for activated / deactivated changes (and in fact, you must call WhenActivated in the View to get the ViewModel to be notified).

ReactiveUI - ReactiveUI 6.0 Preview 4

Published by anaisbetts over 10 years ago

What's New

This is a prerelease version of ReactiveUI 6.0 - use at your own release, we make no guarantees that this works for you or even at all.

Check the Ship PR for more info

ReactiveUI - ReactiveUI 6.0 Preview 1

Published by anaisbetts almost 11 years ago

What's New

This is a prerelease version of ReactiveUI 6.0 - use at your own release, we make no guarantees that this works for you or even at all.

Check the Ship PR for more info

ReactiveUI - ReactiveUI 5.4.0

Published by anaisbetts almost 11 years ago

What's New

Since some of these fixes change behavior (such as the NLog fix), this is a minor release - however, most of these changes shouldn't affect existing programs

Bug Fixes

  • Allow binding to 3rd party control libraries in WinForms (#405, thanks @rikbosch)
  • Fix F# friendly ObservableForProperty (#407, thanks @marklam)
  • Clean up NuSpec files for Xamarin on Visual Studio (#410, thanks @onovotny)
  • Fixes to deserializing ReactiveObjects using certain serializers (#412, thanks @meteficha)
  • Small improvements to derived collections (#417, thanks @meteficha)
  • Change NLog to use the full class name so it is easier to filter on (thanks @npnelson)
  • Race condition and reentrancy fixes to Reactive(Table/Collection)ViewSource (#425 + #426 + #433, thanks @meteficha)
  • Remove Pex from the list of test runners because it conflicts with WriteableBitmapEx (#428, thanks @tiagomargalho)
  • Fix up some of the collection interfaces (#430, thanks @Haacked)
  • Add Count* observables to list interfaces (#436, thanks @onovotny)
  • Disable setting up ViewHosts in design mode
ReactiveUI - ReactiveUI 5.3.0

Published by anaisbetts almost 11 years ago

What's New

Improved iOS Table View / Collection View support

Thanks to @meteficha and @alanpog, ReactiveUI's support for UITableView and UICollectionView is now vastly improved. We now support:

  • Custom Section Headers and Footers
  • Support for UICollectionView via new ReactiveCollectionViewSource class, similar to ReactiveTableViewSource
  • Support for adding / removing sections dynamically in a Reactive way, via the Data property on ReactiveTableViewSource
  • Added several new IViewFor-friendly Cocoa view subclasses, such as ReactiveCollectionViewCell
  • You can now easily detect when the table has finished updating to avoid making changes during a table reshuffle, via DidPerformUpdates

ViewModelViewHost and RoutedViewHost for WinForms

Thanks to @rikbosch, ReactiveUI.WinForms now has support for both RoutedViewHost and ViewModelViewHost, so you can create IViewFor-based Controls. (#396)

Bug Fixes

  • Make FuncDependencyResolver handle GetService correctly via returning the last item (#389), thanks @journeyman!
  • Fix a race condition in ObservableAsyncMRUCache, thanks @npnelson!
  • Create an overload of ObservableForProperty that's a bit more F# friendly, thanks @marklam!
  • Code cleanups to our project files (#387), thanks @pH-minamo!
ReactiveUI - ReactiveUI 5.2.0

Published by anaisbetts about 11 years ago

What's New

iOS Improvements

This release adds Reactive versions of a number of common UIKit classes, such as UIImageView. RxUI also now comes with a new class for UITableViewSource, ReactiveTableViewSource. This class will wrap a ReactiveList<ViewModel> class and automatically animate in and out cells from the table view as they change (PR #377)

Android improvements

This release adds basic binding support for common Android controls, thanks to #371. Thanks @oliverw!

Combined Commands

ReactiveCommand now supports combining commands, so it's easy to create a command that invokes one or more "child" commands, check out #382 for more information.

Modern Xamarin support

ReactiveUI is now built against the official Xamarin Rx binaries. This means that on MonoMac, you need to be up-to-date on the latest Mono install.

Bug Fixes

  • Fixes to ViewLocator to be more helpful if registration isn't set up (#359, thanks @terenced!)
  • Move RxUI.Mobile interfaces to the portable library so you can use them from PLibs (#364)
  • Perf improvement when looking up interfaces (#366, thanks @2asoft!)
  • Fixes to Auto Data Template (#367, thanks @chrisway!)
  • Fix to AutoPersist (#383, thanks @vevix!)
  • Updates to handle the latest Rx Microsoft release
  • Make sure ReactiveCommand's IsExecuting always comes back on the UI thread (#373)
ReactiveUI - ReactiveUI 5.1.0

Published by anaisbetts about 11 years ago

What's New

Windows Forms Support

Thanks to the great work of @rikbosch, ReactiveUI now has initial Windows Forms support. This includes an initial hack at binding to Windows Forms properties, as well as command binding. Grab it by installing the NuGet package:

Install-Package ReactiveUI-Winforms

New APIs

this.WhenAnyValue(x => x.Foo)  // Same as this.WhenAny(x => x.Foo, x => x.Value)

Weird Version Numbers?!

Some things went wrong with NuGet with this release, so the last version number may not match (it will either be "5.1.1" or "5.1.2"). Ignore the man behind this curtain.

Other Stuff

Greetz

Thanks to @niik, @jlaanstra, @dahlbyk, @chrisway, and @sillyotter for their help on this release!

ReactiveUI - ReactiveUI 5.0.1

Published by anaisbetts over 11 years ago

After 3 months, 427 commits by 12 different contributors, and 689 total files changed, the stable release of ReactiveUI 5.0 is now live! A huge thanks to the contributors for this release:

  • Markus Olsson
  • Johan Laanstra
  • Oliver Weichhold
  • Phil Haack
  • Christopher Atkins
  • Brad Phelan
  • Georg Rollinger
  • Kent Boogaart
  • Wenda Zhou

Check out the Ship PR

Here's the release highlights:

ReactiveUI is now totally Portable-Friendly

ReactiveUI now is compatible with .NET 4.5 Portable Libraries, you can now write cross-platform ViewModels but still use almost all of the RxUI features.

Unfortunately, to do this, we had to drop support for a number of older platforms. If you are using Silverlight, WP7, or .NET 4.0, you'll have to stick with ReactiveUI 4.x, which will still be maintained in a separate branch.

ReactiveUI 5.x has full support for the following platforms:

  • Xamarin.iOS
  • Xamarin.Android
  • Xamarin.Mac
  • .NET 4.5 (WPF)
  • Windows Phone 8
  • Windows Store Apps (WinRT)

ReactiveUI.Events

ReactiveUI now makes it easy to bind to UI events, without having to use Observable.FromEventPattern. Many UI controls and other objects now have an Events() extension method. For example:

theButton.Events().Clicked.Subscribe(x => /* ... */);

This makes it far cleaner to compose complex UI interactions at the view level.

A much improved API surface

This release is the "Clean up" breaking changes release - many deprecated methods have been removed - I'm proud to say that this release removes over 2x the number of lines that it adds, and only leaves what Should Be There.

Many names have been changed to be more clear, methods have been removed or clarified, and in general, ReactiveUI 5.0 is a more pleasant framework to use. However, this means that moving from RxUI 4.x to 5.x can be a bit of work. Check out the migration guide for more information.

Testable Initialization

ReactiveUI now has much more straightforward initialization - you can initialize ReactiveUI yourself in a test runner, ensure that tests won't register over other tests, and there is a new Service Locator implementation that is much more flexible with regard to object lifetimes than the old built-in service locator. RxApp itself now has much less in it, relying instead on the new RxApp.DependencyResolver property.

ReactiveUI - ReactiveUI 4.6.4

Published by anaisbetts over 11 years ago

What's New

Notable Changes Since 4.5.0

  • Improved support for ReactiveUI on iOS and Android, including Suspension Manager support
  • A UINavigationController for iOS that participates in ViewModel-based view location
  • OrderedComparer, a new way to write IComparable implementations using a LINQ'ish syntax
  • Make ReactiveDerivedCollection read-only and fix notification bugs
  • We now generate Symbol packages for ReactiveUI
  • Fixes for BindCommand on WinRT, where EventArgs don't actually have to be derived from System.EventArgs
  • ReactiveAsyncAction now signals completion
  • Fixes bug where WP8 projects would incorrectly be flagged as running in the test runner
ReactiveUI - ReactiveUI 4.5.0

Published by anaisbetts over 11 years ago

What's New

Xamarin.iOS and Xamarin.Mac support

This release brings initial support for the latest Xamarin.Mac and Xamarin.iOS. Using ReactiveUI and Xamarin Studio, you can write cross-platform ViewModels and Model classes and bind them to Views using the same RxUI 4.x binding syntax.

  • ReactiveUI knows how to bind to Cocoa objects using Key-Value Observing
  • DeferredScheduler automatically runs code on the Cocoa main runloop
  • Routing and ViewModelViewHost is supported via a class that attaches to NSView
  • Command binding understands Cocoa controls via Cocoa target/action framework, including automatically disabling the control when CanExecute is false
  • Many common controls have implicit binding support

Experimental Xamarin.Android support

This release also includes very basic Xamarin.Android support, including a scheduler that will run code on the Activity's main thread.

What do I need to run this??

You need to run Xamarin Studio and make sure to have the latest updates installed from the Alpha Channel.

What else is New?

  • Bug fixes in UserError Handling
  • Extra documentation (thanks @ArturPhilibin!)
  • Add Debugger support for ReactiveCollection (#204, thanks @distantcam!)