none
How to merge single binding validationrule errors to bindinggroup? RRS feed

  • Question

  • 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?


    Thursday, April 2, 2020 2:31 AM

All replies