In this article I am going to explain how you can check to determine if a specified year is a leap year or not. This article is created as a Window Store App in C# that determines whether a year is a leap year. For implementing this application I am using a simple XAML textbox that accepts the year in the form of input and a button to implement the BL logic.
To create the app use the following intructions.
Step 1
First of all you have to create a New Window Store Application.
- Open Visual Studio 2012
- "File" -> "New" -> "Project..."
- Choose "Template" -> "Visual C#" -> "Windows Store app" -> "Blank App (XAML)"
- Rename the application

Step 2
Now the project will be opened. Go into Solution Explorer and choose "MainPage.Xaml" for designing and "MainPage.Xaml.cs" to write the business logic.

Step 3
Write the following simple code in "MainPage.Xaml":
<Page
x:Class="App5.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App5"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="Blue">
<Grid.RowDefinitions>
<RowDefinition Height="0*"/>
<RowDefinition Height="46*"/>
<RowDefinition Height="73*"/>
<RowDefinition Height="64*"/>
<RowDefinition Height="60*"/>
<RowDefinition Height="474*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="167*"/>
<ColumnDefinition Width="593*"/>
<ColumnDefinition Width="606*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Do you want to know Wether year is leap year or not " FontSize="20" FontFamily="Arial" FontWeight="ExtraBold" Foreground="Red" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="3" ></TextBlock>
<TextBlock Text="Enter year:" FontFamily=" Arial" FontSize="20" FontWeight="ExtraBold" Grid.Column="1" Grid.Row="2" Foreground="Red" HorizontalAlignment="Left" Width="181" Margin="76,10,0,36" />


Join the conversation! Your thoughts help the community grow.