aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-09-12 12:47:01 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-09-12 12:47:56 +0300
commit69a68e9a8b5dd452373cf2c4065e1a50178cfa02 (patch)
treeb03bd3143bde3f5476ed4a5b080142b33381253a /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels
parent3c0b20184527064f1c5d9374894f3d9ec44672e3 (diff)
downloadTango-69a68e9a8b5dd452373cf2c4065e1a50178cfa02.tar.gz
Tango-69a68e9a8b5dd452373cf2c4065e1a50178cfa02.zip
MachineStudio. Sites. selected RMLs using a text button: “Show selected”. Also allow to filter by words by using: “Filter:_abc_____”
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs57
1 files changed, 57 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs
index 02c9f4346..bf2ebdbcf 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs
@@ -14,6 +14,8 @@ using Tango.MachineStudio.Common.Authentication;
using Tango.BL.ActionLogs;
using Tango.BL.DTO;
using Tango.BL.Builders;
+using System.ComponentModel;
+using System.Windows.Data;
namespace Tango.MachineStudio.Sites.ViewModels
{
@@ -70,12 +72,44 @@ namespace Tango.MachineStudio.Sites.ViewModels
set { _spoolTypes = value; RaisePropertyChangedAuto(); }
}
+ private bool _showSelectedRMLsOnly;
+
+ public bool ShowSelectedRMLsOnly
+ {
+ get { return _showSelectedRMLsOnly; }
+ set { _showSelectedRMLsOnly = value;
+ RaisePropertyChangedAuto(); RMLCollection.Refresh(); }
+ }
+
+ private String _RMLFilter;
+
+ public String RMLFilter
+ {
+ get { return _RMLFilter; }
+ set {
+ _RMLFilter = value;
+ RaisePropertyChangedAuto();
+ RMLCollection.Refresh();
+ }
+ }
+
+
+ private ICollectionView _rmlscollectionFilter;
+ public ICollectionView RMLCollection
+ {
+ get { return _rmlscollectionFilter; }
+ set { _rmlscollectionFilter = value;
+ RaisePropertyChangedAuto(); }
+ }
+
+
public RelayCommand SaveCommand { get; set; }
public SiteDetailsViewVM()
{
SaveCommand = new RelayCommand(Save, () => IsFree);
+ _showSelectedRMLsOnly = true;
}
public async Task Init(String siteGuid, INotificationProvider notification, IAuthenticationProvider authentication, IActionLogManager actionLogManager, bool isNew, string newSiteName = null)
@@ -127,6 +161,29 @@ namespace Tango.MachineStudio.Sites.ViewModels
}
_siteBeforeSave = SiteDTO.FromObservable(Site);
+
+ RMLCollection = CollectionViewSource.GetDefaultView(Rmls);
+ RMLCollection.Filter = new Predicate<object>(x =>
+ {
+ SelectedObject Sel_rml = x as SelectedObject;
+
+ if (!String.IsNullOrEmpty(RMLFilter))// by filter and check box Show selected only
+ {
+ var rml = Sel_rml.Data as Rml;
+ if (rml != null && rml.Name.ToLower().Contains(RMLFilter.ToLower()))
+ {
+ return ShowSelectedRMLsOnly ? Sel_rml.IsSelected : true;
+ }
+ else
+ return false;
+ }
+ else
+ {
+ return ShowSelectedRMLsOnly ? Sel_rml.IsSelected : true;
+ }
+
+
+ });
}
private async void Save()