示例#1
0
        /// <summary>
        /// Shows the specified owner.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="title">The title.</param>
        /// <param name="ex">The ex.</param>
        public static void Show(Window owner, string title, ValidationException ex)
        {
            var form = new ValidationMessage
            {
                Owner      = owner,
                labelTitle = { Content = title },
                boxText    = { Text = ex.GetMessage() }
            };

            form.ShowDialog();
        }
示例#2
0
        /// <summary>
        /// Validates the specified ex.
        /// </summary>
        /// <param name="ex">The ex.</param>
        public void Validate(ValidationException ex)
        {
            string message = ex.GetMessage(PropertyName);

            isValid = string.IsNullOrEmpty(message);
            if (isValid)
            {
                ErrorMessage = string.Empty;
                Text         = string.Empty;
            }
            else
            {
                ErrorMessage = message;
                Text         = "*";
            }
        }