Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
5780cb9
[leak-fix] Fix Picker.ItemsSource memory leak (Fixes #36272)
Copilot Jul 1, 2026
6d47472
Merge branch 'main' into promote/picker-itemssource-leak
kubaflo Jul 8, 2026
f5bcce4
Fix MauiView leaks detached platform views when SafeAreaEdges include…
KarthikRajaKalaimani Jun 3, 2026
2e9df5c
[Android][Testing] Add dedicated CI stage for SafeAreaEdges tests on …
NafeelaNazhir Jun 4, 2026
9daabe1
[Mac] Fix for DeviceDisplay.MainDisplayInfoChanged event not getting …
HarishwaranVijayakumar Jun 4, 2026
716ded3
Fixed Incorrect Window.Y and Window.Height values when closing a maxi…
Dhivya-SF4094 Jun 4, 2026
0bc6118
[Testing] Refactoring Feature Matrix UITest Cases for RadioButton Con…
HarishKumarSF4517 Jun 4, 2026
3184ace
[iOS/Mac Catalyst 26] Fix NavigationPage content not extending behind…
SyedAbdulAzeemSF4852 Jun 5, 2026
51d7901
[Android] Fix MapHandler leaks when removed Pin instances are retaine…
SubhikshaSf4851 Jun 5, 2026
84d0af3
Fix Android foreground geolocation update distance (#35783)
jfversluis Jun 5, 2026
72c33af
[Android] - Fix KeepScrollOffset Behavior During Dynamic Item Additio…
prakashKannanSf3972 Jun 7, 2026
e646d4f
Don't pack .NET Standard (#32203)
mattleibow Jun 7, 2026
ae6f610
[ci] Remove trimming workaround (#33624)
rmarinho Jun 7, 2026
983af21
Rename RunOnAndroid CI lane to match its Linux pool (#34866)
Copilot Jun 7, 2026
ec7e4ed
Add UsePlatformHandler<T> for custom BlazorWebView backends (#34225)
Redth Jun 7, 2026
31e2614
[HouseKeeping] Fix inconsistant owner type of DropCommandProperty (#3…
NirmalKumarYuvaraj Jun 8, 2026
dc3c354
Make MSIX install in Windows test cake script resilient (#35670)
akoeplinger Jun 8, 2026
3a5164b
[iOS] Fixed Webview LoadFile ignore directories. (#31040)
NirmalKumarYuvaraj Jun 8, 2026
a3db7c2
[Android] Fix DragGestureRecognizer DragStarting Command/Event fired …
HarishwaranVijayakumar Jun 8, 2026
d1ffb5e
[iOS & macOS] Fixed IndicatorView square shape does not update on loa…
NanthiniMahalingam Jun 9, 2026
1440d3b
Fix RelativeSource Binding is NULL with XAML SourceGen and IsAotComp…
KarthikRajaKalaimani Jun 10, 2026
0579dc7
[Android] Fix CollectionView items not resizing after orientation cha…
SyedAbdulAzeemSF4852 Jun 10, 2026
562de41
[Android] Fix RadialGradientBrush crash on Android when view has zero…
SyedAbdulAzeemSF4852 Jun 11, 2026
6030d6e
[Windows] Fix SwipeItem IsVisible not refreshing native swipe items w…
SubhikshaSf4851 Jun 11, 2026
189ea14
[Android] Fix grouped CollectionView grid row spacing regression (#35…
Shalini-Ashokan Jun 11, 2026
b6ca332
[Android] Fix RenderThread SIGSEGV crash with multiple auto-sizing We…
praveenkumarkarunanithi Jun 11, 2026
99e93dd
Fix incorrect DestinationPage in NavigationPage OnNavigatingFrom even…
Shalini-Ashokan Jun 11, 2026
3979ece
Fix Shell.Title binding in TitleView (#35800)
jfversluis Jun 12, 2026
245ffc8
[Android] Fix for Android RefreshView incorrectly triggering pull-to-…
BagavathiPerumal Jun 12, 2026
91554e0
Fix build error caused by duplicate property change registration in S…
SubhikshaSf4851 Jun 12, 2026
ac7a4c5
[Android] Fix SearchHandler.ClearPlaceholderEnabled not updated dynam…
SyedAbdulAzeemSF4852 Jun 12, 2026
e0f5482
Bridge DI-registered Essentials implementations to static facades (#3…
Redth Jun 12, 2026
bd887d7
[iOS, Mac] Fix Shell back button history menu does not update after r…
HarishwaranVijayakumar Jun 13, 2026
16c5389
Make GenerateMsixCert work without admin on subsequent runs (#35663)
akoeplinger Jun 13, 2026
d7a699a
Reduce boolean boxes across the framework (#35596)
pictos Jun 14, 2026
f321024
Support shared/custom Platforms folder mappings in SingleProject (#35…
Redth Jun 14, 2026
d457c41
[iOS][CV2] Fix Rotating the Simulator causes the text on the collecti…
devanathan-vaithiyanathan Jun 15, 2026
57a739f
[Windows] FlyoutPage: Fix CollapsedPaneWidth mapping and updates (#33…
devanathan-vaithiyanathan Jun 15, 2026
9eaacbc
[iOS 26] Fix Shell TitleView not resizing on device rotation (#35883)
SyedAbdulAzeemSF4852 Jun 17, 2026
eb17cfa
[WIP] [Android] Fix CollectionView KeepScrollOffset regressed after P…
HarishwaranVijayakumar Jun 17, 2026
7effad3
[CV2][Mac] Fix Vertical List page slows down when resizing the window…
devanathan-vaithiyanathan Jun 18, 2026
eff3891
[iOS] Fix ScrollView with RTL FlowDirection and Horizontal Orientatio…
devanathan-vaithiyanathan Jun 18, 2026
d9320e9
Fix memory leak when clearing shared PathSegments from PathFigure (#3…
devanathan-vaithiyanathan Jun 19, 2026
4216d9a
[Windows] Fix PlatformTicker.Windows.cs — IsRunning always returns fa…
HarishwaranVijayakumar Jun 19, 2026
ff9480f
[Android] Fix WebView.CanGoBack() returning true on first navigated p…
praveenkumarkarunanithi Jun 19, 2026
c6f4509
[Android] Fix crash in Label FormattedText span position recalculati…
Shalini-Ashokan Jun 19, 2026
a46cf93
[Windows] Throws ArgumentOutOfRangeException on WinUI when setting Ma…
SubhikshaSf4851 Jun 20, 2026
a28a7e3
[Android] Fix Shell SearchHandler toolbar icon tint (#36016)
erikzhang Jun 20, 2026
03f0dc0
Fix StrokeDashArray on Border does not reset when set to null (#29910)
devanathan-vaithiyanathan Jun 21, 2026
40f8a89
[BlazorWebView] Fixed Allow force reload for URLs with dots in query …
tw4 Jun 21, 2026
a6e6583
Fix safe area CSS in Blazor Hybrid templates for Android (#34463)
Copilot Jun 21, 2026
fd26832
[Android] Restore OnBackButtonPressed interception support when using…
Dhivya-SF4094 Jun 21, 2026
a76a0b7
Fix s_currentTweener++ in AnimationExtensions is not thread-safe, pro…
HarishwaranVijayakumar Jun 21, 2026
4a6713b
Fixed [Windows] KeepScrollOffset Behavior Not Working as Expected in …
Shalini-Ashokan Jun 21, 2026
d18e8e2
[iOS]Fix Shadow Property Incorrectly Modifies Visual Transform Matrix…
devanathan-vaithiyanathan Jun 21, 2026
1d9491f
Fix Picker reacts to data changes after the page is closed (#33733)
devanathan-vaithiyanathan Jun 22, 2026
bbf45f6
[Android] CarouselView: Fix position jump when tapping non-Start ali…
praveenkumarkarunanithi Jun 22, 2026
5de2bcd
[Android] Shell Flyout: Apply safe-area insets to the flyout containe…
devanathan-vaithiyanathan Jun 22, 2026
73aaae7
[iOS/Mac][CV2] Fix CarouselView2 freezes with infinite loop when IsSc…
SyedAbdulAzeemSF4852 Jun 22, 2026
217b42f
[iOS] ScrollView: Fix landscape safe-area handling around the notch (…
KarthikRajaKalaimani Jun 22, 2026
f76284d
[Windows] Fix for MenuFlyoutItem displaying icon in monochrome instea…
SyedAbdulAzeemSF4852 Jun 22, 2026
d608f9b
[Testing] Feature matrix UITest Cases for MenuBarItem Control (#34007)
HarishKumarSF4517 Jun 22, 2026
28d9957
Fix SwipeView Threshold changes width and offset of the side menu (wh…
KarthikRajaKalaimani Jun 22, 2026
444e4c5
[iOS] Fix ScrollView does not resize when children are removed from S…
devanathan-vaithiyanathan Jun 22, 2026
db69d65
[iOS] Fix Font autoscaling does not work in realtime (#34445)
HarishwaranVijayakumar Jun 23, 2026
5ba0f40
[Windows] Fix FilePicker Returns wrong ContentType for *.webp files (…
devanathan-vaithiyanathan Jun 23, 2026
986db3f
[iOS, MacCatalyst] CollectionView: Fix grid spacing updates for first…
KarthikRajaKalaimani Jun 23, 2026
5ebdf10
Fix SearchHandler.QueryIcon, ClearIcon, and ClearPlaceholderIcon do n…
SubhikshaSf4851 Jun 24, 2026
6f6b6ea
[iOS] Fix transparent Shell navigation bar appearing opaque after key…
Shalini-Ashokan Jun 24, 2026
23cd737
[Android] ScrollView doesn't work in the Shell Flyout Header (#33192)
KarthikRajaKalaimani Jun 24, 2026
80dee3d
Fix Path.Data and Path.RenderTransform visual tree leaks with shared …
devanathan-vaithiyanathan Jun 24, 2026
7e6fea5
[iOS & Mac] Fix NullReferenceException in CollectionViewHandler2 afte…
SubhikshaSf4851 Jun 25, 2026
cfdc79e
Don't unpack netstandard workload packs (fix nightly vs-workload.prop…
PureWeen Jun 25, 2026
92eef48
Fix the Aspire ServiceDefaults project template (#33025)
mattleibow Jun 25, 2026
fd33a4c
[Android][Windows] Fix GraphicsView passing fractional dirtyRect dime…
SyedAbdulAzeemSF4852 Jun 25, 2026
69f0c0f
[iOS/macCatalyst] Fix Entry cursor reset when typing with TextTransfo…
SyedAbdulAzeemSF4852 Jun 25, 2026
b8a2961
Update Windows App SDK to 1.8.260529003 and related dependencies (#34…
mattleibow Jun 26, 2026
dbe8f09
[Mac] Fix Titlebar content is not aligned to left on fullscreen (#30378)
devanathan-vaithiyanathan Jun 26, 2026
c0e8bbd
Fix CI pipeline build warnings (RS0016/RS0017, XA1006, duplicate spla…
rmarinho Jun 26, 2026
6c08867
Fix Shell Navigating event not firing on ShellContent change (#34351)
jpd21122012 Jun 27, 2026
834e8e9
[CV2][iOS] Fix MeasureFirstItem measuring non-first cells (#36159)
devanathan-vaithiyanathan Jun 28, 2026
d287bd3
[Android] Fix ActivityStateManager leaking lifecycle callbacks on Act…
Shalini-Ashokan Jun 28, 2026
819ab16
[Android] Fix: TapGestureRecognizer not firing on horizontal ScrollVi…
Shalini-Ashokan Jun 29, 2026
5d75435
[iOS] Fix WebView.Reload() with HtmlWebViewSource returns WebNavigati…
devanathan-vaithiyanathan Jun 29, 2026
9644c01
Revert unwanted changes
devanathan-vaithiyanathan Jun 29, 2026
245239b
Shapes: Fix TransformGroup child subscription leaks (#36150)
HarishwaranVijayakumar Jun 29, 2026
b374f15
[iOS] Fix RefreshView causes CollectionView scroll position to reset …
devanathan-vaithiyanathan Jun 29, 2026
94684f1
Fix Shell flyout item template does not update selected visuals after…
devanathan-vaithiyanathan Jun 29, 2026
16081ef
[Windows] Make Layout AutomationPeer internal + opt-in for screen rea…
kubaflo Jun 29, 2026
7df382b
Fix Picker selection when SelectedItem is removed from ItemsSource (#…
jpd21122012 Jun 29, 2026
137d787
[Android] CarouselView: Fix touch interception to delegate vertical s…
Dhivya-SF4094 Jun 30, 2026
e41f79f
[iOS][CV2] Fix CollectionView2 on iOS iPad jumps/scrolls randomly whe…
devanathan-vaithiyanathan Jun 30, 2026
5808fce
[Android] Fix ScrollView scroll position changes unexpectedly when Or…
devanathan-vaithiyanathan Jun 30, 2026
fd1a303
[Mac]Clear button not hidden when text is cleared (#34737)
devanathan-vaithiyanathan Jun 30, 2026
6ff6463
Fix Android nested gesture ownership (#35863)
AdamEssenmacher Jun 30, 2026
9a9a34a
Route Android HybridWebView JS->.NET messages through HTTP intercept …
jonathanpeppers Jun 30, 2026
8dca2b6
[iOS] Fix MediaPicker FullPath for PHPicker results (#35805)
jfversluis Jul 1, 2026
af72a03
Fix: WebView inside SwipeView not responding to swipe gestures on And…
SubhikshaSf4851 Jul 1, 2026
9bf18b4
Fix AdaptiveTrigger memory leak when VisualStateGroups are replaced a…
Shalini-Ashokan Jul 1, 2026
e056571
[Android] Fix status bar icon contrast with custom colorPrimary (#36214)
jpd21122012 Jul 1, 2026
8e2706f
[Testing] Refactoring Feature Matrix UITest Cases for Editor Control …
LogishaSelvarajSF4525 Jul 1, 2026
67109d0
Fix for GetPosition truncates fractional coordinates to integers In O…
SuthiYuvaraj Jul 1, 2026
deb21c1
Fix build failure caused by Issue36154 (#36296)
SubhikshaSf4851 Jul 2, 2026
257ac62
Fix GeometryGroup.Children.Clear() leaking shared child geometries (#…
devanathan-vaithiyanathan Jul 2, 2026
a27b8e2
[iOS] Respect InputTransparent when updating UserInteractionEnabled (…
jfversluis Jul 3, 2026
f1c2689
[iOS] Fix Shell Flyout SafeArea Rendering (#33335)
devanathan-vaithiyanathan Jul 3, 2026
16dcd07
[Android] Fix Entry password visibility when using Keyboard.Password …
jpd21122012 Jul 3, 2026
869e703
[Android] CarouselView: Fix scroll to last item after data reset in l…
SyedAbdulAzeemSF4852 Jul 5, 2026
c406eae
Fix for PathGeometry.Figures.Clear() leaks when clearing shared PathF…
BagavathiPerumal Jul 5, 2026
5b7e74c
[iOS/MacCatalyst] Fix ActivityIndicator frozen static frame when IsRu…
SyedAbdulAzeemSF4852 Jul 6, 2026
b82e975
[Testing] SafeArea Feature Matrix Test Cases for ContentView (#36065)
TamilarasanSF4853 Jul 6, 2026
c8c7f68
[Testing] SafeArea Feature Matrix Test Cases for Border (#36049)
TamilarasanSF4853 Jul 7, 2026
4266f81
[leak-fix] Fix SwipeItemView.Command memory leak (Fixes #36343) (#36357)
github-actions[bot] Jul 8, 2026
d7b652b
[leak-fix] Fix ListView.RefreshCommand memory leak (Fixes #36344) (#3…
github-actions[bot] Jul 8, 2026
4484e16
[Android] Fix blank gap when HasNavigationBar=false with SafeAreaEdge…
praveenkumarkarunanithi Jul 8, 2026
330d9c1
[iOS/MacCatalyst] Fix CollectionView (CV2) expanding to fill availabl…
SyedAbdulAzeemSF4852 Jul 8, 2026
9506a93
[iOS] Button: Fix text updates with CharacterSpacing (#36326)
jfversluis Jul 9, 2026
aec5dd6
[inflight/current] [Windows/Mac] Fix Shell page title leaking into na…
devanathan-vaithiyanathan Jul 9, 2026
c8e886e
Fix FlexLayout measuring items wider than their arranged size (#36416)
Kas-code Jul 9, 2026
15034ed
[Windows] Fix: StrokeLineCap values have no effect on Windows platfor…
SubhikshaSf4851 Jul 9, 2026
40e674b
[leak-fix] Fix BackButtonBehavior.Command memory leak (Fixes #36345) …
github-actions[bot] Jul 9, 2026
cee52c3
[iOS] Fix WebView GoBack/GoForward not working for HtmlWebViewSource …
devanathan-vaithiyanathan Jul 9, 2026
f9f3c80
[Android] MediaPicker: Fix photo picker completion from child activit…
KarthikRajaKalaimani Jul 9, 2026
f594a31
[tests] Re-enable Android memory-leak UI tests (#27411) (#36480)
kubaflo Jul 10, 2026
e243d63
[leak-fix] Fix IndicatorView.ItemsSource memory leak (Fixes #35775) (…
kubaflo Jul 11, 2026
86a94bd
Use private Picker collection subscription owner
Copilot Jul 11, 2026
af53a67
Document Picker weak handler lifetime
Copilot Jul 12, 2026
d029551
Clarify Picker memory test lifetime
Copilot Jul 12, 2026
c34e3d7
Release detached Picker subscription helpers
Copilot Jul 12, 2026
ec12d29
Test Picker ItemsSource updates after collection
Copilot Jul 12, 2026
3a60ecd
Improve Picker ItemsSource subscription reuse
Copilot Jul 13, 2026
4c61482
Restore existing Picker test formatting
Copilot Jul 13, 2026
dbfa23a
Stabilize Picker memory test lifetime
Copilot Jul 13, 2026
4f82610
Add Picker reassignment mutation coverage
Copilot Jul 13, 2026
09a30f9
Stabilize Picker subscription GC helper
Copilot Jul 13, 2026
abc5b4b
Fix for memory leak in Accelerometer.ReadingChanged/ShakeDetected by …
BagavathiPerumal Jul 13, 2026
14ee049
Merge inflight/current into Picker leak fix
Copilot Jul 13, 2026
d31bd4e
Fix SwipeItem background not updating on AppTheme change (#36271)
Shalini-Ashokan Jul 13, 2026
50b4593
Reuse Picker ItemsSource subscription helper
Copilot Jul 13, 2026
a78a96b
Reconcile Picker selection after reattach
Copilot Jul 13, 2026
4807d9e
Cover Picker source replacement while detached
Copilot Jul 13, 2026
adfdf6c
Apply pending Picker selection on reattach
Copilot Jul 14, 2026
7f07754
Add detached Picker selection shift coverage
Copilot Jul 14, 2026
d7fa271
Merge inflight/current into Picker leak fix
Copilot Jul 14, 2026
6ce9a00
Improve Picker handler reattach coverage
Copilot Jul 14, 2026
4e7af45
Merge inflight/current into Picker leak fix
Copilot Jul 15, 2026
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
65 changes: 54 additions & 11 deletions src/Controls/src/Core/Picker/Picker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,17 @@ public partial class Picker : View, IFontElement, ITextElement, ITextAlignmentEl

readonly Lazy<PlatformConfigurationRegistry<Picker>> _platformConfigurationRegistry;

ItemsSourceCollectionChangedSubscription _itemsSourceCollectionChangedSubscription;
// WeakNotifyCollectionChangedProxy weakly references its handler, so the Picker must keep this delegate alive.
NotifyCollectionChangedEventHandler _collectionChangedEventHandler;

/// <summary>Initializes a new instance of the Picker class.</summary>
public Picker()
{
((INotifyCollectionChanged)Items).CollectionChanged += OnItemsCollectionChanged;
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Picker>>(() => new PlatformConfigurationRegistry<Picker>(this));
}

/// <summary>Gets a value that indicates whether the font for the searchbar text is bold, italic, or neither. This is a bindable property.</summary>
public FontAttributes FontAttributes
{
Expand Down Expand Up @@ -338,7 +343,7 @@ void OnItemsSourceChanged(IList oldValue, IList newValue)
UnsubscribeFromItemsSourceCollection();
}

if (Handler is not null)
if (!_isItemsSourceSubscriptionPaused)
{
SubscribeToItemsSourceCollection(newValue as INotifyCollectionChanged);
}
Expand All @@ -356,8 +361,40 @@ void OnItemsSourceChanged(IList oldValue, IList newValue)
}
}

sealed class ItemsSourceCollectionChangedSubscription
{
readonly WeakNotifyCollectionChangedProxy _proxy = new();
bool _isFinalizationSuppressed;

~ItemsSourceCollectionChangedSubscription() => _proxy.Unsubscribe();

public void Subscribe(INotifyCollectionChanged source, NotifyCollectionChangedEventHandler handler)
{
if (_isFinalizationSuppressed)
{
GC.ReRegisterForFinalize(this);
_isFinalizationSuppressed = false;
}

_proxy.Subscribe(source, handler);
}

public void Unsubscribe()
{
_proxy.Unsubscribe();

if (_isFinalizationSuppressed)
return;

GC.SuppressFinalize(this);
_isFinalizationSuppressed = true;
}
}

readonly Queue<Action> _pendingIsOpenActions = new Queue<Action>();
INotifyCollectionChanged _subscribedItemsSourceCollection;
// Preserve source updates before the first handler; pause only after explicit detachment.
bool _isItemsSourceSubscriptionPaused;

void OnIsOpenPropertyChanged(bool oldValue, bool newValue)
{
Expand All @@ -373,21 +410,27 @@ void OnIsOpenPropertyChanged(bool oldValue, bool newValue)

protected override void OnHandlerChanged()
{
var wasItemsSourceSubscriptionPaused = _isItemsSourceSubscriptionPaused;

if (Handler is null)
{
_isItemsSourceSubscriptionPaused = true;
UnsubscribeFromItemsSourceCollection();
}

base.OnHandlerChanged();

if (Handler is not null)
{
_isItemsSourceSubscriptionPaused = false;
SubscribeToItemsSourceCollection(ItemsSource as INotifyCollectionChanged);

// Keep display items in sync if this Picker is detached and later reattached.
if (ItemsSource is not null)
// Observable sources stay synchronized before the first handler; rebuild only after a
// detached interval or for non-observable sources that may have changed in place.
if (ItemsSource is not null &&
(wasItemsSourceSubscriptionPaused || ItemsSource is not INotifyCollectionChanged))
{
ResetItems();
ResyncItemsAndReconcileSelection();
}
}

Expand Down Expand Up @@ -418,18 +461,15 @@ void SubscribeToItemsSourceCollection(INotifyCollectionChanged collection)
}

UnsubscribeFromItemsSourceCollection();
var subscription = _itemsSourceCollectionChangedSubscription ??= new ItemsSourceCollectionChangedSubscription();
_collectionChangedEventHandler ??= CollectionChanged;
subscription.Subscribe(collection, _collectionChangedEventHandler);
_subscribedItemsSourceCollection = collection;
_subscribedItemsSourceCollection.CollectionChanged += CollectionChanged;
}

void UnsubscribeFromItemsSourceCollection()
{
if (_subscribedItemsSourceCollection is null)
{
return;
}

_subscribedItemsSourceCollection.CollectionChanged -= CollectionChanged;
_itemsSourceCollectionChangedSubscription?.Unsubscribe();
_subscribedItemsSourceCollection = null;
}

Expand Down Expand Up @@ -516,6 +556,9 @@ void ResyncItemsAndReconcileSelection()

Handler?.UpdateValue(nameof(IPicker.Items));

if (SelectedItem is null && TryApplyPendingSelectedIndex(forceClamp: true))
return;

if (SelectedItem is not null)
{
ClampSelectedIndex(ItemsSource.IndexOf(SelectedItem));
Expand Down
Loading
Loading