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
95
XamDateTimeInput Metro Style
posted

I'm trying to override the font for the XamDateTimeInput control

What is the correct style to base on?

For Numeric Editor, i can do this.

<Style TargetType="{x:Type editors:XamNumericEditor}" BasedOn="{x:Static igThemes:EditorsMetro.XamNumericEditor}">

</Style>

But i cannot locate under XamDateTimeInput igThemes:EditorsMetro

  • 2155
    Offline posted

    Hello Anthony,

    One way to override XamDateTimeInput style when a theme is used is to define a style with BasedOn="{StaticResource {x:Type ig:XamDateTimeInput}}" and assign it the control's Style property.

    ----------------
                <Style x:Key="myDateTimeInput" TargetType="{x:Type ig:XamDateTimeInput}" BasedOn="{StaticResource {x:Type ig:XamDateTimeInput}}">
                    <Setter Property="Foreground" Value="Red"/>
                </Style>
    ...
            <ig:XamDateTimeInput Style="{StaticResource myDateTimeInput}">
            </ig:XamDateTimeInput>
    ----------------


    I have created a sample of XamDateTimeInput that demonstrates the above approach.XamDateTimeInput.zip