Splat.ReactiveUIExtensions 1.0.2

Install-Package Splat.ReactiveUIExtensions -Version 1.0.2
dotnet add package Splat.ReactiveUIExtensions --version 1.0.2
<PackageReference Include="Splat.ReactiveUIExtensions" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Splat.ReactiveUIExtensions --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Splat.ReactiveUIExtensions, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Splat.ReactiveUIExtensions as a Cake Addin
#addin nuget:?package=Splat.ReactiveUIExtensions&version=1.0.2

// Install Splat.ReactiveUIExtensions as a Cake Tool
#tool nuget:?package=Splat.ReactiveUIExtensions&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Splat.ReactiveUIExtensions

Add constructor injection to splat and add methods to register all views and viewmodels in an assembly You can install the nuget package "Splat.ReactiveUIExtensions" to get started

Register all your views and viewmodels on startup:

Instead of Locator.CurrentMutable.Register(() ⇒ new UpcomingMoviesListView(), typeof(IViewFor<UpcomingMoviesListViewModel>)); Locator.CurrentMutable.Register(() ⇒ new UpcomingMoviesCellView(), typeof(IViewFor<UpcomingMoviesCellViewModel>)); Locator.CurrentMutable.Register(() ⇒ new MovieDetailView(), typeof(IViewFor<MovieDetailViewModel>));

You can now do Locator.CurrentMutable.RegisterViewsAndViewModels<ViewModelBase>(typeof(AppBootstrapper).Assembly);

The first parameter is the assembly where your views and viewmodels reside, the generic parameter is the base class for your viewmodels. The given assembly will be scanned for viewmodels by looking if there are types defined that are are derived from the generic parameter TBaseViewModelType. The views are registered by checking if there are types implementing IViewFor by default. There is also an overload for RegisterViewsAndViewModels where you can pass in the base class for views.

There are also methods to register views (RegisterViews, duh) and register viewmodels (hmm, RegisterViewModels) if you wish to have some more control from your code in how things are scanned and registered.

Constructor injection

If you use the extension methods in this library to register your classes in splat, it will use dependency injection by default for the class constructors. These methods are:

  • RegisterLazySingleton
  • RegisterType

The singletons are always lazy when registering them with dependency injection enabled, since it needs all dependencies to be registered to be able to construct an instance of it.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 3,498 4/12/2019
1.0.1 439 2/11/2019
1.0.0 406 2/11/2019