private bool Filter(object o) { TaskSolutions item = o as TaskSolutions; return(item != null && TaskNameContains(item)); }
private void SolutionSelected(object sender, RoutedEventArgs e) { ListBox listView = (ListBox)sender; Solution selected = (Solution)listView.SelectedItem; TaskSolutions taskSolutions = DataContext as TaskSolutions; if (selected != null) { taskSolutions?.SelectSolutionCommand.Execute(selected); } }
private void OnTaskSelected(object sender, RoutedEventArgs e) { AllTasks allTasks = DataContext as AllTasks; ListBox listBox = sender as ListBox; if (allTasks != null && listBox != null) { TaskSolutions selected = listBox.SelectedItem as TaskSolutions; ICommand command = allTasks.SelectTaskCommand; if (command.CanExecute(selected)) { command.Execute(selected); } } }
private bool TaskNameContains(TaskSolutions item) { return(item.Task.TaskName .IndexOf(FilterTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0); }