From 950ade69bd123f605b507dc472796cb6ef9bfd59 Mon Sep 17 00:00:00 2001 From: textGamex Date: Thu, 24 Oct 2024 16:37:06 +0800 Subject: [PATCH] perf: Exclude the definition of the CanCenterOverWPFOwnerPropertyInfo field in .NET 8 or higher (#1202) Co-authored-by: pomian <13592821+pomianowski@users.noreply.github.com> --- src/Wpf.Ui/Controls/MessageBox/MessageBox.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs b/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs index 0e37bcb1e..1da1681f2 100644 --- a/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs +++ b/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs @@ -236,10 +236,12 @@ public bool IsPrimaryButtonEnabled /// public IRelayCommand TemplateButtonCommand => (IRelayCommand)GetValue(TemplateButtonCommandProperty); +#if !NET8_0_OR_GREATER private static readonly PropertyInfo CanCenterOverWPFOwnerPropertyInfo = typeof(Window).GetProperty( "CanCenterOverWPFOwner", BindingFlags.NonPublic | BindingFlags.Instance )!; +#endif /// /// Initializes a new instance of the class.