private void OnWindowKeyUp(object sender, KeyEventArgs e) { var context = DataContext as MainViewViewModel; if (context == null) { return; } if (e.Key == Key.Enter && context.SearchCommand.CanExecute(1)) { AdsList.Focus(); context.SearchCommand.Execute(1); return; } if (e.Key == Key.Left && context.PreviousSubPageCommand.CanExecute(1) && !searchTextBox.IsFocused && !searchFilterTextBox.IsFocused) { context.PreviousSubPageCommand.Execute(1); return; } if (e.Key == Key.Right && context.NextSubPageCommand.CanExecute(1) && !searchTextBox.IsFocused && !searchFilterTextBox.IsFocused) { context.NextSubPageCommand.Execute(1); return; } if (e.Key == Key.NumPad1 && context.SwitchPageCommand.CanExecute(-1) && !searchTextBox.IsFocused && !searchFilterTextBox.IsFocused) { context.SwitchPageCommand.Execute(-1); return; } if (e.Key == Key.NumPad3 && context.SwitchPageCommand.CanExecute(1) && !searchTextBox.IsFocused && !searchFilterTextBox.IsFocused) { context.SwitchPageCommand.Execute(1); return; } }
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { var context = DataContext as MainViewViewModel; if (context == null) { return; } if (context.IsTheCheapestSelected) { context.SortAscending(); } else if (context.IsTheMostExpensiveSelected) { context.SortDescending(); } AdsList.Focus(); }
private void OnUpdateFocus(object sender) { AdsList.Focus(); }
public bool VerifyAdsExists() { return(!CheckIfListIsEmpty(AdsList.ToList <object>())); }