Here we display text
using SilverLight TextBlock control programetically. So we follow
some steps.
Step 1 create Silverlight project that has two files App.xaml
and MainPage.xaml. This project also contains there code behind files
App.xaml.cs and MainPage.xaml.cs respectively.
Here App.xaml file is
loader for our Silverlight application and its code behind file App.xaml.cs
uses to handle global level events of application for application start, exit
and exceptions.
MainPage.xaml is
actually strat page when application runs. It contains Silverlight control
means it has XAML declarative format for UI. MainPage.xaml.cs uses to handle code behind
work of Silverlight controls. MainPage.xaml is like:
<UserControl x:Class="FirstExample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot">
</Grid>

Join the conversation! Your thoughts help the community grow.