-
Notifications
You must be signed in to change notification settings - Fork 803
Description
Describe the bug
The exception "System.Runtime.InteropServices.COMException: 'No installed components were detected'" occurs when attempting to add a label to a newly created grid, even though the label's parent is confirmed to be null prior to adding it to the grid.
Grid x:Name="OuterGrid"> <Grid x:Name="InnerGrid"> <TextBlock Text="My Label" x:Name="MyLabel"></TextBlock> </Grid> </Grid>
private void MainWindow_SizeChanged(object sender, WindowSizeChangedEventArgs args)
{
this.OuterGrid.Children.Remove(this.InnerGrid);
this.InnerGrid = new Grid();
this.InnerGrid.Children.Add(MyLabel);
this.OuterGrid.Children.Add(InnerGrid);
}
Steps to reproduce the bug
- Run the attached sample.
- Once deployed, maximize the window.
- Observe that the exception occurs at this point.
Expected behavior
Exception should not occur if the Label parent is null.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.5: 1.6.250205002
Windows version
Windows 11 (24H2): Build 26100
Additional context
No response