protected void EndChangingDynamicItem() { Validation.ClearInvalid(CloneTextBox.GetBindingExpression(TextBox.TextProperty)); if (ErrorToolTip != null) { ErrorToolTip.IsOpen = false; ErrorToolTip = null; } Binding = null; RemoveDynamicControls(); DisposeDynamicItems(); }
protected virtual void OnValidate() { if (Binding == null) { Binding = CloneTextBox.GetBindingExpression(TextBox.TextProperty); } IsValid = IsValidName(); if (!IsValid) { Validation.MarkInvalid(Binding, new ValidationError(new ExceptionValidationRule(), Binding)); if (ErrorToolTip == null) { ErrorToolTip = new ToolTip { Content = TextRedactor.PathErrorMessage }; CloneTextBox.ToolTip = ErrorToolTip; } ErrorToolTip.IsOpen = true; } }
protected override void OnValidate() { if (!Notes.ContainsKey(CloneTextBox.Tag.ToString()) || Notes.ContainsKey(CloneTextBox.Text) || !File.Exists(ParentControl.BrowseProject.LoadedFile)) { IsValid = false; if (Binding == null) { Binding = CloneTextBox.GetBindingExpression(TextBox.TextProperty); } Validation.MarkInvalid(Binding, new ValidationError(new ExceptionValidationRule(), Binding)); if (ErrorToolTip == null) { ErrorToolTip = new ToolTip { Content = TextRedactor.PathErrorMessage }; CloneTextBox.ToolTip = ErrorToolTip; } ErrorToolTip.IsOpen = true; } else { IsValid = true; } }