xamarin/Xamarin.Forms

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

开放

#8,695 创建于 2019年11月27日

 (3 条评论) (0 个反应) (0 位负责人)C# (1,926 个派生)batch import
a/listviewe/3 :clock3:help wantedinactivep/UWPt/bug :bug:up-for-grabs

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南