I have more than one TextBox. I want to change the underlines depending on special circumstances. I'm using the MaterialDesign style. I want to change the underline of the TextBox. It's a feasible situation in XAML, but how can I do it in code-behind? TextboxName.Underline cannot be found.
My xaml code
<TextBox x:Name="Pulse2" Style="{StaticResource MaterialDesignFloatingHintTextBox}" VerticalAlignment="Top" HorizontalAlignment="Left"
Foreground="{Binding Foreground, ElementName=CardID}" Height="43" Width="132" IsReadOnly="True"
materialDesign:TextFieldAssist.UnderlineBrush="{Binding Background, ElementName=HaltButton}"
materialDesign:HintAssist.Foreground="#244886"
AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"
materialDesign:HintAssist.Hint="Pulse2" Margin="281,136,0,0"/>
Not Found
Pulse.Underline !!!