Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 0 additions & 50 deletions src/Controls/tests/DeviceTests/Xaml/StaticResourceTests.cs

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ public void ClickingOnMenuItemInRootDoesNotCrash_NavPageVersion()
public void ClickingOnMenuItemInRootDoesNotCrash_TabPageVersion()
{
App.WaitForElement(StillHereId);
#if ANDROID || WINDOWS // On Android and Windows, two back navigation actions are needed because the back button's position is the same for both navigation and flyout pages. This requires a double navigation to return to the root page.
App.TapBackArrow();
App.WaitForElement(StillHereId);
#endif
App.TapBackArrow();

App.WaitForElement(StartTabPageTestId);
Expand Down

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/Core/src/Handlers/ScrollView/ScrollViewHandler.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ protected override void ConnectHandler(ScrollViewer platformView)

protected override void DisconnectHandler(ScrollViewer platformView)
{
// Cascade disconnect to the PresentedContent's handler. Without this, when the
// ScrollView is restored as ContentPage.Content after being swapped out, the
// PresentedContent's native view still has a stale parent (the old ContentPanel),
// causing a WinUI COM exception "Element already has a parent" (Issue #35277).
// Cascading here ensures ToPlatform() creates a fresh native view with no parent.
VirtualView?.PresentedContent?.Handler?.DisconnectHandler();
base.DisconnectHandler(platformView);
platformView.ViewChanged -= ViewChanged;
}
Expand Down Expand Up @@ -158,9 +164,6 @@ static void UpdateContentPanel(IScrollView scrollView, IScrollViewHandler handle
currentPaddingLayer.CachedChildren.Clear();
}

// Detach the old handler if it exists (prevents WinUI COM exception on reuse)
scrollView.PresentedContent.Handler?.DisconnectHandler();

var nativeContent = scrollView.PresentedContent.ToPlatform(handler.MauiContext);

if (currentPaddingLayer is not null)
Expand Down
Loading