aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs16
1 files changed, 10 insertions, 6 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
index f03c7070a..dde587b84 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
@@ -203,12 +203,16 @@ namespace Tango.PPC.Jobs.ViewModels
_jobsContext = ObservablesContext.CreateDefault();
- Jobs = _jobsContext.Jobs.Where(x => x.Machine.SerialNumber == Settings.MachineSerialNumber).ToObservableCollection();
- JobsCollectionView = CollectionViewSource.GetDefaultView(Jobs);
- JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending));
- FilterJobCategory(FilterCategory);
+ var jobs = _jobsContext.Jobs.Where(x => x.Machine.Guid == ApplicationManager.Machine.Guid).ToObservableCollection();
- IsLoadingJobs = false;
+ InvokeUI(() =>
+ {
+ Jobs = _jobsContext.Jobs.Where(x => x.Machine.Guid == ApplicationManager.Machine.Guid).ToObservableCollection();
+ JobsCollectionView = CollectionViewSource.GetDefaultView(Jobs);
+ JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending));
+ FilterJobCategory(FilterCategory);
+ IsLoadingJobs = false;
+ });
});
}
@@ -227,7 +231,7 @@ namespace Tango.PPC.Jobs.ViewModels
/// <param name="jobCategory">The job category.</param>
public void FilterJobCategory(JobCategories jobCategory)
{
- JobsCollectionView.Filter = (job) =>
+ JobsCollectionView.Filter = (job) =>
{
return (job as Job).JobCategories.Contains(jobCategory);
};