Changing style of the calendar

Dec 9, 2012 at 8:03 AM

I was wondering if any on has applied style to the calendar control.

I have tried few options but it does not seems to have any effect.

Here is the sample

 <Style x:Name="CalButtonStyle" TargetType="ControlsPrimitives:CalendarButton">
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF3E9CDC" Offset="0.29" />
                    <GradientStop Color="#FF9E2042" Offset="0.16" />
                    <GradientStop Color="#FFB8E817" Offset="0.16" />
                    <GradientStop Color="#FFCE25F3" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Name="CalDayButtonStyle" TargetType="ControlsPrimitives:CalendarDayButton">
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF3E9CDC" Offset="0.29" />
                    <GradientStop Color="#FF9E2042" Offset="0.16" />
                    <GradientStop Color="#FFB8E817" Offset="0.16" />
                    <GradientStop Color="#FFCE25F3" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Name="CalItemStyle" TargetType="ControlsPrimitives:CalendarItem">
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF3E9CDC" Offset="0.29" />
                    <GradientStop Color="#FF9E2042" Offset="0.16" />
                    <GradientStop Color="#FFB8E817" Offset="0.16" />
                    <GradientStop Color="#FFCE25F3" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style> 

------------------------------

In the XAMLfile

 <Controls:Calendar x:Name="calControl" CalendarDayButtonStyle="{StaticResource CalDayButtonStyle}" CalendarButtonStyle="{StaticResource CalButtonStyle}" CalendarItemStyle="{StaticResource CalItemStyle}"  />

 


Coordinator
Jun 14, 2013 at 3:43 PM
Hi,

I have merged this project with the WinRT XAML Toolkit at https://winrtxamltoolkit.codeplex.com/

It is also available on NuGet at http://nuget.org/packages/WinRTXamlToolkit.Controls.Calendar

I think changing Background should now work.

Thanks,
Filip
May 5, 2015 at 7:34 AM
please let know what is "ControlsPrimitives"?