Skip to content

Commit

Permalink
perf: Exclude the definition of the CanCenterOverWPFOwnerPropertyInfo…
Browse files Browse the repository at this point in the history
… field in .NET 8 or higher
  • Loading branch information
textGamex committed Aug 15, 2024
1 parent 4ac9686 commit 00dec72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Wpf.Ui/Controls/MessageBox/MessageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,12 @@ public bool IsPrimaryButtonEnabled
/// </summary>
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

/// <summary>
/// Initializes a new instance of the <see cref="MessageBox"/> class.
Expand Down

0 comments on commit 00dec72

Please sign in to comment.