예제 #1
0
        private bool Filter(object o)
        {
            TaskSolutions item = o as TaskSolutions;

            return(item != null &&
                   TaskNameContains(item));
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
 private bool TaskNameContains(TaskSolutions item)
 {
     return(item.Task.TaskName
            .IndexOf(FilterTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0);
 }