Introduction
Here I am going to explain how to sort array elements in ascending order. It is very simple in C# because an array contains a built-in sort method to arrange the array element in ascending order. So you can sort the array very easily with less effort.
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
Write the following XAML code in "Mainpage.Xaml" (that is available in Solution Explorer):
<Page
x:Class="array_sorting.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:array_sorting"
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.RowDefinitions>
<RowDefinition Height="76*"/>
<RowDefinition Height="46*"/>
<RowDefinition Height="45*"/>
<RowDefinition Height="42*"/>
<RowDefinition Height="45*"/>
<RowDefinition Height="514*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="149*"/>
<ColumnDefinition Width="287*"/>
<ColumnDefinition Width="206*"/>
<ColumnDefinition Width="724*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Enter the Array Element" FontFamily="Arial" FontSize="20" FontWeight="ExtraBold" Grid.Column="1" Grid.Row="1"></TextBlock>
<TextBox x:Name="textbox1" Grid.Column="2" Grid.Row="1" VerticalAlignment="Top" Height="32" Width="175" HorizontalAlignment="Left" />
<Button x:Name="button1" Grid.Column="2" Grid.Row="2" Background="Yellow" Foreground="Black" Width="150" VerticalAlignment="Top" Height="35" Content="Insert" Click="button1_Click" ></Button>
<TextBlock x:Name="text1" Grid.Column="3" Grid.Row="1" Foreground="White" FontSize="20" FontFamily="Arial" FontWeight="ExtraBold" ></TextBlock>
<Button x:Name="button2" Grid.Column="2" Grid.Row="3" Background="Yellow" Foreground="Black" Width="150" VerticalAlignment="Top" Height="35" Content="Show" Click="button2_Click" ></Button>

Join the conversation! Your thoughts help the community grow.