This repository contains ReactiveUI samples.
Перейти к файлу
David 5b4eba40cb
Merge pull request #1 from unoplatform/dev/dr/UnoSample
Add Uno samples
2019-09-16 18:09:18 -04:00
OldSamples feature: add the old reactive twitter sample 2019-05-16 14:20:37 +10:00
Xamarin.Native/ReactiveRecyclerView Add the package references 2019-08-09 00:11:20 +10:00
avalonia Solution-wide nuget.config, typo fix 2019-08-12 11:32:03 +03:00
razor Bump Microsoft.AspNetCore.Mvc.NewtonsoftJson (#42) 2019-07-03 17:32:17 +10:00
testing feature: Add Avalonia sample, improve README.md (#31) 2019-07-02 00:48:00 +03:00
uno Add the Uno sample to the main solution file 2019-09-16 18:06:34 -04:00
uwp Restore UWP only sample 2019-09-16 17:55:54 -04:00
winforms feature: Add Avalonia sample, improve README.md (#31) 2019-07-02 00:48:00 +03:00
wpf Removed setting log level in WpfSample (Fixes #50) (#51) 2019-07-10 03:16:05 +10:00
xamarin-forms Bump Moq from 4.12.0 to 4.13.0 (#78) 2019-09-02 10:34:39 +10:00
.editorconfig feature: add the old reactive twitter sample 2019-05-16 14:20:37 +10:00
.gitattributes housekeeping: add LFS support: 2019-05-16 14:10:12 +10:00
.gitignore housekeeping: add LFS support: 2019-05-16 14:10:12 +10:00
README.md Update README.md 2019-08-08 22:41:46 +10:00
ReactiveUI.Samples.sln Add the Uno sample to the main solution file 2019-09-16 18:06:34 -04:00
stylecop.json housekeeping: add LFS support: 2019-05-16 14:10:12 +10:00

README.md

ReactiveUI.Samples

This repository will contain all of ReactiveUI samples.

Xamarin Forms

Cinephile

Example in Xamarin Forms (Android and iOS) shows you the upcoming movies from the movie api

Provides examples about:

  1. App's bootstrapping
  2. ViewModel first routing
  3. ListView integration
  4. ReactiveCommands
  5. ObservableAsPropertyHelper

Xamarin Native

Examples provided:

  1. Reactive Recycler View

Avalonia

ReactiveUI.Samples.Suspension

To read navigation stack from disk, a suspension driver is required to support deserializing IRoutableViewModel interface implementations into more specific view model types, for Newtonsoft.Json this can be achieved by using TypeNameHandling.All json serialization setting. In the App.OnFrameworkInitializationCompleted method we initialize suspension stuff specific to our app. Don't forget to add .UseReactiveUI() and .StartWithClassicDesktopLifetime() to your app builder inside the Program.cs file.

Provides examples about:

  1. Suspension and Data Persistence
  2. ViewModel first routing
  3. ReactiveCommands

Note: Avalonia produce and support the ReactiveUI plugin. You can get support on their Gitter

Testing

ReactiveUI.Samples.Testing.SimpleViewModels

Illustrates how to write testable and maintainable view models using ReactiveUI.Testing, XUnit and Microsoft.Reactive.Testing libraries. See related documentation. Contains immediate scheduling examples to make the tests run even faster by mocking long-running operations.

new TestScheduler().With(scheduler =>
{
    var fixture = new WebCallViewModel(new ImmediateWebService());
    fixture.InputText = "hi";

    // Run the clock forward to 800 ms. 
    // At that point, nothing should have happened.
    scheduler.AdvanceToMs(799);
    Assert.Equal(string.Empty, fixture.ResultText);

    // Run the clock 1 tick past and the result should show up.
    scheduler.AdvanceToMs(801);
    Assert.Equal("result hi", fixture.ResultText);
});

Universal Windows Platform

ReactiveUI.UwpRouting

Provides examples about ReactiveUI routing for Universal Windows Platform.

Razor

ReactiveUI.RazorExample

Building a web app with ReactiveUI and Razor Components.

Follow the Razor Components tutorial on MSDN to get started. Heavily based on @akourbat's work.