I have a TextBox that is defined through a ControlTemplate. Due to the ControlTemplate, the text field is no longer grayed out if the IsEnabled-false property is set to false.
To provide this functionality, I use the following trigger in the ControlTemplate:
<Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="{x:Static SystemColors.GrayTextBrush}" /> </Trigger>
It works great. However, I must install BackgroundColor as well, but I did not find the corresponding entry in SystemColors . Which entry is the correct entry for the background of disabled controls (TextBoxes)? Is there any other source besides SystemColors?
I do not want to use a fixed value. for example, setting Background="#f4f4f4" , because I'm afraid that in some environments disabled-background has a different meaning, and then my control does not look like it should or even cannot be read (if, for example, the value of GrayTextBrush is next to C # f4).
HCL
source share