Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            DataContext = new ViewModel.VMMain();

            //var p = new Personne { Prenom="Jean-Pierre", Nom = "Lebon" };
            //var context = new ValidationContext(p, null, null);
            //var results = new List<System.ComponentModel.DataAnnotations.ValidationResult>();

            //// Validation de propriété
            ////context.MemberName = "FirstName";
            ////bool res = Validator.TryValidateProperty(p.FirstName, context,results);

            //// Validation d'instance
            //bool res = Validator.TryValidateObject(p, context, results, true);
        }
Ejemplo n.º 2
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new ViewModel.VMMain();
 }