飞
飞羽流星
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...
<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...