Beispiel #1
0
 public void RefreshTasks()
 {
     Tasks.Clear();
     foreach (IDeviceTask task in _device.Tasks)
     {
         if (!task.IsDelete)
         {
             DeviceTaskViewModel taskVM = new DeviceTaskViewModel(task);
             Tasks.Add(taskVM);
         }
     }
 }
Beispiel #2
0
        private void RefreshTaskList()
        {
            int taskIDForSelect = int.MinValue;

            if (SelectedTask != null)
            {
                taskIDForSelect = SelectedTask.ID;
            }

            OnPropertyChanged(nameof(Tasks));

            if (taskIDForSelect > int.MinValue)
            {
                DeviceTaskViewModel task = Tasks.Where(t => t.ID == taskIDForSelect).FirstOrDefault();
                SelectedTask = task;
            }
        }