private async Task OnElementKeyDownAsync(KeyRoutedEventArgs e, [FromDI] IDependency1 dependency1, [FromDI] IDependency2 dependency2, [FromDI] IDependency3 dependency3) { await Task.Run(() => { KeyDownAssertionHandler?.Invoke(e.Key()); DependencyArgumentsHandler?.Invoke(dependency1, dependency2, dependency3); }); }
private void OnTodoContentTextBoxKeyDown(KeyRoutedEventArgs e) { if (e.Key() != VirtualKey.Enter) { return; } Content.AddCurrentTodoContent(); }
private void OnTodoContentTextBoxKeyDown(KeyRoutedEventArgs e) { switch (e.Key()) { case VirtualKey.Enter: TodoItem.CompleteEdit(); break; case VirtualKey.Escape: TodoItem.CancelEdit(); break; } }
protected void OnElementKeyDown(KeyRoutedEventArgs e) { KeyDownAssertionHandler?.Invoke(e.Key()); }
protected void OnElementKeyDown(KeyRoutedEventArgs e, [FromDI] IDependency1 dependency1, [FromDI] IDependency2 dependency2, [FromDI] IDependency3 dependency3) { KeyDownAssertionHandler?.Invoke(e.Key()); DependencyArgumentsHandler?.Invoke(dependency1, dependency2, dependency3); }
private async Task OnElementKeyDown(KeyRoutedEventArgs e) { await Task.Run(() => KeyDownAssertionHandler?.Invoke(e.Key())); }