Interaction logic for ValidationResultControl.xaml
Inheritance: System.Windows.Controls.UserControl
        private void ValidateXmlButtonClick(object sender, RoutedEventArgs e)
        {
            var xDoc        = XDocument.Parse(XmlDoc);
            var xsd         = XmlSchema;
            var xmlFileElem = xDoc.Root;

            if (xmlFileElem == null || xsd == null)
            {
                return;
            }
            var    xmlNamespace = xmlFileElem.GetDefaultNamespace().NamespaceName;
            string errors;

            if (new XmlValidator(xmlNamespace, xsd).Validate(xDoc, out errors))
            {
                errors = "No Errors Found!";
            }
            var validationResultControl = new ValidationResultControl
            {
                ResultTextBox = { Text = errors }
            };

            var validationResultWindow = new Window
            {
                WindowStyle           = WindowStyle.None,
                Content               = validationResultControl,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                Height = 200,
                Width  = 450
            };

            validationResultWindow.ShowDialog();
        }
        private void ValidateXmlButtonClick(object sender, RoutedEventArgs e)
        {
            var xDoc = XDocument.Parse(XmlDoc);
            var xsd = XmlSchema;
            var xmlFileElem = xDoc.Root;
            if (xmlFileElem == null || xsd == null) return;
            var xmlNamespace = xmlFileElem.GetDefaultNamespace().NamespaceName;
            string errors;
            if (new XmlValidator(xmlNamespace, xsd).Validate(xDoc, out errors))
                errors = "No Errors Found!";
            var validationResultControl = new ValidationResultControl
                                              {
                                                  ResultTextBox = { Text = errors }
                                              };

            var validationResultWindow = new Window
                                             {
                                                 WindowStyle = WindowStyle.None,
                                                 Content = validationResultControl,
                                                 WindowStartupLocation = WindowStartupLocation.CenterScreen,
                                                 Height = 200,
                                                 Width = 450
                                             };
            validationResultWindow.ShowDialog();
        }