Introduction
In this article I describe how to work with a class in a Windows Store app. In other words I bind the class. So let us understand the scenario.
Here I have added a class by right-clicking on the app name in Solution Explorer and create a class called employee and build it. Now add some controls to display the value to the class object.
So use the following procedure to create it.
Step 1
First of all you must create a new Windows Store Application.
- Open Visual Studio 2012
- "File" -> "New" -> "Project..."
- Choose "Template" -> "Visual C#" -> "Window Store app"
- Choose "Blank App (XAML)" then rename the application

Step 2
Now add a class by right-clicking on the name of the application in Solution Explorer and write the following simple code:
namespace binding_from_class
{
public class employee
{
public int id { get; set; }
public string name { get; set; }
public int salary { get; set; }
}
}
Step 3
Write the following XAML code in "Mainpage.Xaml" (that is available in Solution Explorer):
<Page
x:Class="binding_from_class.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:binding_from_class"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="Red">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="285*"/>
<ColumnDefinition Width="378*"/>
<ColumnDefinition Width="703*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="90*"/>
<RowDefinition Height="64*"/>
<RowDefinition Height="61*"/>
<RowDefinition Height="52*"/>
<RowDefinition Height="51*"/>
<RowDefinition Height="450*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="text1" FontFamily="Arial" FontSize="20" FontWeight="ExtraBold" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top" Height="54" Margin="89,0" Width="200" Foreground="White" TextAlignment="Center" ></TextBlock>

Comments
Join the conversation! Your thoughts help the community grow.