XamarinCommunityToolkit icon indicating copy to clipboard operation
XamarinCommunityToolkit copied to clipboard

[Bug] UWP - StateLayout - CollectionView - Crashes upon re-entering state

Open JsCalahan opened this issue 3 years ago • 2 comments

Description

This may be more of a Xamarin.Forms issue rather than XamarinCommunityToolkit.

The app crashes with a NotImplementedException when using a CollectionView inside of a StateView after previously loading the CollectionView. Message is "The layout is not implemented".

Stack Trace

at Xamarin.Forms.Platform.UWP.StructuredItemsViewRenderer1.SelectListViewBase() at Xamarin.Forms.Platform.UWP.ItemsViewRenderer1.SetUpNewElement(ItemsView newElement) at Xamarin.Forms.Platform.UWP.SelectableItemsViewRenderer1.SetUpNewElement(ItemsView newElement) at Xamarin.Forms.Platform.UWP.VisualElementRenderer2.SetElement(VisualElement element) at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element) at Xamarin.Forms.Platform.UWP.VisualElementPackager.SetupVisualElement(VisualElement view) at Xamarin.Forms.Platform.UWP.VisualElementPackager.Load() at Xamarin.Forms.Platform.UWP.VisualElementRenderer2.SetElement(VisualElement element) at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element) at Xamarin.Forms.Platform.UWP.VisualElementPackager.SetupVisualElement(VisualElement view) at Xamarin.Forms.Platform.UWP.VisualElementPackager.Load() at Xamarin.Forms.Platform.UWP.VisualElementRenderer2.SetElement(VisualElement element) at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element) at Xamarin.Forms.Platform.UWP.VisualElementPackager.SetupVisualElement(VisualElement view) at Xamarin.Forms.Platform.UWP.VisualElementPackager.OnChildAdded(Object sender, ElementEventArgs e) at Xamarin.Forms.Element.OnChildAdded(Element child) at Xamarin.Forms.VisualElement.OnChildAdded(Element child) at Xamarin.Forms.Layout1.OnChildAdded(Element child) at Xamarin.Forms.Layout.OnInternalAdded(View view) at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Xamarin.CommunityToolkit.UI.Views.StateLayoutController.<SwitchToTemplate>d__12.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()

Steps to Reproduce

  1. Place a CollectionView inside a StateLayout's StateView
  2. Enter the state with the CollectionView
  3. Exit the state with the CollectionView
  4. Re-enter the state with the CollectionView

Expected Behavior

CollectionView is rendered and binding happens normally.

Actual Behavior

App crashes.

Basic Information

  • IDE: Visual Studio 2022
  • Platform Target Frameworks:
    • UWP: 19041

JsCalahan avatar Apr 25 '22 14:04 JsCalahan

Hello,

we were just investigating a similar issue at our end and stumbled upon your report. In our case we assume a regression bug was introduced in a recent pull request. Can you downgrade Xamarin.Forms to Service Release 8 (5.0.0.2291) and test if the problem is gone?

DDHSchmidt avatar May 04 '22 13:05 DDHSchmidt

We decided to raise an issue with Xamarin.Forms for this.

DDHSchmidt avatar May 06 '22 15:05 DDHSchmidt