760
XamDateTimePicker text color
posted

Hi,

How can I change the text color of a disabled XamDateTimePicker?

Currently trying this without any luck

 <Style TargetType="editors:XamDateTimeInput">
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="igPrim:MaskedInputTextBox.Foreground" Value="Black"/>
            </Trigger>
        </Style.Triggers>

Thank you

  • 27540
    Verified Answer
    Offline posted

    Hello PMac,

    I have been investigating into this behavior that you are seeing, and I would expect that the Trigger that you are using should work in this case if you simply target the "Foreground" property rather than the "igPrim:MaskedInputTextBox.Foreground" property. Although, I would expect that the setter that you have in that Trigger should work as well.

    Out of curiosity, have you explicitly set the Foreground property on your XamDateTimeInput? If so, that property will "win" and the trigger will be ignored in this case. If you add a setter for the Foreground property in the Style instead, you will be able to see your Trigger respected.

    I am attaching a sample project that demonstrates usage of the IsEnabled foreground trigger in the XamDateTimeInput.

    Please let me know if you have any other questions or concerns on this matter.

    XamDateTimeInputDisabledForeground.zip