Ejemplo n.º 1
0
        private void AcceptMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var validationResult = _validate?.Invoke(WebElement);

            if (!string.IsNullOrWhiteSpace(validationResult))
            {
                MessageBox.Show(validationResult, "WebElement data is not valid", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return;
            }

            if (IsEditMode)
            {
                WebElementsViewModelsHelper.FillModelWithBaseInfo(SourceWebElement, WebElement);
                WebElementsViewModelsHelper.UpdateAllReferences(WebElements, SourceWebElement);
                WebElement = SourceWebElement;
            }

            SourceWebElement = null;
            DialogResult     = true;
            Close();
        }