public override ValidationResult Validate(object value, CultureInfo culture)
        {
            string input = value as string;

            if (string.IsNullOrWhiteSpace(input))
            {
                return(ValidationResult.ValidResult);
            }
            string stripped = StripWhitespace(input);

            if (!s_StrippedMatch.IsMatch(stripped))
            {
                return(new ValidationResult(false, Resource.ProjectPlan.Resources.Label_InvalidFormat));
            }
            ManagedActivityContext context = Context;

            if (context != null && context.Id != 0)
            {
                IList <int> output = Parse(stripped);
                if (output.Contains(context.Id))
                {
                    return(new ValidationResult(false, Resource.ProjectPlan.Resources.Label_SelfDependency));
                }
            }
            return(ValidationResult.ValidResult);
        }
Exemplo n.º 2
0
        private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ManagedActivityContext context = (ManagedActivityContext)d;
            BindingExpressionBase  bindingExpressionBase = BindingOperations.GetBindingExpressionBase(context, BindingToTriggerProperty);

            bindingExpressionBase?.UpdateSource();
        }