UWP - CalendarDatePicker example

MainPage.xaml

<Page
    x:Class="UniversalAppTutorials.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UniversalAppTutorials"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <StackPanel 
        x:Name="stack_panel1" 
        Orientation="Vertical"
        Background="AntiqueWhite"
        Padding="50,175,50,25"
        >
        <CalendarDatePicker
            x:Name="CalendarDatePicker1"
            Header="Select A Date"
            DateChanged="CalendarDatePicker1_DateChanged"
            />
        <TextBlock
            x:Name="TextBlock1"
            Foreground="DarkBlue"
            FontSize="21"
            TextWrapping="Wrap"
            FontFamily="Consolas"
            Margin="20"
            />
    </StackPanel>
</Page>
MainPage.xaml.cs

using Windows.UI.Xaml.Controls;


namespace UniversalAppTutorials
{
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        private void CalendarDatePicker1_DateChanged(CalendarDatePicker sender, CalendarDatePickerDateChangedEventArgs args)
        {
            // Get the instance of CalendarDatePicker object
            CalendarDatePicker calendarDatePicker = sender as CalendarDatePicker;

            // Get the CalendarDatePicker selected date
            TextBlock1.Text = "" + calendarDatePicker.Date;

            // Format CalendarDatePicker selected date using ToString method.
            TextBlock1.Text += "\nShort date: " + calendarDatePicker.Date.Value.ToString("d");
            TextBlock1.Text += "\nLong date: " + calendarDatePicker.Date.Value.ToString("D");
            TextBlock1.Text += "\nFull date and short time: " + calendarDatePicker.Date.Value.ToString("f");
            TextBlock1.Text += "\nFull date and long time: " + calendarDatePicker.Date.Value.ToString("F");
            TextBlock1.Text += "\nGeneral date time (short time): " + calendarDatePicker.Date.Value.ToString("g");
            TextBlock1.Text += "\nGeneral date time (long time): " + calendarDatePicker.Date.Value.ToString("G");
            TextBlock1.Text += "\nMonth pattern: " + calendarDatePicker.Date.Value.ToString("M");
            TextBlock1.Text += "\nYear pattern: " + calendarDatePicker.Date.Value.ToString("Y");
        }
    }
}