C# 突出显示WinRTXamlToolkit.Controls.Calendar上的天数

C# 突出显示WinRTXamlToolkit.Controls.Calendar上的天数,c#,xaml,windows-runtime,windows-phone-8.1,winrt-xaml-toolkit,C#,Xaml,Windows Runtime,Windows Phone 8.1,Winrt Xaml Toolkit,我写了一个WindowsPhone8.1(WINRT)应用程序。我需要在页面中显示日历,突出显示假日等日子。因此,我从nuget添加了WinRT XAML工具包-日历控件 尝试将日历控件放置在Viewbox控件中,它将根据Viewbox控件提供的宽度和高度自动调整控件 <Viewbox Width="300" Height="300"> <WinRT:Calendar x:Name="ActivityCalender" Style="{StaticRe

我写了一个WindowsPhone8.1(WINRT)应用程序。我需要在页面中显示日历,突出显示假日等日子。因此,我从nuget添加了WinRT XAML工具包-日历控件


尝试将日历控件放置在Viewbox控件中,它将根据Viewbox控件提供的宽度和高度自动调整控件

<Viewbox Width="300" Height="300">
            <WinRT:Calendar  x:Name="ActivityCalender" Style="{StaticResource CalendarStyle2}" FontSize="36" FontWeight="Normal" Padding="0" CalendarDayButtonStyle="{StaticResource CalendarButtonCustom}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</Viewbox>

完成后,您可以从下面的链接下载样式代码。

您将获得下图下方的输出链接。您还可以在样式中进行自定义。

<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" x:Name="ActivityCalender">

        </WinRT:Calendar>
    </Grid>
</Page>
ActivityCalender.SelectedDate = new DateTime(2015, 6, 21);
<Viewbox Width="300" Height="300">
            <WinRT:Calendar  x:Name="ActivityCalender" Style="{StaticResource CalendarStyle2}" FontSize="36" FontWeight="Normal" Padding="0" CalendarDayButtonStyle="{StaticResource CalendarButtonCustom}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</Viewbox>