WinUI in Desktop app is silently crashed if I put Grid descendant to the Grid.Children collection
See original GitHub issueHello!
I created a "Blank App, Packaged (WinUI in Desktop) from VS templates.
In MainPage.xaml I set a name for the root grid.
<Grid x:Name="RootGrid"> </Grid>
Next, in MainPage.xaml.cs, I created a Grid descendant and put it to the Children collection of the RootGrid.
public sealed partial class MainWindow : Window { public MainWindow() { this.InitializeComponent(); RootGrid.Children.Add(new MyGrid() { Background = new SolidColorBrush(Colors.Red) }); } } public class MyGrid : Grid { }
The main window shows for a seconds and application exits without any errors or exceptions.
Version Info
NuGet package version: Microsoft.WinUI 3.0.0-preview2.200713.0 Windows 10 version: 1903 (OS Build 18362.1082)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
@PureWeen and @BorzillaR, I just validated that the attached repro app no longer has an issue with preview3
@BorzillaR - I’m closing this out now that preview3 has been released. Please respond if you are still experiencing this issue.