locked
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

  • Consider asking your question here

    https://docs.microsoft.com/answers/topics/wpf.html


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, April 2, 2020 2:44 AM