From 059a82b6a52df7f25a75cff441a2a26531ccfe1a Mon Sep 17 00:00:00 2001 From: Alvin Ashcraft Date: Sat, 6 May 2023 14:34:24 -0400 Subject: [PATCH] Simplify contentdialog code --- Chapter02/MyMediaCollection/MainWindow.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Chapter02/MyMediaCollection/MainWindow.xaml.cs b/Chapter02/MyMediaCollection/MainWindow.xaml.cs index 6db920a..5490815 100644 --- a/Chapter02/MyMediaCollection/MainWindow.xaml.cs +++ b/Chapter02/MyMediaCollection/MainWindow.xaml.cs @@ -120,9 +120,9 @@ namespace MyMediaCollection { Title = "My Media Collection", Content = "Adding items to the collection is not yet supported.", - CloseButtonText = "OK" + CloseButtonText = "OK", + XamlRoot = Content.XamlRoot }; - dialog.XamlRoot = this.Content.XamlRoot; await dialog.ShowAsync(); } }