UWP ScrollViewer headers are loaded twice #1367
Labels
area-Scrolling
needs-winui-3
Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)
no-issue-activity
Hi,
In a UWP application, the controls inside the ScrollViewer’s LeftHeader, TopHeader, TopLeftHeader are loaded twice.
Here is the XAML :
And for the C# code, I just call Debug.WriteLine in each Loaded and Unloaded events.
Here is the output :
For each control, the events are raised in the following order : Loaded, Loaded, Unloaded. And if I remove the ScrollViewer from the visual tree, the Unloaded event is raised once again.
This causes problems in a real application. I have some user controls inside the headers and they don’t like to be double-loaded. The ScrollViewer headers should be loaded only once.
Also I tried to put a Win2D CanvasVirtualControl in the TopHeader property. It does not work, nothing is rendered. I think it is also linked to this double-loading behavior…
The text was updated successfully, but these errors were encountered: