i am trying wpf for the first time and with lot of research and help from Pete O'Hanlon. i was able to come to a certain point. but after binding with the class and all i am still not able to get the value to the label when it changes in the code of class
I am using VS2008 framework 3.5
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Avenet Prduct Description Extractor" Height="396.627" Width="588.123" removed="AliceBlue" >
<Grid Height="341.077" Width="567.721" removed="AliceBlue">
<StackPanel Margin="170.225,226.418,3.143,0" Name="StackPanel1" Height="97.994" VerticalAlignment="Top">
<Label Height="30.906" Name="lblCrntSt1" Content="{Binding PrdFrstName}" Width="161" BorderThickness="2" BorderBrush="AliceBlue" Background="Red" Foreground="White" FontSize="13"></Label>
<Label Height="33.633" Name="lblcrntst2" Content="{Binding prdScndName}" Width="161" BorderThickness="2" BorderBrush="AliceBlue" Background="Red" Foreground="White" FontSize="13"></Label>
<Label Height="29.997" Name="lblcrntst3" Content="{Binding prdLastName}" Width="161" BorderThickness="2" BorderBrush="AliceBlue" Background="Red" Foreground="White" FontSize="13">Label State3</Label>
</StackPanel>
<StackPanel Margin="0,62.216,73.348,0" Name="StackPanel2" Height="94.816" VerticalAlignment="Top" removed="Honeydew" HorizontalAlignment="Right" Width="144.43">
<StackPanel.Resources>
<Style TargetType="Button">
<Setter Property="Margin" Value="0,07,0,0"></Setter>
</Style>
</StackPanel.Resources>
</Grid>
</Window>
here is the window class where it is initialized
Class Window1
Dim clsIniti As New ExtractDetails
Public Sub New()
InitializeComponent()
Me.DataContext = clsIniti
End Sub
end class
here is my class where it all happens. this is a separate class
Public Class ExtractDetails
Inherits UserControl
Implements System.ComponentModel.INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Private _prdFrstName, _prdScndName, _prdLastName As String
Private lstPdfDwn As List(Of String) = New List(Of String)
Dim intPgeLop As Integer = 0
Dim blnPgeLod As Boolean
#Region "Properties for Passing back the values to form"
Public Property PrdFrstName() As String
Get
Return _prdFrstName
End Get
Set(ByVal value As String)
If _prdFrstName <> value Then
_prdFrstName = value
OnPropertyChanged("PrdFrstName")
End If
End Set
End Property
Public Property prdScndName() As String
Get
Return _prdScndName
End Get
Set(ByVal value As String)
If _prdScndName <> value Then
_prdScndName = value
OnPropertyChanged("prdScndName")
End If
End Set
End Property
Public Property prdLastName() As String
Get
Return _prdLastName
End Get
Set(ByVal value As String)
If _prdLastName <> value Then
_prdLastName = value
OnPropertyChanged("prdLastName")
End If
End Set
End Property
Private Sub OnPropertyChanged(ByVal propertyName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
End Sub
#End Region
Public Sub suMainStrt(ByVal strFilePath As String)
PrdFrstName= "http://www.lg.com"
Call extract(webBrwFrst, strComurl(1))
webBrwFrst.Dispose()
webBrwFrst = Nothing
end sub
End Class
I m getting confused. please correct me. i am totally new to this WPF and MVVM
the extract function is working and i am getting all the details and every thing
i created this in windows forms and it is working great.
this is edited coed and i might have missed adding something. but i am not getting any errors as of such in my VS2008