How to merge single binding validationrule errors to bindinggroup?

  • Thread starter Thread starter 飞羽流星
  • Start date Start date

飞羽流星

Guest
Example:

<Grid>
<Grid.BindingGroup>
<BindingGroup x:Name="Group"/>
</Grid.BindingGroup>
<TextBox>
<TextBox.Text>
<Binding Path="Name">
<Binding.ValidationRules>
<rules:MyCustomCommonRule BindingGroupName="Group"/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
<TextBox Text="{Binding Name2}"/>
<Button Content="Commit"
IsEnabled="{Binding ElementName=Group,
Path=HasValidationError,
Converter={StaticResource NotConverter}}"/>
</Grid>


If MyCustomCommonRule has return validation error, how to make the button disabled?

Continue reading...
 

Similar threads

Back
Top