コード例 #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);
 }