MahApps.Metro.Controls.XmlBrowser.XmlBrowserControl.ValidateXmlButtonClick C# (CSharp) Метод

ValidateXmlButtonClick() приватный Метод

private ValidateXmlButtonClick ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
Результат void
        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();
        }