From f67b8d11029ce185b4f13ec0fd866bfe4380be7d Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 19 Dec 2021 09:01:41 +0200 Subject: Disable buttons on collapsed panel when segments are not selected. --- .../PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs | 10 +++++++++- .../PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml | 11 +++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs index 0d95d02cc..c7b9d9b6d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs @@ -381,6 +381,12 @@ namespace Tango.PPC.Jobs.Models } } + public bool HasSelectedItems + { + get { + bool test = Segments.ToList().Any(x => x.IsSelected); + return Segments.ToList().Any(x => x.IsSelected); } + } public List SegmentsToCopy { get; set; } public TimeSpan GetEstimatedDuration @@ -503,7 +509,8 @@ namespace Tango.PPC.Jobs.Models { _selectAllSegments = false; } - RaisePropertyChanged("SelectAllSegments"); + RaisePropertyChanged(nameof(SelectAllSegments)); + RaisePropertyChanged(nameof(HasSelectedItems)); } } @@ -527,6 +534,7 @@ namespace Tango.PPC.Jobs.Models _preventChange = true; Segments.ToList().ForEach(x => x.IsSelected = SelectAllSegments); _preventChange = false; + RaisePropertyChanged(nameof(HasSelectedItems)); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml index ee5a58264..b8930089d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml @@ -61,6 +61,9 @@ + + + @@ -540,25 +543,25 @@ Repeat - + Reverse - + Delete - + Paste - + Copy -- cgit v1.3.1