Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3806
XamNumericEditor- changing mask property in style does not work
posted

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>

Parents
  • 54937
    Verified Answer
    Offline posted

    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.

Reply Children
No Data