You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using ReactiveUI;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace UserInterface.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public class ViewModelBase : ReactiveObject
|
|
|
|
|
{
|
|
|
|
|
public bool IsValid<T>(T obj, out ICollection<ValidationResult> results)
|
|
|
|
|
{
|
|
|
|
|
results = new List<ValidationResult>();
|
|
|
|
|
|
|
|
|
|
return Validator.TryValidateObject(obj, new ValidationContext(obj), results, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|