mirror of https://github.com/AMT-Cheif/Stylet.git
Change capitalisation of ValidationModeBase.AutoValidate
This commit is contained in:
parent
d9db561494
commit
9532f3eca1
|
@ -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>
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue