From 59ca47e13b943e0977ec4e7b7edddd78cdafd7cb Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Tue, 4 Mar 2025 14:29:23 +0100 Subject: [PATCH] chore: Adjust usages --- .../UI/Xaml/Controls/ListViewBase/ListViewBaseSource.iOS.cs | 6 ++++-- .../UI/Xaml/Controls/ListViewBase/NativeListViewBase.iOS.cs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBaseSource.iOS.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBaseSource.iOS.cs index d92d85df1ea4..9d5da7142d7f 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBaseSource.iOS.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBaseSource.iOS.cs @@ -75,11 +75,13 @@ public static class TraceProvider /// The furthest item in the source which has already been materialized. Items up to this point can safely be retrieved. /// private NSIndexPath _lastMaterializedItem = NSIndexPath.FromRowSection(0, 0); - + +#if !MACCATALYST // Fix on .NET 6 Preview 6 https://github.com/unoplatform/uno/issues/5873 /// /// Is the UICollectionView currently undergoing animated scrolling, either user-initiated or programmatic. /// private bool _isInAnimatedScroll; +#endif #endregion public ListViewBaseSource() @@ -456,9 +458,9 @@ private UICollectionReusableView GetBindableSupplementaryView( return supplementaryView; } +#if !MACCATALYST // Fix on .NET 6 Preview 6 https://github.com/unoplatform/uno/issues/5873 internal void SetIsAnimatedScrolling() => _isInAnimatedScroll = true; -#if !MACCATALYST // Fix on .NET 6 Preview 6 https://github.com/unoplatform/uno/issues/5873 public override void Scrolled(UIScrollView scrollView) { InvokeOnScroll(); diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.iOS.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.iOS.cs index 5f548fc0fdba..5d8ac038dd2a 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.iOS.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.iOS.cs @@ -627,10 +627,12 @@ private UICollectionViewScrollPosition ConvertScrollAlignmentForGroups(ScrollInt public override void SetContentOffset(CGPoint contentOffset, bool animated) { base.SetContentOffset(contentOffset, animated); +#if !MACCATALYST // Fix on .NET 6 Preview 6 https://github.com/unoplatform/uno/issues/5873 if (animated) { Source?.SetIsAnimatedScrolling(); } +#endif } ///