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 (lepoco#1202)

Co-authored-by: pomian <[email protected]>
  • Loading branch information
textGamex and pomianowski authored Oct 24, 2024
1 parent caf86ab commit 950ade6
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 950ade6

Please sign in to comment.