We take a Silverlight application and write the
following XAML code in editor
<Grid
x:Name="LayoutRoot"
Background="White"
ShowGridLines="True">
<TextBox
Height="36"
HorizontalAlignment="Left"
FontSize="17"
Text="{Binding
Path=fname}"
Margin="164,14,0,0"
Name="textBox1"
VerticalAlignment="Top"
Width="182"
/>
<TextBlock
Height="23"
HorizontalAlignment="Left"
Margin="81,16,0,0"
FontSize="18"
Name="textBlock1"
Text="Name
:"
VerticalAlignment="Top"
/>
</Grid>
And following code on
MainPage.xaml.vb
Partial Public Class MainPage
Inherits UserControl
Public Sub New()
InitializeComponent()
Dim obj As New abc()
obj.fname = "Alok Kumar"
textBox1.DataContext =
obj
End Sub
Public Class abc
Public Sub New()
End Sub
Public Property
fname() As String
Get
Return m_fname
End Get
Set(value As String)
m_fname = Value
End Set
End Property
Private m_fname As String
End Class
End Class
When, We run our application
the output will be look like below figure

