コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public void Validate(ResolvedTreeRoot resolvedTreeRoot)
 {
     Lesson1CommonValidator.ValidateTextBoxBindings(resolvedTreeRoot);
 }