From f0bcdcdbfa78ba705b8fa44591fa594a425352a9 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Fri, 15 Jun 2018 23:18:51 +0300 Subject: Implemented TouchLoadingPanel --- .../Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 15 ++ .../PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml | 186 +++++++++++---------- 2 files changed, 109 insertions(+), 92 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') 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 fabb57d10..3cbb44bbe 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 @@ -53,6 +53,17 @@ namespace Tango.PPC.Jobs.ViewModels } } + private bool _isLoadingJobs; + /// + /// Gets or sets a value indicating whether this instance is loading jobs. + /// + public bool IsLoadingJobs + { + get { return _isLoadingJobs; } + set { _isLoadingJobs = value; RaisePropertyChangedAuto(); } + } + + #endregion #region Commands @@ -139,6 +150,8 @@ namespace Tango.PPC.Jobs.ViewModels { Task.Factory.StartNew(() => { + IsLoadingJobs = true; + Thread.Sleep(500); if (_jobsContext != null) @@ -151,6 +164,8 @@ namespace Tango.PPC.Jobs.ViewModels 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)); + + IsLoadingJobs = false; }); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml index 1686aef84..63e65f777 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml @@ -23,7 +23,7 @@ - + @@ -58,98 +58,100 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.3.1