Hello I want to set the forground of the numeric editor to a specific color if the control is disabled. I tried to apply the following style without success:
<Style TargetType="infragisticsWPF:XamNumericEditor"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="Magenta" /> </Trigger> <Trigger Property="IsEnabled" Value="True"> <Setter Property="Foreground" Value="Lime" /> </Trigger> </Style.Triggers></Style>
Could you please provide information how to achiev this in the simplest way.
Thank you very much!
Hello rajaka,
Thank you for the code-snippet you have provided.
I tested the behavior you have mentioned in regards to the non-applying Foreground with the same code-snippet you have used and I was not able to reproduce the issue. Would you please modify the sample I have attached, so the issue is reproduced and send it back to me? Having this information will help me further investigate this matter for you.
You can always set an initial Foreground that should be used, instead of using another trigger for when the IsEnabled property is True. For example:
<Style TargetType="igEditors:XamNumericEditor"> <Setter Property="Foreground" Value="Lime" /> // Default background. (IsEnabled = True) <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="Magenta" /> // Change background if IsEnabled = False. </Trigger> </Style.Triggers></Style>
If you have any questions, please let me know.