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
640
How to create a control template for an Editor that will automatically apply
posted

I created a control template as I have with the standard controls, but when creating a control template for the xamNumericEditor, it is not applying. See below:

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:igEditors="http://infragistics.com/Editors" >

    <!-- SimpleStyles: TextBox -->
    <Style TargetType="{x:Type igEditors:XamNumericEditor}">      
        <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type igEditors:XamNumericEditor}">                      <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="White"/>
                            <Setter Property="BorderBrush" Value="White"/>
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

I am just trying to create a label effect when the IsEnabled property equals false.  Please advise

Parents
No Data
Reply
  • 69686
    Verified Answer
    posted

    Hello,

    Actually, you do not need to create control template triggers. You can use the Style Triggers and not have to retemplate the Template:<Style TargetType="{x:Type igEditors:XamNumericEditor}">

                <Style.Triggers>

                    <Trigger Property="IsEnabled" Value="False">

                        <Setter Property="Background" Value="White"/>

                        <Setter Property="BorderBrush" Value="White"/>

                        <Setter Property="Foreground" Value="Black"/>

                    </Trigger>

                </Style.Triggers>

            </Style>

    However, you can see the default styles for the ValueEditors in the DefaultStyles directory in the Infragistis folder.

    Hope this helps

Children
No Data