private void Enter_Click(object sender, RoutedEventArgs e) { if (EnterClicked != null) { EnterClicked.Invoke(this, EventArgs.Empty); } }
private void InputBox_KeyDown(object sender, KeyRoutedEventArgs e) { if (sender is TextBox t && e.Key == VirtualKey.Enter) { e.Handled = true; EnterClicked?.Invoke(this, EventArgs.Empty); } }