diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-05 18:24:25 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-05 18:24:25 +0300 |
| commit | f6fe86625120c894db221bac54aeb7bb483da0ad (patch) | |
| tree | 72469727678d2fed165f2c0939adf29200d30aa5 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs | |
| parent | 142fe9ecfa594d93feb9ce5ea0df73f468cd2f79 (diff) | |
| parent | c246f372617b18255134b2d5495c6809d3e91904 (diff) | |
| download | Tango-f6fe86625120c894db221bac54aeb7bb483da0ad.tar.gz Tango-f6fe86625120c894db221bac54aeb7bb483da0ad.zip | |
MERGE
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index c31c95800..229d62df7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -34,7 +34,6 @@ namespace Tango.MachineStudio.RML.ViewModels private IAuthenticationProvider _authentication; private IActionLogManager _actionLogManager; private RmlDTO _rmlBeforeSave; - private static object _syncLock = new object(); private ObservablesContext _rmls_context; private ObservablesContext _active_context; @@ -56,8 +55,6 @@ namespace Tango.MachineStudio.RML.ViewModels set { _rmlssCollectionView = value; - BindingOperations.EnableCollectionSynchronization(_rmlssCollectionView, _syncLock); - RaisePropertyChangedAuto(); } } @@ -311,6 +308,15 @@ namespace Tango.MachineStudio.RML.ViewModels } RmlsCollectionView = CollectionViewSource.GetDefaultView(Rmls); RmlsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Rml.LastUpdated), ListSortDirection.Descending)); + //RmlsCollectionView.Filter = new Predicate<object>(FilterCollection); + + RmlsCollectionView.Filter = (rml) => + { + Rml r = rml as Rml; + return String.IsNullOrWhiteSpace(RMLFilter) + || r.Name.ToLower().Contains(RMLFilter.ToLower()) //Rml name + || (r.MediaMaterial != null && r.MediaMaterial.Name.ToLower().Contains(RMLFilter.ToLower())); + }; } private async void LoadActiveRML(String guid) @@ -683,19 +689,7 @@ namespace Tango.MachineStudio.RML.ViewModels private void OnRMLFilterChanged() { - String filter = RMLFilter.ToLower(); - - RmlsCollectionView.Filter = (rml) => - { - Rml r = rml as Rml; - return String.IsNullOrWhiteSpace(filter) - || - r.Name.ToLower().Contains(filter) //Rml name - || - (r.MediaMaterial != null && r.MediaMaterial.Name.ToLower().Contains(filter)) // Material name - || - (r.Cct != null && r.Cct.FileName != null && r.Cct.FileName.ToString().Contains(filter)); //Cct.FileName - }; + RmlsCollectionView.Refresh(); } private void RemoveLiquidFactor(LiquidTypesRml liquidFactor) |
