MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
ValidationAssist.Suppress does not affect textbox underline
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 16.3k
- Forks
- 3.5k
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 8
Descripción
I am using the following style to suppress validation on disabled textboxes.
<Style x:Key="DefaultTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignTextBox}">
<Style.Triggers>
<!-- Remove the errors when the control is disabled. -->
<Trigger Property="IsEnabled" Value="False">
<Setter Property="materialDesign:ValidationAssist.Suppress" Value="True"/>
<!--<Setter Property="BorderBrush" Value="{StaticResource MaterialDesignTextBoxBorder}"/>-->
</Trigger>
</Style.Triggers>
</Style>
Here is the result of that:

The red underline is still applied to the disabled textbox. The Error text is correctly hidden.
I worked around this by using the commented out setter for the BorderBrush. This is mostly just to make the behavior consistent with other controls. The Combobox does not require the workaround. I haven't tested any other controls either so it may be worth checking each one.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza reproduciendo el estilo XAML proporcionado con un TextBox deshabilitado que tenga un error de validación y, después, compara su estilo de validación con el comportamiento de ComboBox. Rastrea la plantilla o el estilo de validación de TextBox y verifica que suprimir la validación también elimine el subrayado rojo, manteniendo al mismo tiempo el texto de error oculto.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- desktop
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100