0

I wrote a Windows Phone 8.1 (WINRT) App. I need to show Calendar in the page. So, I added WinRT XAML Toolkit - Calendar Control from nuget.

PM> Install-Package WinRTXamlToolkit.Controls.Calendar

<Page
x:Class="DrFit.Pages.ActivityTimeTablePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DrFit.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:WinRT="using:WinRTXamlToolkit.Controls"
Background="Black">

    <Grid x:Name="LayoutRoot">       
        <WinRT:Calendar Height="500">

        </WinRT:Calendar>
    </Grid>
</Page>

How to Customise this Calendar control, example FontWeight,Foreground,Background?

Atif Shabeer
  • 553
  • 6
  • 18

2 Answers2

0

If the properties aren't exposed by the control or template-bound to template part properties - you'll probably need to change the template. You can find the default template here and templates for calendar parts are in the same folder:

WinRTXamlToolkit.Controls.Calendar/WinRTXamlToolkit.Controls.Calendar.Shared/Controls/Calendar

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100
  • I copied these four xamls and used these as ResourceDictionaries. I customised the font color of days, but I have sill some issues. The calendar control goes out of margin on right side of phone. Where to change grid so that it automatically adjusts according to page/frame width? – Atif Shabeer Jun 26 '15 at 12:26
  • Another question, I want to highlight some dates (for example, Holidays) by changing the color of their borders. Where shall I bring this color change in XAML? Highlighted dates should be in different color than a selected date. – Also, please tell me how to highlight these dates (for example, Holidays), which method to use ? – Atif Shabeer Jun 26 '15 at 14:08
0

You probably have figured out the answer to this but I was facing a similar problem and figured out a solution so I thought I'd post it here for anyone else who faces a similar conundrum. If the calendar control is going out of the page, you can wrap it inside a Viewbox so that it fits the screen. This is how I managed to do it.

<Viewbox Stretch="Uniform">
    <Grid Height="600" Width="600">
        <toolkit:Calendar HorizontalAlignment="Center" VerticalAlignment="Center" Tapped="Calendar_Tapped"/>
    </Grid>
</Viewbox>
thatrohit
  • 177
  • 8