Skip to content

TemplatedTaskLoader Events

Choose a tag to compare

@roubachof roubachof released this 23 Oct 23:49
· 1 commit to master since this release

Version 2.6.2 (2025-10-24)

New Features

TemplatedTaskLoader Events

Added four new events to the TemplatedTaskLoader class that are raised when each corresponding control template is loaded:

  • ResultControlTemplateLoaded - Fired when the result control template is displayed
  • LoadingControlTemplateLoaded - Fired when the loading control template is displayed
  • ErrorControlTemplateLoaded - Fired when the error control template is displayed
  • EmptyControlTemplateLoaded - Fired when the empty control template is displayed

Usage Example

// In your code-behind
myTemplatedTaskLoader.LoadingControlTemplateLoaded += (sender, e) => 
{
    // React to loading state being displayed
    Debug.WriteLine("Loading template is now visible");
};

myTemplatedTaskLoader.ResultControlTemplateLoaded += (sender, e) => 
{
    // React to result state being displayed
    Debug.WriteLine("Result template is now visible");
};

myTemplatedTaskLoader.ErrorControlTemplateLoaded += (sender, e) => 
{
    // React to error state being displayed
    Debug.WriteLine("Error template is now visible");
};

myTemplatedTaskLoader.EmptyControlTemplateLoaded += (sender, e) => 
{
    // React to empty state being displayed
    Debug.WriteLine("Empty template is now visible");
};

Benefits

These events enable you to:

  • Track state transitions for analytics or logging
  • Trigger custom animations when states change
  • Implement custom behaviors based on the loading state
  • Simplify testing by monitoring state changes

Version 2.6.1 (Previous Release)

Bug Fixes

  • Fixed the insertion of the loading states view that could cause an index out of range exception.