Group validation

This example demonstrates a login validation. Either the user can login by username and password or by OpenId.
group.Add(new ValidationGroup(
    new ValidationItem(new AlnumValidator(false), txtUsername, TextBox.TextProperty),
    new ValidationItem(new NotEmptyValidator(), txtPassword, TextBox.TextProperty)
));

// or 

group.Add(new ValidationGroup(
   new ValidationItem(new NotEmptyValidator(), txtOpenId, TextBox.TextProperty),
   new ValidationItem(new EmailAddressValidator(), txtOpenId, TextBox.TextProperty)
), ValidationGroupMode.Or);

login.png

Last edited Feb 1, 2009 at 2:58 PM by twenzel, version 2

Comments

No comments yet.