iNKORE-NET / UI.WPF.Modern

Modern (Fluent 2) styles and controls for your WPF applications
https://docs.inkore.net/ui-wpf-modern
GNU Lesser General Public License v2.1
368 stars 33 forks source link

Layout measurement override of element ItemsRepeater should not return NaN values as its DesiredSize #72

Open Valkirie opened 1 month ago

Valkirie commented 1 month ago

Similar to https://github.com/Kinnara/ModernWpf/issues/350, I get the above exception when I insert an item at index 0 to the collection that the ItemsRepeater is binded to.

Layout measurement override of element 'iNKORE.UI.WPF.Modern.Controls.ItemsRepeater' should not return NaN values as its DesiredSize.   at System.Windows.UIElement.Measure(Size availableSize)
   at iNKORE.UI.WPF.Controls.SimpleStackPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
NotYoojun commented 3 weeks ago

Anyone has any ideas how to fix this?

Valkirie commented 3 weeks ago

I'm afraid no.