-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
Pri2Topic is in the second 25% of page views for the repo.Topic is in the second 25% of page views for the repo.reunion/prodwinui-reference/tech
Description
The example showing how to open the ContentDialog from within a window's event handler is missing a critical line of code, at least under the current version of WinUI 3:
private async void ShowLog_Click( object sender, RoutedEventArgs e )
{
var dlg = new LogViewer();
// this line is critical; without it, you get an obscure WinRT error message
dlg.XamlRoot = App.Current.MainWindow!.Content.XamlRoot;
await dlg.ShowAsync();
}
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 8d762be8-f952-5b02-4797-cf7c47fbb2ab
- Version Independent ID: 043b87f7-53b5-8d96-3312-9547c17c8673
- Content: ContentDialog Class (Microsoft.UI.Xaml.Controls) - WinUI
- Content Source: winui-api-build/xml/Microsoft.UI.Xaml.Controls/ContentDialog.xml
- Product: reunion
- Technology: winui-reference
- GitHub Login: @jwmsft
- Microsoft Alias: jimwalk
Metadata
Metadata
Assignees
Labels
Pri2Topic is in the second 25% of page views for the repo.Topic is in the second 25% of page views for the repo.reunion/prodwinui-reference/tech