XamarinCommunityToolkit
XamarinCommunityToolkit copied to clipboard
[Bug] UWP - StateLayout - CollectionView - Crashes upon re-entering state
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
- Place a CollectionView inside a StateLayout's StateView
- Enter the state with the CollectionView
- Exit the state with the CollectionView
- 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
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?
We decided to raise an issue with Xamarin.Forms for this.