Skip to content

Releases: roubachof/Sharpnado.TaskLoaderView

Use TemplatedTaskLoader (implemented with ControlTemplate) with Snackbar

23 Jun 15:22
Compare
Choose a tag to compare

Builder for the CompositeTaskLoader

If you want to bind on the same snackbar loaders, and commands, there is now a nice builder.
With this change you can now use a TemplatedTaskLoader and a snackbar and making them play nicely together.

CompositeNotifier = CompositeTaskLoaderNotifier.ForCommands()
                .WithLoaders(Loader)
                .WithCommands(BuyGameCommand, PlayTheGameCommand)
                .Build();

And you bind the ShowLastError
on your snackbar:

<tlv:Snackbar Grid.Row="1"
                          Margin="15"
                          VerticalOptions="End"
                          BackgroundColor="White"
                          FontFamily="FontAtariSt"
                          IsVisible="{Binding CompositeNotifier.ShowLastError, Mode=TwoWay}"
                          Text="{Binding CompositeNotifier.LastError, Converter={StaticResource ExceptionToErrorMessageConverter}}"
                          TextColor="{StaticResource TextPrimaryColor}"
                          TextHorizontalOptions="Start" />
  • Fix for the timed visibility when the snackbar (or a ITimedVisibilityText implementation) text is changing.

Fix behavior of TaskLoaderNotifier when two tasks are loaded sequentially

23 Jun 08:44
Compare
Choose a tag to compare

Semantic change

As of 2.4.0, considering the following scenario:

  1. You start to load a task using the Load command
  2. Then a second load is asked by calling the Load command while the first load hasn't finished yet

Then the result of the first load will be discarded and the second load will take priority.

BREAKING CHANGES

The task source given to TaskLoaderNotifier is now a Func<bool, Task> (or a Func<bool, Task<T>>) instead of a Func<Task>.
You can simply change your calls from Loader.Load(() => InitializeAsync()) to Loader.Load(_ => InitializeAsync())
The boolean passed now to your task source is a boolean indicating if the notifier is refreshing.
You can use it for invalidating your cache for example.

Loader.Load(LoadItems);

public Task LoadItems(bool isRefreshing)
{
    if (isRefreshing || !_cache.ContainsItems())
    {
         _cache.InvalidateItems();
         var items = _httpService.GetItems()
         _cache.PutItems(items);
         return items;
    }

    return _cache.GetItems();
}

When the RefreshCommand will be called, it will pass automatically the isRefreshing boolean set to true to your task source.

Fixes

  • Fix Snackbar BackgroundColor and CompositeLoader behavior.

Snackbar with Composite Commands

09 Mar 15:19
Compare
Choose a tag to compare

SourceLink support

02 Aug 10:41
Compare
Choose a tag to compare
v2.1.1

enable source link

DataTemplate support

30 Jul 16:27
5046359
Compare
Choose a tag to compare

DataTemplate support

You can now add your customs views as View or DataTemplate.
If you choose the latest option, you can now specify your custom views in a ResourceDictionary and set them in your TaskLoaderView style.

Fixes

  • #1 Disable EmptyView in the TaskLoaderNotifier thanks to the disableEmptyView constructor parameter
  • #2 Provide set access to RefreshCommand

Expose TaskMonitor inner object

23 Jul 08:48
Compare
Choose a tag to compare
  • Expose the TaskMonitor object to be able to await it and chain tasks.
  • Fixes a bad implementation of TaskLoaderCommand
  • Fixes crash when setting implicit style