Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 private void OnUpdateFocus(object sender)
 {
     AdsList.Focus();
 }
 public bool VerifyAdsExists()
 {
     return(!CheckIfListIsEmpty(AdsList.ToList <object>()));
 }