Hello,
I have a XamNumericEditor, the field is optional so I want to restyle the IsEnable trigger.
Please find my style attached.
I don't manage to see the field in red when the field is disable.
Could you please help me ?
Regards
Hello teamtim,
Thank you for your post!
I have been investigating into this issue, and I have created a sample project that uses the exact sample resource dictionary that you have attached, but I cannot seem to reproduce the behavior you are seeing. I have attached the sample project I used to test this. Please test this on your machine, as the resultant behavior may help to further indicate the nature of this issue. Also, my test was made using version 15.1.20151.2055 in Infragistics for WPF 2015 Volume 1. Does this version match the version you are using?
There are a couple of other questions that I have for you on this matter as well, regarding the disabled field that you are hoping to see in red in this case. First, are you applying any other styles to it, such as a separate EditorStyle or a CellValuePresenterStyle? Second, have you verified that this field is indeed using a XamNumericEditor as its editor? You can fully ensure that this is the case by setting the EditorType property on your field to {x:Type igEdit:XamNumericEditor}.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks for your sample. After analysis with my coworkers, we will use the field only one time.
So I made a custom style in xaml :
<editors:XamNumericEditor Mask="{}{number:0-255}.{number:0-255}.{number:0-255}.{number:0-255}" ValueType="{x:Type sys:String}" Value="{Binding Text}"> <editors:XamNumericEditor.Resources> <Style TargetType="{x:Type editors:XamNumericEditor}"> <Setter Property="PromptChar" Value=" "/> <Setter Property="HorizontalContentAlignment" Value="Left"/> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="{StaticResource LightGrayBrush}" /> <Setter Property="Background" Value="{StaticResource WhiteBrush}" /> </Trigger> </Style.Triggers> </Style> </editors:XamNumericEditor.Resources> </editors:XamNumericEditor>
It's working, and that enough for our use.
Thanks for your help