xamarin/Xamarin.Forms

[Bug] [UWP] Adding a new item in Master-detail page causes the list to reload

Aperta

#8695 aperta il 27 nov 2019

 (3 commenti) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
a/listviewe/3 :clock3:help wantedinactivep/UWPt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Description

The problem was originally reported on StackOverflow by Lordalcol.

When the default template of Master-detail page is created and user navigates to add a new item and saves it, the list first appears invisible and fades with a delay instead of just one new item being animated in. In contrast, when the Cancel button is tapped, the list does appear immediately.

Steps to Reproduce

  1. Create default master-detail XF app with UWP
  2. Launch
  3. Navigate to Add new item page
  4. Save item
  5. Notice the list fades in as a whole, with a visible delay
  6. Go to Add new item page
  7. Cancel
  8. See the list animates in immediately

See video demonstration

Also note that when the ItemsViewModel message subscription is changed to:

MessagingCenter.Subscribe<NewItemPage, Item>(this, "AddItem", async (obj, item) =>
{
    await Task.Delay(100); //added delay
    var newItem = item as Item;
    Items.Add(newItem);
    await DataStore.AddItemAsync(newItem);
});

The application works properly - when item is saved, the list appears immediately and only the new item is animated in - see video.

Expected Behavior

Only new item should animate.

Actual Behavior

Whole list fades in with a delay.

Basic Information

  • Version with issue: 4.3.0.991211
  • Last known good version: none
  • IDE: VS 2019.3.10
  • Platform Target Frameworks
    • UWP: 16299 - newer (does not work with any version)

Video

Guida contributor