private void bgworker_ProgressChanged(object sender, ProgressChangedEventArgs args)
        {
            if (args.UserState != null && args.UserState is ValidationResultEventArgs)
            {
                ValidationResultEventArgs e = args.UserState as ValidationResultEventArgs;
                ListViewItem item           = new ListViewItem(new string[] { e.Name, e.Type, e.Message, e.ResultValue.ToString() });
                switch (e.ResultValue)
                {
                case ValidationResultValue.Invalid:
                    item.BackColor           = Color.IndianRed;
                    this.hasValidationErrors = true;
                    break;

                case ValidationResultValue.Caution:
                    item.BackColor           = Color.Yellow;
                    this.hasValidationErrors = true;
                    break;

                case ValidationResultValue.CrossDatabaseJoin:
                    item.BackColor           = Color.Beige;
                    this.hasValidationErrors = true;
                    break;

                case ValidationResultValue.Valid:
                    item.BackColor = Color.White;
                    break;
                }
                lstResults.Items.Insert(0, item);
            }
        }
Exemplo n.º 2
0
 private void ValidationTriggered(ValidationResultEventArgs eventArgs)
 {
     IsValid = eventArgs.Errors.IsNullOrEmpty();
 }
Exemplo n.º 3
0
 private void OnValidationTriggered(ViewModel.ViewModel viewModel, ValidationResultEventArgs eventArgs)
 {
     ValidationTriggeredCommand?.Execute(eventArgs);
 }