Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4a51d5b
[iOS] Fix for CursorPosition Property Not Applied Correctly to Entry …
praveenkumarkarunanithi Mar 18, 2025
8ce068e
[Windows] Fixed Shadow not updated when Clipping a View with a shadow…
NirmalKumarYuvaraj Mar 18, 2025
0ee8390
[Testing] Enabling more UI Tests by removing platform specific condit…
LogishaSelvarajSF4525 Mar 18, 2025
cfeb1bf
[Testing] Enabling more UI Tests by removing platform specific condit…
HarishKumarSF4517 Mar 18, 2025
d0c0c98
Fixed Label Visibility Issue on macOS and iOS (#28081)
Dhivya-SF4094 Mar 18, 2025
1fc5d5e
[Testing] Migration of Compatibility.Core platform-specific unit test…
TamilarasanSF4853 Mar 18, 2025
c812c00
Fixed - Using CollectionView.EmptyView results in an Exception on Win…
KarthikRajaKalaimani Mar 18, 2025
6e52b4c
Fixed Stepper allows incrementing beyond the maximum value (#28398)
SubhikshaSf4851 Mar 18, 2025
68ae233
[Testing] Migration of Compatibility.Core platform-specific unit test…
nivetha-nagalingam Mar 18, 2025
ff74ad1
Fixed crash in CollectionView on iOS when updating grouped data. (#28…
Dhivya-SF4094 Mar 18, 2025
bdbbbd4
Make IShape in MauiCALayer a WeakReference (#28412)
MarcelStommel Mar 18, 2025
365e4bf
[iOS] [Android] Fix for the FontImageSource color is not applied prop…
Tamilarasan-Paranthaman Mar 19, 2025
7232f55
[Android] Fix ImageButton Padding the third (#25223)
aheubusch Mar 20, 2025
a166685
Fix for CarouselView doesnot scroll corresponding to ItemsUpdatingScr…
SuthiYuvaraj Mar 20, 2025
5a428c4
[Windows] Fixed the text and icon color issues in the DatePicker when…
Ahamed-Ali Mar 21, 2025
43f767a
System.MissingMethodException in PropertyPropagationExtensions fix (#…
kubaflo Mar 23, 2025
ae5af8d
[iOS] Back-navigation with swipe-back navigates back twice - fix (#28…
kubaflo Mar 24, 2025
2fef448
Fixed Test case failure in PR 28560 (#28584)
Dhivya-SF4094 Mar 25, 2025
a89df8c
[Testing] Implemented InteractivePopGesture (#28577)
kubaflo Mar 25, 2025
06e8924
[Testing] Fixed test case failure 28485 (#28644)
kubaflo Mar 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ public override void PushViewController(UIViewController viewController, bool an

public override UIViewController PopViewController(bool animated)
{
_popRequested = true;
_pendingViewControllers = null;
if (IsInMoreTab && ParentViewController is UITabBarController tabBarController)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ void UpdateIconAndStyle(ToolbarItem item)
{
Image = result?.Value;
Style = UIBarButtonItemStyle.Plain;
if (item.IconImageSource is FontImageSource fontImageSource && fontImageSource.Color is not null)
{
TintColor = fontImageSource.Color.ToPlatform();
}
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,24 @@ void CollectionItemsSourceChanged(object sender, System.Collections.Specialized.
return;
}

// While Modifying the collection we should consider the ItemsUpdatingScrollMode to update the position
if (Carousel.ItemsUpdatingScrollMode == ItemsUpdatingScrollMode.KeepLastItemInView)
{
if (count == 0)
{
carouselPosition = 0;
}
else
{
carouselPosition = count - 1;
}

}
else if (Carousel.ItemsUpdatingScrollMode == ItemsUpdatingScrollMode.KeepItemsInView)
{
carouselPosition = 0;
}

Carousel.
Handler.
MauiContext.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected override void DisconnectHandler(ListViewBase platformView)
{
VirtualView.ScrollToRequested -= ScrollToRequested;
CleanUpCollectionViewSource(platformView);
_formsEmptyView?.Handler?.DisconnectHandler();
base.DisconnectHandler(platformView);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,17 @@ void CollectionViewUpdating(object sender, NotifyCollectionChangedEventArgs e)
[UnconditionalSuppressMessage("Memory", "MEM0003", Justification = "Proven safe in test: MemoryTests.HandlerDoesNotLeak")]
void CollectionViewUpdated(object sender, NotifyCollectionChangedEventArgs e)
{
int targetPosition;
if (_positionAfterUpdate == -1)
{
return;
}

_gotoPosition = -1;

var targetPosition = _positionAfterUpdate;
// We need to update the position while modifying the collection.
targetPosition = GetTargetPosition();

_positionAfterUpdate = -1;

SetPosition(targetPosition);
Expand All @@ -354,6 +357,22 @@ int GetPositionWhenAddingItems(int carouselPosition, int currentItemPosition)
return currentItemPosition != -1 ? currentItemPosition : carouselPosition;
}

private int GetTargetPosition()
{

if (ItemsSource.ItemCount == 0)
{
return 0;
}

return ItemsView.ItemsUpdatingScrollMode switch
{
ItemsUpdatingScrollMode.KeepItemsInView => 0,
ItemsUpdatingScrollMode.KeepLastItemInView => ItemsSource.ItemCount - 1,
_ => _positionAfterUpdate
};
}

int GetPositionWhenResetItems()
{
//If we are reseting the collection Position should go to 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,7 @@ void CollectionChanged(NotifyCollectionChangedEventArgs args)

// Force UICollectionView to get the internal accounting straight
var collectionView = controller.CollectionView;
if (!collectionView.Hidden)
{
var numberOfSections = collectionView.NumberOfSections();
for (int section = 0; section < numberOfSections; section++)
{
collectionView.NumberOfItemsInSection(section);
}
}
UpdateSection(collectionView);

switch (args.Action)
{
Expand All @@ -193,8 +186,23 @@ void CollectionChanged(NotifyCollectionChangedEventArgs args)
default:
throw new ArgumentOutOfRangeException();
}

// Calculate section and item counts after processing changes
// to ensure UICollectionView reflects the updated state
UpdateSection(collectionView);
}

void UpdateSection(UICollectionView collectionView)
{
if (!collectionView.Hidden)
{
var numberOfSections = collectionView.NumberOfSections();
for (int section = 0; section < numberOfSections; section++)
{
collectionView.NumberOfItemsInSection(section);
}
}
}
void Reload(bool collectionWasReset = false)
{
ResetGroupTracking();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,17 @@ void CollectionViewUpdating(object sender, NotifyCollectionChangedEventArgs e)
[UnconditionalSuppressMessage("Memory", "MEM0003", Justification = "Proven safe in test: MemoryTests.HandlerDoesNotLeak")]
void CollectionViewUpdated(object sender, NotifyCollectionChangedEventArgs e)
{
int targetPosition;
if (_positionAfterUpdate == -1)
{
return;
}

//_gotoPosition = -1;

var targetPosition = _positionAfterUpdate;
// We need to update the position while modifying the collection.
targetPosition = GetTargetPosition();

_positionAfterUpdate = -1;

SetPosition(targetPosition);
Expand Down Expand Up @@ -291,6 +294,21 @@ int GetPositionWhenAddingItems(int carouselPosition, int currentItemPosition)
return currentItemPosition != -1 ? currentItemPosition : carouselPosition;
}

private int GetTargetPosition()
{
if (ItemsSource.ItemCount == 0)
{
return 0;
}

return ItemsView.ItemsUpdatingScrollMode switch
{
ItemsUpdatingScrollMode.KeepItemsInView => 0,
ItemsUpdatingScrollMode.KeepLastItemInView => ItemsSource.ItemCount - 1,
_ => _positionAfterUpdate
};
}

int GetPositionWhenResetItems()
{
//If we are reseting the collection Position should go to 0
Expand Down
10 changes: 10 additions & 0 deletions src/Controls/src/Core/Internals/PropertyPropagationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#nullable disable
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -8,6 +9,15 @@ namespace Microsoft.Maui.Controls.Internals
/// <include file="../../../docs/Microsoft.Maui.Controls.Internals/PropertyPropagationExtensions.xml" path="Type[@FullName='Microsoft.Maui.Controls.Internals.PropertyPropagationExtensions']/Docs/*" />
public static class PropertyPropagationExtensions
{
[Obsolete]
internal static void PropagatePropertyChanged(string propertyName, Element element, IEnumerable children)
{
if (children == null)
return;

PropagatePropertyChanged(propertyName, element, children.OfType<IVisualTreeElement>().ToList());
}

internal static void PropagatePropertyChanged(string propertyName, Element element, IReadOnlyList<IVisualTreeElement> children)
{
if (propertyName == null || propertyName == VisualElement.FlowDirectionProperty.PropertyName)
Expand Down
Loading
Loading