Com.MarcusTS.ResponsiveTasks 1.0.21

Install-Package Com.MarcusTS.ResponsiveTasks -Version 1.0.21
dotnet add package Com.MarcusTS.ResponsiveTasks --version 1.0.21
<PackageReference Include="Com.MarcusTS.ResponsiveTasks" Version="1.0.21" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Com.MarcusTS.ResponsiveTasks --version 1.0.21
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Com.MarcusTS.ResponsiveTasks, 1.0.21"
#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 Com.MarcusTS.ResponsiveTasks as a Cake Addin
#addin nuget:?package=Com.MarcusTS.ResponsiveTasks&version=1.0.21

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

Fixing TPL Using Responsive Tasks:

TPL: The Promise

When Microsoft announced the Task Parallel Library, C# programmers everywhere rejoiced. Simplified threads? Error handling within the library itself? What could possibly go wrong?

Just about everything, as it turns out.

A task requires a root in order to be properly awaited. For instance:

// An awaitable task
public Task YouCanAwaitMe() { }

// A root where you an await a task
public async Task IWillAwait()
   await YouCanAwaitMe().WithoutChangingContext();

TPL: The Reality

Unfortunately, a Xamarin app doesn't have any valid roots. For instance, not at:

  • Constructors
  • Content changed
  • Binding context changed
  • Event handlers
  • Global messages
  • Overrides
  • Property Setters

Any location that fails to provide a Task signature is a false root. This causes unsafe results:

public class FalselyRootedView : ContentView
   protected override async void OnBindingContextChanged()
      // Mega hack -- called from a void method (illegal!)
      await StartUpViewModel().WithoutChangingContext();
   public virtual Task StartUpViewModel()
      return Task.CompletedTask;

// Derive and consume the falsely rooted view as if it were valid
public class FalseConsumer : FalselyRootedView
   pubic override async Task StartUpViewModel()
      // Everything seems OK from this perspective, but this task can proceed at any time and 
      //    without our control; it was never properly awaited.  Anything relying on it will 
      //    accelerate into a race condition; variables will not be set on time; nothing can 
      //    be relied upon in a predictable order.
      await SomeOtherTask().WithoutChangingContext();

Until Microsoft converts all current code signatures to Tasks, programmers are stuck using these sorts of risky mechanisms.

Responsive Tasks is tested and proven

See the unit tests.


Each page describes a problem and its Responsive solution:

Part 1 of N: Pages, Views & View Models

Part 2 of N: Events & Messaging

Part 3 of N: Technical Guide

Part 4 of N: Button Pressed: Closing the Final TPL Gaps

Part 5 of N: Proofs

Responsive Tasks Is Open Source; Enjoy Our Other Offerings

If you find value in this software, consider these other related projects:

Shared Utils



The Smart DI Container



Shared Forms



Responsive Tasks



Responsive Tasks - Xamarin.Forms Support



The Modern App Demo



NuGet packages (2)

Showing the top 2 NuGet packages that depend on Com.MarcusTS.ResponsiveTasks:

Package Downloads

Xamarin.Forms abstract classes and utilities to support creating flowable animated apps using the ResponsiveTasks library.


Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.21 37 8/27/2021
1.0.20 49 8/24/2021
1.0.19 52 8/24/2021
1.0.18 50 8/17/2021
1.0.17 68 8/17/2021
1.0.16 137 8/15/2021
1.0.15 62 8/10/2021
1.0.14 42 8/10/2021
1.0.13 40 8/10/2021
1.0.12 83 7/6/2021
1.0.11 91 7/1/2021
1.0.10 206 6/24/2021
1.0.9 155 6/2/2021
1.0.8 114 5/18/2021
1.0.7 53 5/14/2021
1.0.6 96 5/12/2021
1.0.5 71 5/12/2021
1.0.4 60 4/9/2021
1.0.3 53 4/9/2021
1.0.2 102 4/1/2021
1.0.1 56 4/1/2021
1.0.0 79 2/3/2021