You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by kucint July 1, 2024 ItemTemplateSelector works fine with ListView, but it crashes with ItemsRepeater:
publicsealedpartialclassMainPage:Page{publicMainPage()=>this.DataContext(newBindableMainPageModel(),(page,vm)=>page.Background(ThemeResource.Get<Brush>("ApplicationPageBackgroundThemeBrush")).Content(newStackPanel().VerticalAlignment(VerticalAlignment.Center).HorizontalAlignment(HorizontalAlignment.Center).Children(newTextBlock().Text("Hello Uno Platform!"),//new ListView() // ItemTemplateSelector works fine with ListViewnewItemsRepeater()// but it crashes with ItemsRepeater.ItemsSource(()=>vm.Items).ItemTemplateSelector<Item>((item,selector)=>selector.Default(()=>newTextBlock().Text("def")).Case<ItemA>(itemA =>newTextBlock().Text("a")).Case<ItemB>(itemB =>newTextBlock().Text("b")))));}
on net8.0-desktop; An exception of type 'System.ArgumentException' occurred in Uno.UI.dll but was not handled in user code
on net8.0-windows10.0.19041: An exception of type 'System.InvalidCastException' occurred in WinRT.Runtime.dll but was not handled in user code
@kucint this fix has been merged and should be available in the latest preview version. Please let me know if you have any further issues with this.
Also note that this will be backported to the 5.3 branch and will be in the upcoming 5.3 release.
Hi @dansiegel
This fix must be something big, it seems that it fixed as well other issues related to ItemsRepeater I observed from time to time in my app but I could not find any stable repro pattern for them, so I did not report them. Now they all seem to be gone.
BTW, it has been already backported to 5.2, right?
Thanks for this fix, now I have impression that the implementation of ItemsRepeater is becoming stable!
Well done!
Discussed in #2404
Originally posted by kucint July 1, 2024
ItemTemplateSelector
works fine withListView
, but it crashes withItemsRepeater
:on
net8.0-desktop
;An exception of type 'System.ArgumentException' occurred in Uno.UI.dll but was not handled in user code
on
net8.0-windows10.0.19041
:An exception of type 'System.InvalidCastException' occurred in WinRT.Runtime.dll but was not handled in user code
"Uno.Sdk": "5.2.175"
repro: UnoTemplateSelectorApp.zip
The text was updated successfully, but these errors were encountered: