public override string Validate() { var results = new List <string>(); foreach (var i in _Conductor.GetChildren()) { var validator = i as ISupportValidation; if (validator == null) { continue; } results.Add(validator.Validate()); } results.Add(base.Validate()); return(Strings.Agregate(Environment.NewLine, results.ToArray())); }
/// <summary> /// Opens the specified screen. /// </summary> /// <param name="conductor">The conductor.</param> /// <param name="subjectSpecification">The subject.</param> /// <param name="callback">Is called with true if the screen is activated.</param> public static void ActivateSubject(this IConductor conductor, ISubjectSpecification subjectSpecification, Action <bool> callback) { var found = conductor.GetChildren() .OfType <IHaveSubject>() .FirstOrDefault(subjectSpecification.Matches); EventHandler <ActivationProcessedEventArgs> processed = null; processed = (s, e) => { conductor.ActivationProcessed -= processed; callback(e.Success); }; conductor.ActivationProcessed += processed; if (found != null) { conductor.ActivateItem(found); } else { subjectSpecification.CreateSubjectHost(viewModelFactory, conductor.ActivateItem); } }