Beispiel #1
0
 private bool IsNoDuplicated(List<string> nums)
 {
     return nums.TrueForAll(n =>
         db.Cubes.All(c => c.Name != n)
         );
 }
        public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {

            List<bool> boolList = new List<bool>();
            bool Result = false;
            foreach (var item in values)
            {
                if (item == null)
                    boolList.Add(false);
                else
                    boolList.Add((bool)item);
            }

            string operation = parameter.ToString();

            if (operation.ToLower() == "all")
            {
                Result = boolList.TrueForAll(o => o == true);
            }
            else
            {
                Result = boolList.Any(o => o == true);
            }


            if (!Result)
                return Visibility.Visible;
            else
                return Visibility.Collapsed;



        }