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
3220
xamNumericEditor styles
posted

Hello,

I use a lot of xamNumericEditor controls, with always the same properties. e.g.

  • TrimFractionalZeros="True"
  • Mask="{}{double:9.4}"
  • PromptChar=""

Is there a way to specifiey style or new control, with that properties and then always use that style or property? I don't want to specify these property for every control.

I already tried to create a style, but then all my DarkMetroTheme styles are lost on that control.

<Style x:Key="styleDecimalInput" TargetType="{x:Type igEditors:XamNumericEditor}">
            <Setter Property="Mask" Value="{}{double:-9.4}"/>
            <Setter Property="PromptChar" Value=""/>
            <Setter Property="TrimFractionalZeros" Value="True"/>
        </Style>

  • 18204
    Verified Answer
    Offline posted

    Hello Markus,

    Thank you for posting in our forums!

    You should set the BasedOn property of your style to the MetroDark theme.  Then your style can derive off of the MetroDark style and apply to all of the XamNumericEditors.

    See below for a code snippet of how to achieve this.

    <Window
        xmlns:igTheme="http://infragistics.com/Themes">
        <Window.Resources>
            <Style TargetType="{x:Type igEditors:XamNumericEditor}" BasedOn="{x:Static igTheme:EditorsMetroDark.XamNumericEditor}">
                ...
            </Style>

    If you have any further questions or concerns with this, please let me know.


    Sincerely,
    Michael H.
    Software Developer
    Infragistics, Inc.
    www.infragistics.com/support