I am trying to change the mask in style for XamNumericEditor, which is not working. How can I change the Mask in styles depending on my data trigger.Here is small sample to explain this issue.
<igEditors:XamNumericEditor x:Name="xamNumericEditor" Width="300" PromptChar="" Format="###,#" Mask="{}{double:20.2}"> <igEditors:XamNumericEditor.Style> <Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="Mask" Value="{}{double:10.2}" /> </Style> </igEditors:XamNumericEditor.Style> </igEditors:XamNumericEditor>
A Style setter has a lower precedence than a local value (i.e. the value you set directly on the element) so the style would not have any affect in the example you have provided. You can see the MS docs on Dependency Property Precedence for more information on that. If you want it to have some effect then do not set the Mask directly on the control and just set it in the setters and optionally override that in the triggers of the style.
Hi,
It looks like Andrew was very thorough but I was wondering if you had any further questions.
Please let me know if I can help.