public void Validate(ResolvedTreeRoot resolvedTreeRoot) { Lesson1CommonValidator.ValidateTextBoxBindings(resolvedTreeRoot); resolvedTreeRoot.GetDescendantControls <Button>().Single() .ValidateCommandBindingExpression(ButtonBase.ClickProperty, "Calculate()"); var buttonTextBinding = resolvedTreeRoot.GetDescendantControls <Button>() .Select(c => c.GetValue(ButtonBase.TextProperty)) .SingleOrDefault(); if (buttonTextBinding == null) { throw new CodeValidationException(Lesson1Texts.ButtonDoesNotHaveText); } }
public void Validate(ResolvedTreeRoot resolvedTreeRoot) { Lesson1CommonValidator.ValidateTextBoxBindings(resolvedTreeRoot); }