public WebElementCreateEditDialog(Func <WebElementInfoViewModel, string> validate, WebElementInfoViewModel webElement) { _validate = validate; if (webElement == null) { throw new ArgumentNullException(nameof(webElement)); } IsEditMode = true; Title = $"Edit WebElement: {webElement.Name}"; SourceWebElement = webElement; WebElement = WebElementsViewModelsHelper.CreateModelCopyWithBaseInfo(webElement); WebElement.Parent = webElement.Parent; InitializeComponent(); DataContext = this; }