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
399
XamDateTimeEditor - How XamDateTimeEditor can override application level TextBlock style?
posted

1.I have written to application-level TextBlock style in App.xaml.

like this.

<Application x:Class="XamDateTimeEditorSample.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="Window1.xaml">
    <Application.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="Foreground" Value="Red" />
            <Setter Property="FontFamily" Value="Arial" />
            <Setter Property="FontSize" Value="10" />
        </Style>
    </Application.Resources>
</Application>

2.I was placed XamDateTimeEditor control on window.
(In the hope that it overrides the style has been described ...)

<Window x:Class="XamDataGridWork.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:igEditors="http://infragistics.com/Editors"
        Title="Window1" Height="100" Width="300" >
   
    <Grid x:Name="LayoutRoot">
        <igEditors:XamDateTimeEditor Name="xamDateTimeEditor1" VerticalAlignment="Top">
            <igEditors:XamDateTimeEditor.Resources>
                <Style TargetType="{x:Type TextBlock}">
                    <Setter Property="FontSize" Value="30"/>
                    <Setter Property="FontWeight" Value="Bold" />
                    <Setter Property="Foreground" Value="Blue" />
                </Style>
            </igEditors:XamDateTimeEditor.Resources>
        </igEditors:XamDateTimeEditor>
    </Grid>
</Window>

I build and run this project.but TextBlock style could not be overridden...

I found a case similar in the forums.

[Odd problem with inheriting styles]
http://community.infragistics.com/forums/p/19098/74050.aspx#74050

I'm still looking for a solution to this problem. but still not resolved.

help please


Sincerely,
Yung Emary