uno.extensions icon indicating copy to clipboard operation
uno.extensions copied to clipboard

[MVUX] FeedView ErrorTempalte not displaying when exception

Open ajpinedam opened this issue 2 years ago • 0 comments

Current behavior

Expected behavior

How to reproduce it (as minimally and precisely as possible)

MainPage.xaml

      <mvux:FeedView x:Name="FeedViewWeather" Source="{Binding CurrentWeather}">
        <mvux:FeedView.ValueTemplate>
          <DataTemplate>
            <StackPanel>
              <TextBlock DataContext="{Binding Data}" FontSize="255" Text="{Binding Temperature}" />
            </StackPanel>
          </DataTemplate>
        </mvux:FeedView.ValueTemplate>
        <mvux:FeedView.ErrorTemplate>
          <DataTemplate>
            <TextBlock Foreground="Red"
                       FontSize="22"
                       Text="Ah error has ocurred" />
          </DataTemplate>
        </mvux:FeedView.ErrorTemplate>
      </mvux:FeedView>

MainModel.cs

    public IFeed<WeatherInfo> CurrentWeather =>
        Feed.Async(WeatherService.GetCurrentWeather);

WeatherService.cs

    public async ValueTask<WeatherInfo> GetCurrentWeather(CancellationToken ct)
    {
        await Task.Delay(2000);

        throw new Exception("API is not available");

        return new WeatherInfo(new Random().Next(-40, 40));
    }

I found this error while preparing for a presentation.

Environment

Nuget Package: Uno.WinUI

Package Version(s): 5.0.48

Affected platform(s):

  • [ ] iOS
  • [x] Android
  • [x] WebAssembly
  • [ ] WebAssembly renders for Xamarin.Forms
  • [x] Windows
  • [ ] Build tasks

Visual Studio:

  • [ ] 2017 (version: )
  • [ ] 2019 (version: )
  • [x] 2012 (version: ) 17.8.0
  • [ ] for Mac (version: )

Relevant plugins:

  • [ ] Resharper (version: )

Anything else we need to know?

ajpinedam avatar Dec 02 '23 18:12 ajpinedam