Xamarin.forms: iOS: ContextAction collection changes cause slow-down and eventual freeze

Created on 12 Mar 2018  ·  3Comments  ·  Source: xamarin/Xamarin.Forms

Description

Each Change to the ContextActions in a ListView or TableView cause an exponentially increasing UI freeze on iOS.

Steps to Reproduce

  1. Create a ViewCell with context actions
  2. Repeatedly change the context actions in some way (usually based on ViewCell/ViewModel state)

Expected Behavior

Context Menu (swipe left on iOS, hold on Android, right-click on UWP, etc) should reflect this change immediately with no UI slow down.

Actual Behavior

On iOS, on every change, the UI gets slower and slower to respond till it eventually freezes indefinitely.

Basic Information

  • Version with issue: 2.5.0.280555
  • IDE: Visual Studio 2017
  • Platform Target Frameworks:

    • iOS: 11.8.0.20

  • Devices: Tested on iPhone 6 Plus

Video

https://github.com/sonic1015/bugRepo/files/1835039/2018-03-12.T16-17-07.zip

Reproduction Link

https://github.com/sonic1015/bugRepo/archive/1.zip

listview performance 4 help wanted high iOS 🍎 bug up-for-grabs

All 3 comments

Hi,

i am also running against this exact same issue, i was wondering when you will actually pick this up

This issue doesn't seem to have had any activity in a long time. We're working on prioritizing issues and resolving them as quickly as we can. To help us get through the list, we would appreciate an update from you to let us know if this is still affecting you on the latest version of Xamarin.Forms, since it's possible that we may have resolved this as part of another related or duplicate issue. If we don't see any new activity on this issue in the next 30 days, we'll evaluate whether this issue should be closed. Thank you!

Updated the reproduction to Xamarin.Forms v4.6.0.867

After the first menu item change, there is no animation on menu close. After about 7 menu item changes, it crashes with the following exception:

System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.ContextActionsCell.OnCellPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00012] in D:\a\1\s\Xamarin.Forms.Platform.iOS\ContextActionCell.cs:475 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:353 
  at Xamarin.Forms.Cell.OnContextActionsChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002d] in D:\a\1\s\Xamarin.Forms.Core\Cells\Cell.cs:227 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].RemoveItem (System.Int32 index) [0x00021] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.Collection`1[T].Remove (T item) [0x00027] in <624bcc4ce53347508a7b8fa821d78da4>:0 
  at bugRepo.CustomViewCell+<>c__DisplayClass0_0.<.ctor>b__1 (System.Object sender, System.EventArgs args) [0x00002] in C:\Users\eballantyne\Downloads\bugRepo-1\bugRepo-1\bugRepo\bugRepo\CustomViewCell.xaml.cs:40 

Tested on on iPhone 8, iOS 13.4.1. Haven't tested on Android or UWP.

Was this page helpful?
0 / 5 - 0 ratings