Introduction
In this article I will explain how to create and use the calendar class and functions. In this article I made a Windows 8 app using some calendar functions, which shows the current date, week and name of the day of a current month. Also some functions are provided so we can display the current year and current month of the current year etc. By using the calendar function we can create the calendar class first, and use it which resides in the Windows.Globalization namespace. To see how this works let's use the following steps.
Step 1
First open the Visual Studio 2012 RC and click on File -> New -> Project. A window is shown; select Windows Store in Visual C# from the left pane and Blank page from the center pane as in:
Step 2
In the MainPage.xaml file write the code as:
<Page
x:Class="App10.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App10"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black"/>
<GradientStop Color="#FFF99AE8" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<TextBlock Text="Calender Examples" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Top"/>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Select any options" FontSize="15" Margin="50,150,0,0"/>
<TextBlock Name="Description" FontSize="20" Margin="350,150,0,0" Width="650" Height="50"/>
</StackPanel>
<ListBox x:Name="list1" Height="250" Width="500" HorizontalAlignment="Left" Margin="50" SelectionChanged="list1_SelectionChanged" Background="#CCB6EECA">
<x:String>Display The Calender Type</x:String>
<x:String>Display the Month of this Year</x:String>
<x:String>Display the year</x:String>
<x:String>Display the Day of this month</x:String>







Join the conversation! Your thoughts help the community grow.