本文整理汇总了C#中System.Windows.Controls.ValidationErrorEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ValidationErrorEventArgs类的具体用法?C# ValidationErrorEventArgs怎么用?C# ValidationErrorEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValidationErrorEventArgs类属于System.Windows.Controls命名空间,在下文中一共展示了ValidationErrorEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PhoneApplicationPage_BindingValidationError
private void PhoneApplicationPage_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
MessageBox.Show(e.Error.Exception.Message, "Error", MessageBoxButton.OK);
}
}
示例2: OnValidationError
/// <summary>
/// プレゼン用 テキストボックスのバリデーションエラーを捕まえることができる
/// </summary>
/// <param name="sender">送信オブジェクト</param>
/// <param name="e">バリデーションエラーに関するパラメータ</param>
private void OnValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
// バリデーションエラーが発生したときの処理を追加できます
}
}
示例3: ValidationError
private void ValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
MessageBox.Show(e.Error.ErrorContent.ToString());
}
}
示例4: UIStaff_BindingValidationError
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void UIStaff_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
hasError = true;
else if (e.Action == ValidationErrorEventAction.Removed)
hasError = false;
}
示例5: EntityValidationError
public void EntityValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
EntityErrorCount++;
else if (EntityErrorCount > 0)
EntityErrorCount--;
}
示例6: Validation_Error
private void Validation_Error(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
_errors++;
else
_errors--;
}
示例7: grdConfig_ValidationError
private void grdConfig_ValidationError(object sender, ValidationErrorEventArgs e) {
if (e.Action == ValidationErrorEventAction.Added)
_validationErrors.Add(e.Error);
else
_validationErrors.Remove(e.Error);
btSave.IsEnabled = _validationErrors.Count == 0;
}
示例8: Validation_Error
private void Validation_Error(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
_noOfErrorsOnScreen++;
else
_noOfErrorsOnScreen--;
}
示例9: CheckEntityListError
public static void CheckEntityListError(ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
EntityListErrorCount++;
else if (EntityListErrorCount > 0)
EntityListErrorCount--;
}
示例10: validationError
/// <summary>
/// 使用数据验证后,对数据进行验证
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private static void validationError(object sender, ValidationErrorEventArgs args)
{
if ((sender as FrameworkElement).DataContext != null && (sender as FrameworkElement).DataContext as IDataValidationInfo != null)
{
IDataValidationInfo dataValition = (sender as FrameworkElement).DataContext as IDataValidationInfo;
bool isSuccess = (bool)((args.OriginalSource as FrameworkElement).GetValue(Validation.HasErrorProperty));
Binding bind = ((System.Windows.Data.BindingExpression)((System.Windows.Controls.ValidationError)args.Error).BindingInError).ParentBinding;
if (bind != null)
{
string propetyName;
if (bind.Source != null)
{
propetyName = bind.Path.Path + "@" + bind.Source.GetHashCode();
}
else
{
propetyName = bind.Path.Path + "@" + (sender as FrameworkElement).DataContext.GetHashCode();
}
if (isSuccess && args.Action == ValidationErrorEventAction.Added)
{
dataValition.Added(propetyName, args.Error.ErrorContent);
}
else if (!isSuccess && args.Action == ValidationErrorEventAction.Removed)
{
dataValition.Removed(propetyName);
}
}
}
}
示例11: ControlsPanel_BindingValidationError
/// <summary>
/// Shows the errors in a message box if any
/// </summary>
private void ControlsPanel_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
hasErrors = true;
MessageBox.Show(e.Error.ErrorContent.ToString());
}
}
示例12: Validation_Error
private void Validation_Error(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
errorCount++;
if (e.Action == ValidationErrorEventAction.Removed)
errorCount--;
if (this.ok != null)
this.ok.IsEnabled = (errorCount == 0);
}
示例13: SurNameTextBox_Error
private void SurNameTextBox_Error(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
System.Console.Beep();
MessageBox.Show(e.Error.ErrorContent.ToString());
}
else
System.Diagnostics.Trace.WriteLine("Validation error cleared");
}
示例14: txt_Error
private void txt_Error(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
((Control)sender).ToolTip = e.Error.ErrorContent.ToString();
}
else
{
((Control)sender).ToolTip = "";
}
}
示例15: Element_ValidationError
private void Element_ValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added && !_errorMessages.Contains(e.Error.ErrorContent.ToString()))
{
_errorMessages.Add(e.Error.ErrorContent.ToString());
}
else if (e.Action == ValidationErrorEventAction.Removed && _errorMessages.Contains(e.Error.ErrorContent.ToString()))
{
_errorMessages.Remove(e.Error.ErrorContent.ToString());
}
}