private void OnControlKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Escape && !string.IsNullOrEmpty(FilterText)) { Clear(); } else if (e.Key == Key.Enter && FilterOnEnter) { RaiseFilterEvent(); } else if (e.Key == Key.Up) { DirectionEventArgs args = new DirectionEventArgs(DirectionEvent, this, DirectionEnum.Up); RaiseEvent(args); } else if (e.Key == Key.Down) { DirectionEventArgs args = new DirectionEventArgs(DirectionEvent, this, DirectionEnum.Down); RaiseEvent(args); } else if (e.Key == Key.Right) { DirectionEventArgs args = new DirectionEventArgs(DirectionEvent, this, DirectionEnum.Right); RaiseEvent(args); } else if (e.Key == Key.Left) { DirectionEventArgs args = new DirectionEventArgs(DirectionEvent, this, DirectionEnum.Left); RaiseEvent(args); } }
private void FilterControl_Direction_1(object sender, DirectionEventArgs e) { try { if (e.Direction == DirectionEnum.Down) { if (SearchListCtl != null) { SearchListCtl.SelectedIndex += 1; } } if (e.Direction == DirectionEnum.Up && SearchListCtl.SelectedIndex > -1) { SearchListCtl.SelectedIndex -= 1; } if (e.Direction == DirectionEnum.Right) { MoveToNextControl(sender); } } catch (Exception ex) { Logger.Log(LoggingLevel.Error, GetCurrentMethodClass.GetCurrentMethod() + ": --- :" + ex.Message + ex.StackTrace); throw ex; } }
private void FilterControl_Direction_1(object sender, DirectionEventArgs e) { if (e.Direction == DirectionEnum.Down) { SearchListCtl.SelectedIndex += 1; } if (e.Direction == DirectionEnum.Up && SearchListCtl.SelectedIndex > -1) { SearchListCtl.SelectedIndex -= 1; } if (e.Direction == DirectionEnum.Right) { MoveToNextControl(sender); } }