本文整理汇总了C#中System.Windows.Controls.ValidationErrorEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ValidationErrorEventArgs类的具体用法?C# ValidationErrorEventArgs怎么用?C# ValidationErrorEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValidationErrorEventArgs类属于System.Windows.Controls命名空间,在下文中一共展示了ValidationErrorEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:gibratim,项目名称:converter,代码行数:7,代码来源:MainPage.xaml.cs
示例2: OnValidationError
/// <summary>
/// プレゼン用 テキストボックスのバリデーションエラーを捕まえることができる
/// </summary>
/// <param name="sender">送信オブジェクト</param>
/// <param name="e">バリデーションエラーに関するパラメータ</param>
private void OnValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
// バリデーションエラーが発生したときの処理を追加できます
}
}
开发者ID:ryudo,项目名称:TextBoxValidationTutorial,代码行数:12,代码来源:MainWindow.xaml.cs
示例3: ValidationError
private void ValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
MessageBox.Show(e.Error.ErrorContent.ToString());
}
}
开发者ID:FruityBrew,项目名称:SpaceDoctor,代码行数:7,代码来源:MainWindow.xaml.cs
示例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;
}
开发者ID:sajidk,项目名称:Estimate-SL,代码行数:12,代码来源:UIStaff.xaml.cs
示例5: EntityValidationError
public void EntityValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
EntityErrorCount++;
else if (EntityErrorCount > 0)
EntityErrorCount--;
}
开发者ID:kstuDss,项目名称:DecisionSupportSystem,代码行数:7,代码来源:ErrorCatcher.cs
示例6: Validation_Error
private void Validation_Error(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
_errors++;
else
_errors--;
}
开发者ID:taksun,项目名称:WPF,代码行数:7,代码来源:dane_klienta.xaml.cs
示例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;
}
开发者ID:beebopfr,项目名称:srtg,代码行数:7,代码来源:SettingsWindow.xaml.cs
示例8: Validation_Error
private void Validation_Error(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
_noOfErrorsOnScreen++;
else
_noOfErrorsOnScreen--;
}
开发者ID:wolverine169,项目名称:BikeWareHouse,代码行数:7,代码来源:AddUserWindow.xaml.cs
示例9: CheckEntityListError
public static void CheckEntityListError(ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
EntityListErrorCount++;
else if (EntityListErrorCount > 0)
EntityListErrorCount--;
}
开发者ID:kstuDss,项目名称:DecisionSupportSystem,代码行数:7,代码来源:ErrorCount.cs
示例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);
}
}
}
}
开发者ID:wangjianglin,项目名称:dotnet-core,代码行数:37,代码来源:Validations.cs
示例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());
}
}
开发者ID:Nithanaroy,项目名称:medicines-catalogue,代码行数:11,代码来源:Settings.xaml.cs
示例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);
}
开发者ID:hungdluit,项目名称:sipserver,代码行数:10,代码来源:OkEnabler.cs
示例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");
}
开发者ID:KutsyndaPavlo,项目名称:Exam_70-511_Test_samples,代码行数:10,代码来源:DataGridExampleView.xaml.cs
示例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 = "";
}
}
开发者ID:mwolfaardt,项目名称:bulkimagechanger,代码行数:11,代码来源:CrmAuthenticationView.xaml.cs
示例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());
}
}
开发者ID:smallcube,项目名称:EHealthCarePatientApp,代码行数:11,代码来源:ValidationSummary.xaml.cs
示例16: MainPage_BindingValidationError
void MainPage_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
// If the app is running outside of the debugger then report the exception using a ChildWindow control.
if (!System.Diagnostics.Debugger.IsAttached)
{
// NOTE: This will allow the application to continue running after an exception has been thrown but not handled.
// For production applications this error handling should be replaced with something that will report the error to the website and stop the application.
e.Handled = true;
ErrorWindow.CreateNew(e.ToString());
}
}
开发者ID:densem-2013,项目名称:RssWCF,代码行数:11,代码来源:MainPage.xaml.cs
示例17: TextBox_Error
private void TextBox_Error(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
_errors++;
}
else
{
_errors--;
}
}
开发者ID:jsyoon64,项目名称:stylesamples,代码行数:11,代码来源:MainWindow.xaml.cs
示例18: ScopeElement_BindingValidationError
private void ScopeElement_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Removed)
{
Errors.Remove(e.Error);
}
else if (e.Action == ValidationErrorEventAction.Added)
{
Errors.Add(e.Error);
}
}
开发者ID:JuRogn,项目名称:OA,代码行数:11,代码来源:ValidationScope.cs
示例19: TextBox_BindingValidationError
private void TextBox_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
userNameTextBox.Background = new SolidColorBrush(Colors.Red);
}
else if (e.Action == ValidationErrorEventAction.Removed)
{
userNameTextBox.Background = new SolidColorBrush(Colors.White);
}
}
开发者ID:crima,项目名称:MsTechSilverlightGuessGame,代码行数:11,代码来源:Login.xaml.cs
示例20: ContentPanel_BindingValidationError
private void ContentPanel_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
TextBox temp = (TextBox)sender;
if (e.Action == ValidationErrorEventAction.Added)
{
temp.Background = new SolidColorBrush(Colors.Red);
}
else
{
temp.Background = new SolidColorBrush(Colors.White);
}
}
开发者ID:B8li,项目名称:gRoute,代码行数:12,代码来源:MainPage.xaml.cs
注:本文中的System.Windows.Controls.ValidationErrorEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论