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
195
Odd problem with inheriting styles
posted

I have a global textblock style set at the app level so all textblocks will inherit the style (unless overridden).

 I also have a style for the xamDataGrid header row for background etc. When I set the foreground, font size, etc it is not taking but is taking the app level textblock style. How can I stop infragistics wpf controls from doing this? Having same issue now with xamMaskedEditor.

 Hope that makes since.

 

<StackPanel>
        <StackPanel.Resources>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize"
                        Value="22" />
                <Setter Property="Foreground"
                        Value="Red" />
            </Style>
        </StackPanel.Resources>

        <igEditors:XamMaskedEditor Text="37128"
                                   Mask="nnnnn">
            <igEditors:XamMaskedEditor.Style>
                <Style TargetType="{x:Type igEditors:XamMaskedEditor}">
                    <Setter Property="Foreground"
                            Value="Blue" />
                </Style>
            </igEditors:XamMaskedEditor.Style>
        </igEditors:XamMaskedEditor>
        <TextBlock Text="This is a test" />
        <TextBlock Text="This is a test overiding inherited style">
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}">
                    <Setter Property="Foreground"
                            Value="Blue" />
                </Style>
            </TextBlock.Style>
        </TextBlock>

    </StackPanel>

Parents
No Data
Reply Children