Change capitalisation of ValidationModeBase.AutoValidate

This commit is contained in:
Antony Male 2014-08-02 17:54:15 +01:00
parent d9db561494
commit 9532f3eca1
4 changed files with 14 additions and 10 deletions

View File

@ -67,7 +67,7 @@
<Label Grid.Row="4" Grid.Column="0" Target="{Binding ElementName=PasswordConfirmation}">Password Confirmation:</Label>
<PasswordBox Grid.Row="4" Grid.Column="1" x:Name="PasswordConfirmation" xaml:Secure.Password="{Binding PasswordConfirmation}"/>
<CheckBox Grid.Row="5" Grid.Column="0" IsChecked="{Binding AutoValidate}">Auto-Validate</CheckBox>
<CheckBox Grid.Row="5" Grid.Column="0" IsChecked="{Binding ShouldAutoValidate}">Auto-Validate</CheckBox>
<Button Grid.Row="5" Grid.Column="1" Command="{s:Action Submit}" HorizontalAlignment="Left">Submit</Button>
</Grid>
</UserControl>

View File

@ -17,10 +17,14 @@ namespace Stylet.Samples.ModelValidation.Pages
public string PasswordConfirmation { get; set; }
public Stringable<int> Age { get; set; }
public bool AutoValidate
public bool ShouldAutoValidate
{
get { return this.autoValidate; }
set { this.autoValidate = value; this.NotifyOfPropertyChange(); }
get { return base.AutoValidate; }
set
{
base.AutoValidate = value;
this.NotifyOfPropertyChange();
}
}
public UserViewModel(IWindowManager windowManager, IModelValidator<UserViewModel> validator) : base(validator)
@ -37,7 +41,7 @@ namespace Stylet.Samples.ModelValidation.Pages
public bool CanSubmit
{
get { return !this.AutoValidate || !this.HasErrors; }
get { return !this.ShouldAutoValidate || !this.HasErrors; }
}
public void Submit()
{

View File

@ -43,14 +43,14 @@ namespace Stylet
/// <summary>
/// Whether to run validation for a property automatically every time that property changes
/// </summary>
protected bool autoValidate { get; set; }
protected bool AutoValidate { get; set; }
/// <summary>
/// Instantiate, without using an IValidatorAdapter
/// </summary>
public ValidatingModelBase()
{
this.autoValidate = true;
this.AutoValidate = true;
}
/// <summary>
@ -222,7 +222,7 @@ namespace Stylet
// Save ourselves a little bit of work every time HasErrors is fired as the result of
// the validation results changing.
if (this.validator != null && this.autoValidate && propertyName != "HasErrors")
if (this.validator != null && this.AutoValidate && propertyName != "HasErrors")
await this.ValidatePropertyAsync(propertyName);
}

View File

@ -27,8 +27,8 @@ namespace StyletUnitTests
public bool AutoValidate
{
get { return base.autoValidate; }
set { base.autoValidate = value; }
get { return base.AutoValidate; }
set { base.AutoValidate = value; }
}
public IModelValidator Validator