浏览代码

Fixed incorrectly disabled OK button in AWGMappingWindow

frankvandenbos 2 月之前
父节点
当前提交
b1997f45c5
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      prs.desktop/Integrations/Common/AWGMappingWindowViewModel.cs

+ 8 - 8
prs.desktop/Integrations/Common/AWGMappingWindowViewModel.cs

@@ -764,14 +764,14 @@ public class AWGMappingWindowViewModel : DependencyObject
                 ? Sections.First(x => string.Equals(x.Key, curSel))
                 : Sections.FirstOrDefault();
 
-            var styles = !StylesChecked || (StyleMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
-            var groups = !GroupsChecked || (GroupMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
-            var suppliers = !SuppliersChecked || (SupplierMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
-            var profiles = !ProfilesChecked || (ProfileMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
-            var gaskets = !GasketsChecked || (GasketMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
-            var components = !ComponentsChecked || (ComponentMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
-            var glass = !GlassChecked || (GlassMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
-            var labour = !LabourChecked || (LabourMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
+            var styles = !StylesChecked || (StyleMappings?.Any() != true) || (StyleMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
+            var groups = !GroupsChecked || (GroupMappings?.Any() != true) || (GroupMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
+            var suppliers = !SuppliersChecked || (SupplierMappings?.Any() != true) || (SupplierMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
+            var profiles = !ProfilesChecked || (ProfileMappings?.Any() != true) || (ProfileMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
+            var gaskets = !GasketsChecked || (GasketMappings?.Any() != true) || (GasketMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
+            var components = !ComponentsChecked || (ComponentMappings?.Any() != true) || (ComponentMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
+            var glass = !GlassChecked || (GlassMappings?.Any() != true) || (GlassMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
+            var labour = !LabourChecked || (LabourMappings?.Any() != true) || (LabourMappings?.All(x => x.Entity.ID != Guid.Empty) ?? false);
             MappingsComplete = styles && groups && suppliers && profiles && gaskets && components && glass && labour;
 
         });