CrossPlatformLiveData 1.0.2

.NET Standard 2.0
dotnet add package CrossPlatformLiveData --version 1.0.2
NuGet\Install-Package CrossPlatformLiveData -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CrossPlatformLiveData" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CrossPlatformLiveData --version 1.0.2
#r "nuget: CrossPlatformLiveData, 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 CrossPlatformLiveData as a Cake Addin
#addin nuget:?package=CrossPlatformLiveData&version=1.0.2

// Install CrossPlatformLiveData as a Cake Tool
#tool nuget:?package=CrossPlatformLiveData&version=1.0.2


Android LiveData inspired .NET implementation - lifecycle aware rx streams

Build Status Nuget

CrossPlatformLiveData is a C# library inspired by Android Jetpack LiveData, intended for platform independent use with Xamarin and other cross platform frameworks.

CrossPlatformLiveData is a light weight solution to effective implementation of MVVM architecture pattern.


  • Rx stream with UI lifecycle awareness,
  • Last value cache - state preservation,
  • Everything that you need to implement MVVM pattern

CrossPlatformLiveData - MVVM pattern


CrossPlatformLiveData.Android provides base UI classes with LifecycleManger linked to lifecycle events:
LiveDataActivity, LiveDataAppCompatActivity, LiveDataAppCompatDialogFragment, LiveDataFragment, LiveDataFragmentActivity, LiveDataSupportDialogFragment, LiveDataSupportFragment

CrossPlatformLiveData.iOS provides base UI classes with LifecycleManger linked to lifecycle events:

For other platforms all you need to do is provide LifecycleManger with lifecyle events when they occur, implementation should be self explanatory.



Add LiveData fields in ViewModel/Presenter class:

public ILiveData<string> SampleLiveData { get; } = new LiveData<string>();

Post new value to LiveData:

SampleLiveData.PostValue("Hello World!");


Observe LiveData streams with LifecycleManager

viewModel.SampleLiveData.Observe(LifecycleManager, OnNextSample, e => {//handle error here}));
private void OnNextSample(string newText)
	someTextView.Text = newText;

RxWrapper (Optional)

Optionally you can use RxWrapper template class that reduces boilerplate code by bundling value, request status, and exception in single model:

public ILiveData<RxWrapper<SampleResponse>> NetworkingLiveData { get; } = new LiveData<RxWrapper<SampleResponse>>();
//Notify UI that request is pending
//Data fetch has succeded
//Error has occured during network call
NetworkingLiveData.PostValue(RxWrapper<SampleResponse>.Error(new Exception("No network")));
private void OnNextNetworkingData(RxWrapper<SampleResponse> response)
	switch (response.Status)
		case RxStatus.Ok:
			//Update UI on succes
		case RxStatus.Pending:
			//Show loading spinner
		case RxStatus.Error:
			//Display error alert

TMS logo

2019 © TMS

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on CrossPlatformLiveData:

Package Downloads

Base Android classes for CrossPlatformLiveData


Base iOS classes for CrossPlatformLiveData

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 1,010 10/18/2019
1.0.1 669 9/11/2019