From 41a52407162c6ceb44aeddd3d83cfbb433383830 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Fri, 29 Nov 2024 11:07:01 -0800 Subject: [PATCH] use discard for not used argments --- src/Consolonia.Core/Controls/MessageBox.axaml.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Consolonia.Core/Controls/MessageBox.axaml.cs b/src/Consolonia.Core/Controls/MessageBox.axaml.cs index b0b27d59..f92f9d5f 100644 --- a/src/Consolonia.Core/Controls/MessageBox.axaml.cs +++ b/src/Consolonia.Core/Controls/MessageBox.axaml.cs @@ -45,16 +45,18 @@ public MessageBox() InitializeComponent(); - this.AttachedToVisualTree += (s, e) => + this.AttachedToVisualTree += (_, _) => { + // we don't hook this up until the dialog is shown as the visible state is driven off of the DataContext + // which is set at ShowDialogAsync() time. if (OkButton.IsVisible) - OkButton.AttachedToVisualTree += (s2, e2) => OkButton.Focus(); + OkButton.AttachedToVisualTree += (_, _) => OkButton.Focus(); else if (YesButton.IsVisible) - YesButton.AttachedToVisualTree += (s2, e2) => YesButton.Focus(); + YesButton.AttachedToVisualTree += (_, _) => YesButton.Focus(); else if (CancelButton.IsVisible) - CancelButton.AttachedToVisualTree += (s2, e2) => CancelButton.Focus(); + CancelButton.AttachedToVisualTree += (_, _) => CancelButton.Focus(); else if (NoButton.IsVisible) - NoButton.AttachedToVisualTree += (s2, e2) => NoButton.Focus(); + NoButton.AttachedToVisualTree += (_, _) => NoButton.Focus(); }; }